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
Jonny Borges
2022-08-01 12:06:55 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
fc3c6d6df2cdddd677982ab36a0b09ce7e5fda25
fc3c6d6d
1 parent
41136b06
fix bottombar
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
26 additions
and
54 deletions
example_nav2/lib/app/modules/home/views/home_view.dart
example_nav2/pubspec.yaml
lib/get_core/get_core.dart
lib/get_core/src/flutter_engine.dart
lib/get_instance/src/lifecycle.dart
lib/get_navigation/src/extension_navigation.dart
lib/get_navigation/src/router_report.dart
lib/get_navigation/src/snackbar/snackbar.dart
lib/get_state_manager/src/simple/get_controllers.dart
example_nav2/lib/app/modules/home/views/home_view.dart
View file @
fc3c6d6
...
...
@@ -14,11 +14,12 @@ class HomeView extends GetView<HomeController> {
final
delegate
=
context
.
navigation
;
//This router outlet handles the appbar and the bottom navigation bar
final
currentLocation
=
context
.
location
;
print
(
currentLocation
);
var
currentIndex
=
0
;
if
(
currentLocation
.
startsWith
(
Routes
.
products
)
==
true
)
{
currentIndex
=
2
;
}
if
(
currentLocation
.
startsWith
(
Routes
.
pro
ducts
)
==
true
)
{
if
(
currentLocation
.
startsWith
(
Routes
.
pro
file
)
==
true
)
{
currentIndex
=
1
;
}
return
Scaffold
(
...
...
example_nav2/pubspec.yaml
View file @
fc3c6d6
...
...
@@ -3,7 +3,7 @@ version: 1.0.0+1
publish_to
:
none
description
:
A new Flutter project.
environment
:
sdk
:
"
>=2.1
2
.0
<3.0.0"
sdk
:
"
>=2.1
7
.0
<3.0.0"
dependencies
:
cupertino_icons
:
^1.0.2
...
...
lib/get_core/get_core.dart
View file @
fc3c6d6
library
get_core
;
export
'src/flutter_engine.dart'
;
export
'src/get_interface.dart'
;
export
'src/get_main.dart'
;
export
'src/log.dart'
;
export
'src/smart_management.dart'
;
export
'src/typedefs.dart'
;
...
...
lib/get_core/src/flutter_engine.dart
0 → 100644
View file @
fc3c6d6
import
'package:flutter/widgets.dart'
;
class
Engine
{
static
WidgetsBinding
get
instance
{
return
WidgetsFlutterBinding
.
ensureInitialized
();
}
}
\ No newline at end of file
...
...
lib/get_instance/src/lifecycle.dart
View file @
fc3c6d6
import
'package:flutter/foundation.dart'
;
import
'package:flutter/scheduler.dart'
;
import
'../../get.dart'
;
...
...
@@ -18,7 +17,8 @@ mixin GetLifeCycleMixin {
@protected
@mustCallSuper
void
onInit
()
{
ambiguate
(
SchedulerBinding
.
instance
)
ambiguate
(
Engine
.
instance
)
?.
addPostFrameCallback
((
_
)
=>
onReady
());
}
...
...
lib/get_navigation/src/extension_navigation.dart
View file @
fc3c6d6
import
'dart:ui'
as
ui
;
import
'package:flutter/material.dart'
;
import
'package:flutter/scheduler.dart'
;
import
'../../get_core/get_core.dart'
;
import
'../../get_instance/src/bindings_interface.dart'
;
...
...
@@ -358,7 +357,7 @@ extension ExtensionSnackbar on GetInterface {
if
(
instantInit
)
{
controller
.
show
();
}
else
{
ambiguate
(
SchedulerBinding
.
instance
)!.
addPostFrameCallback
((
_
)
{
ambiguate
(
Engine
.
instance
)!.
addPostFrameCallback
((
_
)
{
controller
.
show
();
});
}
...
...
@@ -469,7 +468,7 @@ extension ExtensionSnackbar on GetInterface {
controller
.
show
();
}
else
{
//routing.isSnackbar = true;
ambiguate
(
SchedulerBinding
.
instance
)!.
addPostFrameCallback
((
_
)
{
ambiguate
(
Engine
.
instance
)!.
addPostFrameCallback
((
_
)
{
controller
.
show
();
});
}
...
...
@@ -1170,14 +1169,14 @@ extension GetNavigationExt on GetInterface {
}
/// The window to which this binding is bound.
ui
.
SingletonFlutterWindow
get
window
=>
ui
.
window
;
ui
.
SingletonFlutterWindow
get
window
=>
engine
.
window
;
Locale
?
get
deviceLocale
=>
ui
.
window
.
locale
;
Locale
?
get
deviceLocale
=>
engine
.
window
.
locale
;
///The number of device pixels for each logical pixel.
double
get
pixelRatio
=>
ui
.
window
.
devicePixelRatio
;
double
get
pixelRatio
=>
engine
.
window
.
devicePixelRatio
;
Size
get
size
=>
ui
.
window
.
physicalSize
/
pixelRatio
;
Size
get
size
=>
engine
.
window
.
physicalSize
/
pixelRatio
;
///The horizontal extent of this size.
double
get
width
=>
size
.
width
;
...
...
@@ -1187,14 +1186,14 @@ extension GetNavigationExt on GetInterface {
///The distance from the top edge to the first unpadded pixel,
///in physical pixels.
double
get
statusBarHeight
=>
ui
.
window
.
padding
.
top
;
double
get
statusBarHeight
=>
engine
.
window
.
padding
.
top
;
///The distance from the bottom edge to the first unpadded pixel,
///in physical pixels.
double
get
bottomBarHeight
=>
ui
.
window
.
padding
.
bottom
;
double
get
bottomBarHeight
=>
engine
.
window
.
padding
.
bottom
;
///The system-reported text scale.
double
get
textScaleFactor
=>
ui
.
window
.
textScaleFactor
;
double
get
textScaleFactor
=>
engine
.
window
.
textScaleFactor
;
/// give access to TextTheme.of(context)
TextTheme
get
textTheme
=>
theme
.
textTheme
;
...
...
@@ -1260,41 +1259,8 @@ extension GetNavigationExt on GetInterface {
TDelegate
?
delegate
<
TDelegate
extends
RouterDelegate
<
TPage
>,
TPage
>()
=>
_getxController
.
routerDelegate
as
TDelegate
?;
// void resetRootNavigator() {
// _getxController = GetMaterialController();
// }
// RouterDelegate? get routerDelegate => _getxController.routerDelegate;
// RouteInformationParser? get routeInformationParser =>
// _getxController.routeInformationParser;
GetMaterialController
get
_getxController
=>
GetMaterialController
.
to
;
// void addPages(List<GetPage> getPages) {
// routeTree.addRoutes(getPages);
// }
// void clearRouteTree() {
// routeTree.routes.clear();
// }
// ParseRouteTree get routeTree {
// final delegate = _getxController.routerDelegate;
// if (delegate is GetDelegate) {
// return delegate.routeTree;
// } else {
// //TODO: Urgent: Refactor this
// return ParseRouteTree(routes: []);
// }
// }
// void addPage(GetPage getPage) {
// routeTree.addRoute(getPage);
// }
// void removePage(GetPage getPage) {
// routeTree.removeRoute(getPage);
// }
}
extension
OverlayExt
on
GetInterface
{
...
...
lib/get_navigation/src/router_report.dart
View file @
fc3c6d6
...
...
@@ -61,7 +61,7 @@ class RouterReportManager<T> {
void
reportRouteDispose
(
T
disposed
)
{
if
(
Get
.
smartManagement
!=
SmartManagement
.
onlyBuilder
)
{
ambiguate
(
WidgetsBinding
.
instance
)!.
addPostFrameCallback
((
_
)
{
ambiguate
(
Engine
.
instance
)!.
addPostFrameCallback
((
_
)
{
_removeDependencyByRoute
(
disposed
);
});
}
...
...
lib/get_navigation/src/snackbar/snackbar.dart
View file @
fc3c6d6
...
...
@@ -2,7 +2,6 @@ import 'dart:async';
import
'dart:ui'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/scheduler.dart'
;
import
'../../../get_core/get_core.dart'
;
import
'../../get_navigation.dart'
;
...
...
@@ -449,7 +448,7 @@ You need to either use message[String], or messageText[Widget] or define a userI
}
void
_configureLeftBarFuture
()
{
ambiguate
(
SchedulerBinding
.
instance
)!.
addPostFrameCallback
(
ambiguate
(
Engine
.
instance
)!.
addPostFrameCallback
(
(
_
)
{
final
keyContext
=
_backgroundBoxKey
.
currentContext
;
if
(
keyContext
!=
null
)
{
...
...
lib/get_state_manager/src/simple/get_controllers.dart
View file @
fc3c6d6
...
...
@@ -96,13 +96,13 @@ mixin FullLifeCycleMixin on FullLifeCycleController {
@override
void
onInit
()
{
super
.
onInit
();
ambiguate
(
WidgetsBinding
.
instance
)!.
addObserver
(
this
);
ambiguate
(
Engine
.
instance
)!.
addObserver
(
this
);
}
@mustCallSuper
@override
void
onClose
()
{
ambiguate
(
WidgetsBinding
.
instance
)!.
removeObserver
(
this
);
ambiguate
(
Engine
.
instance
)!.
removeObserver
(
this
);
super
.
onClose
();
}
...
...
Please
register
or
login
to post a comment