Closed RazvanRotaru closed 2 years ago
3 Warnings | |
---|---|
:warning: | Big PR |
:warning: | No test changes detected. You should usually add at least one test for any new functionality. |
:warning: | lib/pages/people/view/people_page.dart#L13 - The library 'package:flutter/material.dart' doesn't export a member with the hidden name 'Autocomplete' |
If this is a trivial change that doesn't warrant a test or changelog entry, you can mark it as #trivial in the PR title.
Generated by :no_entry_sign: Danger
Getting this exception when redirected to home page after authentication:
++++++++++++
restoreRouteInformation: Instance of 'HomePath'
++++++++++++
Error: Navigator.onGenerateRoute was null, but the route named "/home" was referenced.
To use the Navigator API with named routes (pushNamed, pushReplacementNamed, or pushNamedAndRemoveUntil), the Navigator must be provided with an onGenerateRoute handler.
The Navigator was:
NavigatorState#124f0(tickers: tracking 2 tickers)
at Object.throw_ [as throw] (http://localhost:53614/dart_sdk.js:4348:11)
at http://localhost:53614/packages/flutter/src/widgets/widget_span.dart.lib.js:22796:21
at navigator$.NavigatorState.new.[_routeNamed] (http://localhost:53614/packages/flutter/src/widgets/widget_span.dart.lib.js:22799:23)
at navigator$.NavigatorState.new.pushReplacementNamed (http://localhost:53614/packages/flutter/src/widgets/widget_span.dart.lib.js:22838:74)
at Function.pushReplacementNamed (http://localhost:53614/packages/flutter/src/widgets/widget_span.dart.lib.js:21050:63)
at http://localhost:53614/packages/acs_upb_mobile/pages/settings/view/settings_page.dart.lib.js:4884:39
at Generator.next (<anonymous>)
at http://localhost:53614/dart_sdk.js:37956:33
at _RootZone.runUnary (http://localhost:53614/dart_sdk.js:37810:58)
at _FutureListener.thenAwait.handleValue (http://localhost:53614/dart_sdk.js:32771:29)
at handleValueCallback (http://localhost:53614/dart_sdk.js:33319:49)
at Function._propagateToListeners (http://localhost:53614/dart_sdk.js:33357:17)
at _Future.new.[_completeWithValue] (http://localhost:53614/dart_sdk.js:33199:23)
at async._AsyncCallbackEntry.new.callback (http://localhost:53614/dart_sdk.js:33222:35)
at Object._microtaskLoop (http://localhost:53614/dart_sdk.js:38071:13)
at _startMicrotaskLoop (http://localhost:53614/dart_sdk.js:38077:13)
at http://localhost:53614/dart_sdk.js:33574:9
Getting this exception when redirected to home page after authentication:
++++++++++++ restoreRouteInformation: Instance of 'HomePath' ++++++++++++ Error: Navigator.onGenerateRoute was null, but the route named "/home" was referenced. To use the Navigator API with named routes (pushNamed, pushReplacementNamed, or pushNamedAndRemoveUntil), the Navigator must be provided with an onGenerateRoute handler. The Navigator was: NavigatorState#124f0(tickers: tracking 2 tickers) at Object.throw_ [as throw] (http://localhost:53614/dart_sdk.js:4348:11) at http://localhost:53614/packages/flutter/src/widgets/widget_span.dart.lib.js:22796:21 at navigator$.NavigatorState.new.[_routeNamed] (http://localhost:53614/packages/flutter/src/widgets/widget_span.dart.lib.js:22799:23) at navigator$.NavigatorState.new.pushReplacementNamed (http://localhost:53614/packages/flutter/src/widgets/widget_span.dart.lib.js:22838:74) at Function.pushReplacementNamed (http://localhost:53614/packages/flutter/src/widgets/widget_span.dart.lib.js:21050:63) at http://localhost:53614/packages/acs_upb_mobile/pages/settings/view/settings_page.dart.lib.js:4884:39 at Generator.next (<anonymous>) at http://localhost:53614/dart_sdk.js:37956:33 at _RootZone.runUnary (http://localhost:53614/dart_sdk.js:37810:58) at _FutureListener.thenAwait.handleValue (http://localhost:53614/dart_sdk.js:32771:29) at handleValueCallback (http://localhost:53614/dart_sdk.js:33319:49) at Function._propagateToListeners (http://localhost:53614/dart_sdk.js:33357:17) at _Future.new.[_completeWithValue] (http://localhost:53614/dart_sdk.js:33199:23) at async._AsyncCallbackEntry.new.callback (http://localhost:53614/dart_sdk.js:33222:35) at Object._microtaskLoop (http://localhost:53614/dart_sdk.js:38071:13) at _startMicrotaskLoop (http://localhost:53614/dart_sdk.js:38077:13) at http://localhost:53614/dart_sdk.js:33574:9
This is odd because Navigator.onGenerateRoute
should not be called and also the tests passed. I double checked it in a clean project. It should work. Did you run pub get
?
This is odd because
Navigator.onGenerateRoute
should not be called and also the tests passed. I double checked it in a clean project. It should work. Did you runpub get
?
Tested on wrong branch. My bad. Didn't notice this exception on web/layout/refined_navigation.
This solves #209.
A custom navigation option
AppNavigator
is implemented and used instead of the basicNavigator
. This method assures that the web navigation will have Navigator 2.0 features as history, back and forward support, while mobile navigation will remain the same, using the basic imperative Navigator.Navigator 2.0 overview
It requires at least 3 components (in this case 4):
RouteInformation
NavigationState
RoutePath
, the connection status https://github.com/student-hub/acs-upb-mobile/blob/web/layout/refined_navigation/lib/navigation/model/navigation_state.dartRouterDelegate
NavigationState
.Widget
saved in theRoutePath
fromNavigationState
https://github.com/student-hub/acs-upb-mobile/blob/web/layout/refined_navigation/lib/navigation/service/app_router_delegates.dart#L134:L137)RouterInformationParser
RoutePath
from a given URLImportant implementation details:
AppNavigator.of(context).push(...)
does not exists, the syntax will need to beAppNavigator.push(context, ...)
Navigator
options are implemented, just the ones that were used up until nowpush
andpushAndReplace
a specificwebPath
to map the new Widget/MaterialRouteRoutePath
https://github.com/student-hub/acs-upb-mobile/blob/web/layout/refined_navigation/lib/navigation/service/app_router_delegates.dart#L138:L142