Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
fluttertpc_get
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Ahmed Fwela
2021-08-02 01:47:44 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
963d837a0daa30a131fdc348968a9b777f7e69ab
963d837a
1 parent
ebbb5551
added PageBindings that references GetPageRoute in [dependencies] method
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
13 deletions
lib/get_instance/src/bindings_interface.dart
lib/get_navigation/src/nav2/get_router_delegate.dart
lib/get_navigation/src/routes/default_route.dart
lib/get_instance/src/bindings_interface.dart
View file @
963d837
import
'../../get_navigation/src/routes/default_route.dart'
;
import
'get_instance.dart'
;
/// [Bindings] should be extended or implemented.
...
...
@@ -10,6 +12,11 @@ abstract class Bindings {
void
dependencies
();
}
abstract
class
PageBindings
extends
Bindings
{
@override
void
dependencies
([
GetPageRoute
?
page
]);
}
/// Simplifies Bindings generation from a single callback.
/// To avoid the creation of a custom Binding instance per route.
///
...
...
lib/get_navigation/src/nav2/get_router_delegate.dart
View file @
963d837
...
...
@@ -299,14 +299,6 @@ class GetDelegate extends RouterDelegate<GetNavConfig>
);
}
// @override
// Future<void> setInitialRoutePath(GetNavConfig configuration) async {
// //no need to clear history with Reorder route strategy
// // _unsafeHistoryClear();
// // _resultCompleter.clear();
// await pushHistory(configuration);
// }
@override
Future
<
void
>
setNewRoutePath
(
GetNavConfig
configuration
)
async
{
await
pushHistory
(
configuration
);
...
...
lib/get_navigation/src/routes/default_route.dart
View file @
963d837
...
...
@@ -89,11 +89,15 @@ class GetPageRoute<T> extends PageRoute<T> with GetPageRouteTransitionMixin<T> {
Widget
buildContent
(
BuildContext
context
)
{
final
middlewareRunner
=
MiddlewareRunner
(
middlewares
);
final
bindingsToBind
=
middlewareRunner
.
runOnBindingsStart
(
bindings
);
binding
?.
dependencies
();
if
(
bindingsToBind
!=
null
)
{
for
(
final
binding
in
bindingsToBind
)
{
binding
.
dependencies
();
final
_bindingList
=
[
if
(
binding
!=
null
)
binding
!,
...?
bindingsToBind
,
];
for
(
var
_b
in
_bindingList
)
{
if
(
_b
is
PageBindings
)
{
_b
.
dependencies
(
this
);
}
else
{
_b
.
dependencies
();
}
}
...
...
Please
register
or
login
to post a comment