예제 #1
0
        public override string ToString()
        {
            RouteSettings from = this.manifest.fromRoute.settings;
            RouteSettings to   = this.manifest.toRoute.settings;
            object        tag  = this.manifest.tag;

            return("HeroFlight(for: $tag, from: $from, to: $to ${_proxyAnimation.parent})");
        }
예제 #2
0
        public override string ToString()
        {
            RouteSettings from = manifest.fromRoute.settings;
            RouteSettings to   = manifest.toRoute.settings;
            object        tag  = manifest.tag;

            return($"HeroFlight(for: {tag}, from: {from}, to: {to} {_proxyAnimation.parent})");
        }
예제 #3
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;
 }
예제 #4
0
        Route _routeNamed(string name, object arguments, bool allowNull = false)
        {
            D.assert(!this._debugLocked);
            D.assert(name != null);
            var settings = new RouteSettings(
                name: name,
                isInitialRoute: this._history.isEmpty(),
                arguments: arguments
                );

            var route = (Route)this.widget.onGenerateRoute(settings);

            if (route == null && !allowNull)
            {
                D.assert(() => {
                    if (this.widget.onUnknownRoute == null)
                    {
                        throw new UIWidgetsError(
                            "If a Navigator has no onUnknownRoute, then its onGenerateRoute must never return null.\n" +
                            $"When trying to build the route \"{name}\", onGenerateRoute returned null, but there was no " +
                            "onUnknownRoute callback specified.\n" +
                            "The Navigator was:\n" +
                            $"  {this}");
                    }

                    return(true);
                });

                route = (Route)this.widget.onUnknownRoute(settings);
                D.assert(() => {
                    if (route == null)
                    {
                        throw new UIWidgetsError(
                            "A Navigator\'s onUnknownRoute returned null.\n" +
                            $"When trying to build the route \"{name}\", both onGenerateRoute and onUnknownRoute returned " +
                            "null. The onUnknownRoute callback should never return null.\n" +
                            "The Navigator was:\n" +
                            $"  {this}"
                            );
                    }

                    return(true);
                });
            }

            return(route);
        }
예제 #5
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;
 }
예제 #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;
 }
예제 #7
0
파일: app.cs 프로젝트: silingfei/UIWidgets
        Route _onUnknownRoute(RouteSettings settings)
        {
            D.assert(() => {
                if (this.widget.onUnknownRoute == null)
                {
                    throw new UIWidgetsError(
                        $"Could not find a generator for route {settings} in the {this.GetType()}.\n" +
                        $"Generators for routes are searched for in the following order:\n" +
                        " 1. For the \"/\" route, the \"home\" property, if non-null, is used.\n" +
                        " 2. Otherwise, the \"routes\" table is used, if it has an entry for " +
                        "the route.\n" +
                        " 3. Otherwise, onGenerateRoute is called. It should return a " +
                        "non-null value for any valid route not handled by \"home\" and \"routes\".\n" +
                        " 4. Finally if all else fails onUnknownRoute is called.\n" +
                        "Unfortunately, onUnknownRoute was not set."
                        );
                }

                return(true);
            });
            var result = this.widget.onUnknownRoute(settings);

            D.assert(() => {
                if (result == null)
                {
                    throw new UIWidgetsError(
                        "The onUnknownRoute callback returned null.\n" +
                        "When the $runtimeType requested the route $settings from its " +
                        "onUnknownRoute callback, the callback returned null. Such callbacks " +
                        "must never return null."
                        );
                }

                return(true);
            });
            return(result);
        }
예제 #8
0
 protected PopupRoute(
     RouteSettings settings = null
     ) : base(settings: settings)
 {
 }
예제 #9
0
 public TransitionRoute(
     RouteSettings settings = null
     ) : base(settings)
 {
 }
예제 #10
0
 protected ModalRoute(RouteSettings settings) : base(settings)
 {
 }
예제 #11
0
 protected LocalHistoryRouteTransitionRoute(RouteSettings settings = null) : base(settings: settings)
 {
 }
예제 #12
0
 public OverlayRoute(
     RouteSettings settings = null
     ) : base(settings)
 {
 }
예제 #13
0
 public Route(RouteSettings settings = null)
 {
     this.settings = settings ?? new RouteSettings();
 }
예제 #14
0
 public PopupRoute(
     RouteSettings settings = null,
     ImageFilter filter     = null
     ) : base(settings: settings, filter: filter)
 {
 }
예제 #15
0
 public PageRoute(RouteSettings settings, bool fullscreenDialog = false) : base(settings)
 {
     this.fullscreenDialog = fullscreenDialog;
 }