示例#1
0
 public static Future <T> showGeneralDialog <T>(
     BuildContext context         = null,
     RoutePageBuilder pageBuilder = null,
     bool?barrierDismissible      = null,
     string barrierLabel          = null,
     Color barrierColor           = null,
     TimeSpan?transitionDuration  = null,
     RouteTransitionsBuilder transitionBuilder = null,
     bool useRootNavigator       = true,
     RouteSettings routeSettings = null
     )
 {
     //D.assert(!barrierDismissible || barrierLabel != null);
     D.assert(pageBuilder != null);
     return(Navigator.of(context, rootNavigator: true).push(
                new _DialogRoute(
                    pageBuilder: pageBuilder,
                    barrierDismissible: barrierDismissible ?? false,
                    barrierLabel: barrierLabel,
                    barrierColor: barrierColor,
                    transitionDuration: transitionDuration,
                    transitionBuilder: transitionBuilder,
                    settings: routeSettings)  as Route
                ).to <T>());
 }
示例#2
0
 internal _DialogRoute(RoutePageBuilder pageBuilder = null, bool barrierDismissible = true,
                       Color barrierColor           = null,
                       TimeSpan?transitionDuration  = null,
                       RouteTransitionsBuilder transitionBuilder = null,
                       RouteSettings setting = null) : base(settings: setting)
 {
     this._pageBuilder       = pageBuilder;
     this.barrierDismissible = barrierDismissible;
     this.barrierColor       = barrierColor ?? new Color(0x80000000);
     this.transitionDuration = transitionDuration ?? TimeSpan.FromMilliseconds(200);
     this._transitionBuilder = transitionBuilder;
 }
示例#3
0
 internal _DialogRoute(
     RoutePageBuilder pageBuilder = null,
     bool barrierDismissible      = true,
     string barrierLabel          = null,
     Color barrierColor           = null,
     TimeSpan?transitionDuration  = null,
     RouteTransitionsBuilder transitionBuilder = null,
     RouteSettings settings = null
     ) : base(settings: settings)
 {
     _pageBuilder        = pageBuilder;
     _barrierLabel       = barrierLabel;
     _barrierDismissible = barrierDismissible;
     _barrierColor       = barrierColor ?? new Color(0x80000000);
     _transitionDuration = transitionDuration ?? TimeSpan.FromMilliseconds(200);
     _transitionBuilder  = transitionBuilder;
 }
示例#4
0
 public CustomPageRoute(
     WidgetBuilder builder,
     RouteSettings settings = null,
     string title           = "",
     bool maintainState     = true,
     bool fullscreenDialog  = false,
     RouteTransitionsBuilder overrideTransitionsBuilder = null
     ) :
     base(settings: settings, fullscreenDialog: fullscreenDialog)
 {
     D.assert(builder != null);
     D.assert(this.opaque);
     this.builder       = builder;
     this.title         = title;
     this.maintainState = maintainState;
     this.overrideTransitionsBuilder = overrideTransitionsBuilder;
 }
示例#5
0
 public static IPromise <object> showGeneralDialog(
     BuildContext context         = null,
     RoutePageBuilder pageBuilder = null,
     bool barrierDismissible      = false,
     Color barrierColor           = null,
     TimeSpan?transitionDuration  = null,
     RouteTransitionsBuilder transitionBuilder = null
     )
 {
     D.assert(pageBuilder != null);
     return(Navigator.of(context, rootNavigator: true).push(new _DialogRoute(
                                                                pageBuilder: pageBuilder,
                                                                barrierDismissible: barrierDismissible,
                                                                barrierColor: barrierColor,
                                                                transitionDuration: transitionDuration,
                                                                transitionBuilder: transitionBuilder
                                                                )));
 }
示例#6
0
 public PageRouteBuilder(
     RouteSettings settings       = null,
     RoutePageBuilder pageBuilder = null,
     RouteTransitionsBuilder transitionsBuilder = null,
     TimeSpan?transitionDuration = null,
     bool opaque             = true,
     bool barrierDismissible = false,
     Color barrierColor      = null,
     bool maintainState      = true
     ) : base(settings)
 {
     D.assert(pageBuilder != null);
     this.opaque             = opaque;
     this.pageBuilder        = pageBuilder;
     this.transitionsBuilder = transitionsBuilder ?? this._defaultTransitionsBuilder;
     this.transitionDuration = transitionDuration ?? TimeSpan.FromMilliseconds(300);
     this.barrierColor       = barrierColor;
     this.maintainState      = maintainState;
     this.barrierDismissible = barrierDismissible;
 }