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
Aniket Khote
2024-05-14 21:05:01 +0530
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6da6d505bb46134c5aff8f2112a57ae2b3b69f6d
6da6d505
1 parent
414785e7
Refactor and removed deprecated methods
Hide whitespace changes
Inline
Side-by-side
Showing
44 changed files
with
134 additions
and
166 deletions
.github/workflows/main.yml
example_nav2/android/local.properties
lib/get_connect/http/src/response/response.dart
lib/get_connect/sockets/sockets.dart
lib/get_navigation/src/bottomsheet/bottomsheet.dart
lib/get_navigation/src/dialog/dialog_route.dart
lib/get_navigation/src/extension_navigation.dart
lib/get_navigation/src/root/get_cupertino_app.dart
lib/get_navigation/src/root/get_material_app.dart
lib/get_navigation/src/root/get_root.dart
lib/get_navigation/src/routes/default_route.dart
lib/get_navigation/src/routes/get_navigator.dart
lib/get_navigation/src/routes/get_transition_mixin.dart
lib/get_navigation/src/routes/modules.dart
lib/get_navigation/src/routes/route_report.dart
lib/get_navigation/src/routes/router_outlet.dart
lib/get_navigation/src/snackbar/snackbar.dart
lib/get_rx/src/rx_stream/mini_stream.dart
lib/get_rx/src/rx_types/rx_core/rx_impl.dart
lib/get_rx/src/rx_types/rx_core/rx_interface.dart
lib/get_rx/src/rx_types/rx_core/rx_num.dart
lib/get_rx/src/rx_types/rx_core/rx_string.dart
lib/get_rx/src/rx_types/rx_iterables/rx_list.dart
lib/get_rx/src/rx_types/rx_iterables/rx_map.dart
lib/get_rx/src/rx_types/rx_iterables/rx_set.dart
lib/get_state_manager/src/rx_flutter/rx_notifier.dart
lib/get_state_manager/src/rx_flutter/rx_obx_widget.dart
lib/get_state_manager/src/rx_flutter/rx_ticket_provider_mixin.dart
lib/get_state_manager/src/simple/get_responsive.dart
lib/get_state_manager/src/simple/get_state.dart
lib/get_state_manager/src/simple/get_view.dart
lib/get_state_manager/src/simple/get_widget_cache.dart
lib/get_state_manager/src/simple/mixin_builder.dart
lib/get_state_manager/src/simple/simple_builder.dart
lib/get_utils/src/equality/equality.dart
lib/get_utils/src/extensions/context_extensions.dart
lib/get_utils/src/widgets/otimized_listview.dart → lib/get_utils/src/widgets/optimized_listview.dart
pubspec.yaml
test/navigation/dialog_test.dart
test/navigation/get_main_test.dart
test/navigation/utils/wrapper.dart
test/utils/extensions/context_extensions_test.dart
test/utils/platform_test.dart
test/utils/platform_web_test.dart
.github/workflows/main.yml
View file @
6da6d50
...
...
@@ -23,7 +23,7 @@ jobs:
# https://github.com/marketplace/actions/flutter-action
-
uses
:
subosito/flutter-action@v2
with
:
flutter-version
:
"
3.
19.3
"
flutter-version
:
"
3.
22.0
"
channel
:
"
stable"
-
run
:
flutter pub get
#- run: flutter analyze
...
...
example_nav2/android/local.properties
View file @
6da6d50
sdk.dir
=
/Users/jonatasborges/Library/Android/sdk
flutter.sdk
=
/Users/jonatasborges/flutter
\ No newline at end of file
sdk.dir
=
C:
\\
Users
\\
anike
\\
AppData
\\
Local
\\
Android
\\
sdk
flutter.sdk
=
C:
\\
flutter
\ No newline at end of file
...
...
lib/get_connect/http/src/response/response.dart
View file @
6da6d50
...
...
@@ -8,7 +8,7 @@ import '../status/http_status.dart';
class
GraphQLResponse
<
T
>
extends
Response
<
T
>
{
final
List
<
GraphQLError
>?
graphQLErrors
;
GraphQLResponse
({
T
?
body
,
this
.
graphQLErrors
})
:
super
(
body:
body
);
GraphQLResponse
({
super
.
body
,
this
.
graphQLErrors
}
);
GraphQLResponse
.
fromResponse
(
Response
res
)
:
graphQLErrors
=
null
,
...
...
lib/get_connect/sockets/sockets.dart
View file @
6da6d50
...
...
@@ -3,7 +3,5 @@ import 'src/sockets_stub.dart'
if
(
dart
.
library
.
io
)
'src/sockets_io.dart'
;
class
GetSocket
extends
BaseWebSocket
{
GetSocket
(
String
url
,
{
Duration
ping
=
const
Duration
(
seconds:
5
),
bool
allowSelfSigned
=
true
})
:
super
(
url
,
ping:
ping
,
allowSelfSigned:
allowSelfSigned
);
GetSocket
(
super
.
url
,
{
super
.
ping
,
super
.
allowSelfSigned
});
}
...
...
lib/get_navigation/src/bottomsheet/bottomsheet.dart
View file @
6da6d50
...
...
@@ -18,11 +18,11 @@ class GetModalBottomSheetRoute<T> extends PopupRoute<T> {
this
.
isDismissible
=
true
,
this
.
enableDrag
=
true
,
required
this
.
isScrollControlled
,
RouteSettings
?
settings
,
super
.
settings
,
this
.
enterBottomSheetDuration
=
const
Duration
(
milliseconds:
250
),
this
.
exitBottomSheetDuration
=
const
Duration
(
milliseconds:
200
),
this
.
curve
,
})
:
super
(
settings:
settings
)
{
})
{
RouterReportManager
.
instance
.
reportCurrentRoute
(
this
);
}
final
bool
?
isPersistent
;
...
...
@@ -115,7 +115,7 @@ class GetModalBottomSheetRoute<T> extends PopupRoute<T> {
class
_GetModalBottomSheet
<
T
>
extends
StatefulWidget
{
const
_GetModalBottomSheet
({
Key
?
key
,
super
.
key
,
this
.
route
,
this
.
backgroundColor
,
this
.
elevation
,
...
...
@@ -124,7 +124,7 @@ class _GetModalBottomSheet<T> extends StatefulWidget {
this
.
isScrollControlled
=
false
,
this
.
enableDrag
=
true
,
this
.
isPersistent
=
false
,
})
:
super
(
key:
key
)
;
});
final
bool
isPersistent
;
final
GetModalBottomSheetRoute
<
T
>?
route
;
final
bool
isScrollControlled
;
...
...
@@ -214,7 +214,7 @@ class _GetModalBottomSheetState<T> extends State<_GetModalBottomSheet<T>> {
class
_GetPerModalBottomSheet
<
T
>
extends
StatefulWidget
{
const
_GetPerModalBottomSheet
({
Key
?
key
,
super
.
key
,
this
.
route
,
this
.
isPersistent
,
this
.
backgroundColor
,
...
...
@@ -223,7 +223,7 @@ class _GetPerModalBottomSheet<T> extends StatefulWidget {
this
.
clipBehavior
,
this
.
isScrollControlled
=
false
,
this
.
enableDrag
=
true
,
})
:
super
(
key:
key
)
;
});
final
bool
?
isPersistent
;
final
GetModalBottomSheetRoute
<
T
>?
route
;
final
bool
isScrollControlled
;
...
...
lib/get_navigation/src/dialog/dialog_route.dart
View file @
6da6d50
...
...
@@ -10,14 +10,13 @@ class GetDialogRoute<T> extends PopupRoute<T> {
Color
barrierColor
=
const
Color
(
0x80000000
),
Duration
transitionDuration
=
const
Duration
(
milliseconds:
200
),
RouteTransitionsBuilder
?
transitionBuilder
,
RouteSettings
?
settings
,
super
.
settings
,
})
:
widget
=
pageBuilder
,
_barrierDismissible
=
barrierDismissible
,
_barrierLabel
=
barrierLabel
,
_barrierColor
=
barrierColor
,
_transitionDuration
=
transitionDuration
,
_transitionBuilder
=
transitionBuilder
,
super
(
settings:
settings
)
{
_transitionBuilder
=
transitionBuilder
{
RouterReportManager
.
instance
.
reportCurrentRoute
(
this
);
}
...
...
lib/get_navigation/src/extension_navigation.dart
View file @
6da6d50
...
...
@@ -171,7 +171,7 @@ extension ExtensionDialog on GetInterface {
List
<
Widget
>?
actions
,
// onWillPop Scope
WillPop
Callback
?
onWillPop
,
PopInvoked
Callback
?
onWillPop
,
// the navigator used to push the dialog
GlobalKey
<
NavigatorState
>?
navigatorKey
,
...
...
@@ -225,7 +225,7 @@ extension ExtensionDialog on GetInterface {
child:
Text
(
textConfirm
??
"Ok"
,
style:
TextStyle
(
color:
confirmTextColor
??
theme
.
colorScheme
.
background
),
color:
confirmTextColor
??
theme
.
colorScheme
.
surface
),
),
onPressed:
()
{
onConfirm
?.
call
();
...
...
@@ -267,8 +267,8 @@ extension ExtensionDialog on GetInterface {
return
dialog
<
T
>(
onWillPop
!=
null
?
WillPopScope
(
onWillPop:
onWillPop
,
?
PopScope
(
onPopInvoked:
onWillPop
,
child:
baseAlertDialog
,
)
:
baseAlertDialog
,
...
...
@@ -1283,7 +1283,7 @@ extension GetNavigationExt on GetInterface {
/// Check if dark mode theme is enable on platform on android Q+
bool
get
isPlatformDarkMode
=>
(
ui
.
window
.
platformBrightness
==
Brightness
.
dark
);
(
ui
.
PlatformDispatcher
.
instance
.
platformBrightness
==
Brightness
.
dark
);
/// give access to Theme.of(context).iconTheme.color
Color
?
get
iconColor
=>
theme
.
iconTheme
.
color
;
...
...
lib/get_navigation/src/root/get_cupertino_app.dart
View file @
6da6d50
...
...
@@ -67,7 +67,7 @@ class GetCupertinoApp extends StatelessWidget {
final
ScrollBehavior
?
scrollBehavior
;
const
GetCupertinoApp
({
Key
?
key
,
super
.
key
,
this
.
theme
,
this
.
navigatorKey
,
this
.
home
,
...
...
@@ -124,11 +124,10 @@ class GetCupertinoApp extends StatelessWidget {
backButtonDispatcher
=
null
,
routeInformationParser
=
null
,
routerDelegate
=
null
,
routerConfig
=
null
,
super
(
key:
key
);
routerConfig
=
null
;
const
GetCupertinoApp
.
router
({
Key
?
key
,
super
.
key
,
this
.
theme
,
this
.
routeInformationProvider
,
this
.
routeInformationParser
,
...
...
@@ -183,8 +182,7 @@ class GetCupertinoApp extends StatelessWidget {
onGenerateInitialRoutes
=
null
,
onUnknownRoute
=
null
,
routes
=
null
,
initialRoute
=
null
,
super
(
key:
key
);
initialRoute
=
null
;
@override
Widget
build
(
BuildContext
context
)
{
...
...
lib/get_navigation/src/root/get_material_app.dart
View file @
6da6d50
...
...
@@ -68,7 +68,7 @@ class GetMaterialApp extends StatelessWidget {
final
bool
useInheritedMediaQuery
;
const
GetMaterialApp
({
Key
?
key
,
super
.
key
,
this
.
navigatorKey
,
this
.
scaffoldMessengerKey
,
this
.
home
,
...
...
@@ -128,11 +128,10 @@ class GetMaterialApp extends StatelessWidget {
backButtonDispatcher
=
null
,
routeInformationParser
=
null
,
routerDelegate
=
null
,
routerConfig
=
null
,
super
(
key:
key
);
routerConfig
=
null
;
const
GetMaterialApp
.
router
({
Key
?
key
,
super
.
key
,
this
.
routeInformationProvider
,
this
.
scaffoldMessengerKey
,
this
.
routeInformationParser
,
...
...
@@ -190,8 +189,7 @@ class GetMaterialApp extends StatelessWidget {
onGenerateInitialRoutes
=
null
,
onUnknownRoute
=
null
,
routes
=
null
,
initialRoute
=
null
,
super
(
key:
key
);
initialRoute
=
null
;
@override
Widget
build
(
BuildContext
context
)
{
...
...
lib/get_navigation/src/root/get_root.dart
View file @
6da6d50
...
...
@@ -278,10 +278,10 @@ class ConfigData {
class
GetRoot
extends
StatefulWidget
{
const
GetRoot
({
Key
?
key
,
super
.
key
,
required
this
.
config
,
required
this
.
child
,
})
:
super
(
key:
key
)
;
});
final
ConfigData
config
;
final
Widget
child
;
@override
...
...
lib/get_navigation/src/routes/default_route.dart
View file @
6da6d50
...
...
@@ -39,7 +39,7 @@ class GetPageRoute<T> extends PageRoute<T>
/// The [builder], [maintainState], and [fullscreenDialog] arguments must not
/// be null.
GetPageRoute
({
RouteSettings
?
settings
,
super
.
settings
,
this
.
transitionDuration
=
const
Duration
(
milliseconds:
300
),
this
.
reverseTransitionDuration
=
const
Duration
(
milliseconds:
300
),
this
.
opaque
=
true
,
...
...
@@ -61,13 +61,9 @@ class GetPageRoute<T> extends PageRoute<T>
this
.
showCupertinoParallax
=
true
,
this
.
barrierLabel
,
this
.
maintainState
=
true
,
bool
fullscreenDialog
=
false
,
super
.
fullscreenDialog
,
this
.
middlewares
,
})
:
bindings
=
(
binding
==
null
)
?
bindings
:
[...
bindings
,
binding
],
super
(
settings:
settings
,
fullscreenDialog:
fullscreenDialog
,
);
})
:
bindings
=
(
binding
==
null
)
?
bindings
:
[...
bindings
,
binding
];
@override
final
Duration
transitionDuration
;
...
...
lib/get_navigation/src/routes/get_navigator.dart
View file @
6da6d50
...
...
@@ -4,18 +4,16 @@ import '../../../get.dart';
class
GetNavigator
extends
Navigator
{
GetNavigator
.
onGenerateRoute
({
GlobalKey
<
NavigatorState
>?
key
,
GlobalKey
<
NavigatorState
>?
super
.
key
,
bool
Function
(
Route
<
dynamic
>,
dynamic
)?
onPopPage
,
required
List
<
GetPage
>
pages
,
required
List
<
GetPage
>
super
.
pages
,
List
<
NavigatorObserver
>?
observers
,
bool
reportsRouteUpdateToEngine
=
fals
e
,
super
.
reportsRouteUpdateToEngin
e
,
TransitionDelegate
?
transitionDelegate
,
String
?
initialRoute
,
String
?
restorationScopeId
,
super
.
initialRoute
,
super
.
restorationScopeId
,
})
:
super
(
//keys should be optional
key:
key
,
initialRoute:
initialRoute
,
onPopPage:
onPopPage
??
(
route
,
result
)
{
final
didPop
=
route
.
didPop
(
result
);
...
...
@@ -36,9 +34,6 @@ class GetNavigator extends Navigator {
}
return
null
;
},
reportsRouteUpdateToEngine:
reportsRouteUpdateToEngine
,
restorationScopeId:
restorationScopeId
,
pages:
pages
,
observers:
[
// GetObserver(),
...?
observers
,
...
...
@@ -48,18 +43,16 @@ class GetNavigator extends Navigator {
);
GetNavigator
({
Key
?
key
,
super
.
key
,
bool
Function
(
Route
<
dynamic
>,
dynamic
)?
onPopPage
,
required
List
<
GetPage
>
pages
,
required
List
<
GetPage
>
super
.
pages
,
List
<
NavigatorObserver
>?
observers
,
bool
reportsRouteUpdateToEngine
=
fals
e
,
super
.
reportsRouteUpdateToEngin
e
,
TransitionDelegate
?
transitionDelegate
,
String
?
initialRoute
,
String
?
restorationScopeId
,
super
.
initialRoute
,
super
.
restorationScopeId
,
})
:
super
(
//keys should be optional
key:
key
,
initialRoute:
initialRoute
,
onPopPage:
onPopPage
??
(
route
,
result
)
{
final
didPop
=
route
.
didPop
(
result
);
...
...
@@ -68,9 +61,6 @@ class GetNavigator extends Navigator {
}
return
true
;
},
reportsRouteUpdateToEngine:
reportsRouteUpdateToEngine
,
restorationScopeId:
restorationScopeId
,
pages:
pages
,
observers:
[
// GetObserver(null, Get.routing),
HeroController
(),
...
...
lib/get_navigation/src/routes/get_transition_mixin.dart
View file @
6da6d50
...
...
@@ -23,14 +23,14 @@ const int _kMaxPageBackAnimationTime = 300; // Milliseconds.
class
GetBackGestureDetector
<
T
>
extends
StatefulWidget
{
const
GetBackGestureDetector
({
Key
?
key
,
super
.
key
,
required
this
.
limitedSwipe
,
required
this
.
gestureWidth
,
required
this
.
initialOffset
,
required
this
.
popGestureEnable
,
required
this
.
onStartPopGesture
,
required
this
.
child
,
})
:
super
(
key:
key
)
;
});
final
bool
limitedSwipe
;
final
double
gestureWidth
;
...
...
@@ -370,8 +370,7 @@ Cannot read the previousTitle for a route that has not yet been installed''',
// In the middle of a back gesture drag, let the transition be linear to
// match finger motions.
final
route
=
rawRoute
as
GetPageRoute
<
T
>;
final
linearTransition
=
CupertinoRouteTransitionMixin
.
isPopGestureInProgress
(
route
);
final
linearTransition
=
route
.
popGestureInProgress
;
final
finalCurve
=
route
.
curve
??
Get
.
defaultTransitionCurve
;
final
hasCurve
=
route
.
curve
!=
null
;
if
(
route
.
fullscreenDialog
&&
route
.
transition
==
null
)
{
...
...
@@ -777,9 +776,6 @@ Cannot read the previousTitle for a route that has not yet been installed''',
// would be really confusing (or would skip internal routes),
// so disallow it.
if
(
route
.
willHandlePopInternally
)
return
false
;
// If attempts to dismiss this route might be vetoed such as in a page
// with forms, then do not allow the user to dismiss the route with a swipe.
if
(
route
.
hasScopedWillPopCallback
)
return
false
;
// support [PopScope]
if
(
route
.
popDisposition
==
RoutePopDisposition
.
doNotPop
)
return
false
;
// Fullscreen dialogs aren't dismissible by back swipe.
...
...
@@ -826,8 +822,8 @@ class _DirectionalityDragGestureRecognizer
required
this
.
isLTR
,
required
this
.
popGestureEnable
,
required
this
.
hasbackGestureController
,
Object
?
debugOwner
,
})
:
super
(
debugOwner:
debugOwner
);
super
.
debugOwner
,
});
@override
void
handleEvent
(
PointerEvent
event
)
{
...
...
lib/get_navigation/src/routes/modules.dart
View file @
6da6d50
...
...
@@ -57,7 +57,7 @@ class Dependencies {
}
abstract
class
Module
extends
StatefulWidget
{
const
Module
({
Key
?
key
})
:
super
(
key:
key
);
const
Module
({
super
.
key
}
);
Widget
view
(
BuildContext
context
);
...
...
lib/get_navigation/src/routes/route_report.dart
View file @
6da6d50
...
...
@@ -4,7 +4,7 @@ import '../router_report.dart';
import
'default_route.dart'
;
class
RouteReport
extends
StatefulWidget
{
const
RouteReport
({
Key
?
key
,
required
this
.
builder
})
:
super
(
key:
key
);
const
RouteReport
({
super
.
key
,
required
this
.
builder
}
);
final
WidgetBuilder
builder
;
@override
...
...
lib/get_navigation/src/routes/router_outlet.dart
View file @
6da6d50
...
...
@@ -114,7 +114,7 @@ class GetRouterOutlet extends RouterOutlet<GetDelegate, RouteDecoder> {
super
.
key
,
Widget
Function
(
GetDelegate
delegate
)?
emptyWidget
,
GetPage
Function
(
GetDelegate
delegate
)?
emptyPage
,
required
Iterable
<
GetPage
>
Function
(
RouteDecoder
currentNavStack
)
pickPages
,
required
super
.
pickPages
,
bool
Function
(
Route
<
dynamic
>,
dynamic
)?
onPopPage
,
String
?
restorationScopeId
,
GlobalKey
<
NavigatorState
>?
navigatorKey
,
...
...
@@ -147,19 +147,15 @@ class GetRouterOutlet extends RouterOutlet<GetDelegate, RouteDecoder> {
}
return
(
emptyWidget
?.
call
(
rDelegate
)
??
const
SizedBox
.
shrink
());
},
pickPages:
pickPages
,
delegate:
delegate
??
Get
.
rootController
.
rootDelegate
,
);
GetRouterOutlet
.
builder
({
super
.
key
,
required
Widget
Function
(
BuildContext
context
,
)
builder
,
required
super
.
builder
,
String
?
route
,
GetDelegate
?
routerDelegate
,
})
:
super
.
builder
(
builder:
builder
,
delegate:
routerDelegate
??
(
route
!=
null
?
Get
.
nestedKey
(
route
)
...
...
@@ -213,10 +209,10 @@ typedef NavigatorItemBuilderBuilder = Widget Function(
class
IndexedRouteBuilder
<
T
>
extends
StatelessWidget
{
const
IndexedRouteBuilder
({
Key
?
key
,
super
.
key
,
required
this
.
builder
,
required
this
.
routes
,
})
:
super
(
key:
key
)
;
});
final
List
<
String
>
routes
;
final
NavigatorItemBuilderBuilder
builder
;
...
...
@@ -269,8 +265,8 @@ mixin RouterListenerMixin<T extends StatefulWidget> on State<T> {
class
RouterListenerInherited
extends
InheritedWidget
{
const
RouterListenerInherited
({
super
.
key
,
required
Widget
child
,
})
:
super
(
child:
child
);
required
super
.
child
,
});
static
RouterListenerInherited
?
of
(
BuildContext
context
)
{
return
context
...
...
@@ -285,9 +281,9 @@ class RouterListenerInherited extends InheritedWidget {
class
RouterListener
extends
StatefulWidget
{
const
RouterListener
({
Key
?
key
,
super
.
key
,
required
this
.
builder
,
})
:
super
(
key:
key
)
;
});
final
WidgetBuilder
builder
;
@override
...
...
@@ -303,7 +299,7 @@ class RouteListenerState extends State<RouterListener>
}
class
BackButtonCallback
extends
StatefulWidget
{
const
BackButtonCallback
({
Key
?
key
,
required
this
.
builder
})
:
super
(
key:
key
);
const
BackButtonCallback
({
super
.
key
,
required
this
.
builder
}
);
final
WidgetBuilder
builder
;
@override
...
...
lib/get_navigation/src/snackbar/snackbar.dart
View file @
6da6d50
...
...
@@ -173,7 +173,7 @@ class GetSnackBar extends StatefulWidget {
final
Form
?
userInputForm
;
const
GetSnackBar
({
Key
?
key
,
super
.
key
,
this
.
title
,
this
.
message
,
this
.
titleText
,
...
...
@@ -211,7 +211,7 @@ class GetSnackBar extends StatefulWidget {
this
.
userInputForm
,
this
.
snackbarStatus
,
this
.
hitTestBehavior
,
})
:
super
(
key:
key
)
;
});
@override
State
createState
()
=>
GetSnackBarState
();
...
...
lib/get_rx/src/rx_stream/mini_stream.dart
View file @
6da6d50
part of
rx_stream
;
part of
'rx_stream.dart'
;
class
Node
<
T
>
{
T
?
data
;
...
...
lib/get_rx/src/rx_types/rx_core/rx_impl.dart
View file @
6da6d50
part of
rx_types
;
part of
'../rx_types.dart'
;
/// global object that registers against `GetX` and `Obx`, and allows the
/// reactivity
...
...
@@ -139,7 +139,7 @@ mixin RxObjectMixin<T> on GetListenable<T> {
/// Base Rx class that manages all the stream logic for any Type.
abstract
class
_RxImpl
<
T
>
extends
GetListenable
<
T
>
with
RxObjectMixin
<
T
>
{
_RxImpl
(
T
initial
)
:
super
(
initial
);
_RxImpl
(
super
.
initial
);
void
addError
(
Object
error
,
[
StackTrace
?
stackTrace
])
{
subject
.
addError
(
error
,
stackTrace
);
...
...
@@ -209,7 +209,7 @@ abstract class _RxImpl<T> extends GetListenable<T> with RxObjectMixin<T> {
}
class
RxBool
extends
Rx
<
bool
>
{
RxBool
(
bool
initial
)
:
super
(
initial
);
RxBool
(
super
.
initial
);
@override
String
toString
()
{
return
value
?
"true"
:
"false"
;
...
...
@@ -217,7 +217,7 @@ class RxBool extends Rx<bool> {
}
class
RxnBool
extends
Rx
<
bool
?>
{
RxnBool
([
bool
?
initial
])
:
super
(
initial
);
RxnBool
([
super
.
initial
]
);
@override
String
toString
()
{
return
"
$value
"
;
...
...
@@ -282,7 +282,7 @@ extension RxnBoolExt on Rx<bool?> {
/// For example, any custom "Model" class, like User().obs will use `Rx` as
/// wrapper.
class
Rx
<
T
>
extends
_RxImpl
<
T
>
{
Rx
(
T
initial
)
:
super
(
initial
);
Rx
(
super
.
initial
);
@override
dynamic
toJson
()
{
...
...
@@ -295,7 +295,7 @@ class Rx<T> extends _RxImpl<T> {
}
class
Rxn
<
T
>
extends
Rx
<
T
?>
{
Rxn
([
T
?
initial
])
:
super
(
initial
);
Rxn
([
super
.
initial
]
);
@override
dynamic
toJson
()
{
...
...
lib/get_rx/src/rx_types/rx_core/rx_interface.dart
View file @
6da6d50
part of
rx_types
;
part of
'../rx_types.dart'
;
/// This class is the foundation for all reactive (Rx) classes that makes Get
/// so powerful.
...
...
lib/get_rx/src/rx_types/rx_core/rx_num.dart
View file @
6da6d50
part of
rx_types
;
part of
'../rx_types.dart'
;
extension
RxNumExt
<
T
extends
num
>
on
Rx
<
T
>
{
/// Multiplication operator.
...
...
@@ -572,7 +572,7 @@ extension RxnNumExt<T extends num> on Rx<T?> {
}
class
RxNum
extends
Rx
<
num
>
{
RxNum
(
num
initial
)
:
super
(
initial
);
RxNum
(
super
.
initial
);
num
operator
+(
num
other
)
{
value
+=
other
;
...
...
@@ -587,7 +587,7 @@ class RxNum extends Rx<num> {
}
class
RxnNum
extends
Rx
<
num
?>
{
RxnNum
([
num
?
initial
])
:
super
(
initial
);
RxnNum
([
super
.
initial
]
);
num
?
operator
+(
num
other
)
{
if
(
value
!=
null
)
{
...
...
@@ -857,15 +857,15 @@ extension RxnDoubleExt on Rx<double?> {
}
class
RxDouble
extends
Rx
<
double
>
{
RxDouble
(
double
initial
)
:
super
(
initial
);
RxDouble
(
super
.
initial
);
}
class
RxnDouble
extends
Rx
<
double
?>
{
RxnDouble
([
double
?
initial
])
:
super
(
initial
);
RxnDouble
([
super
.
initial
]
);
}
class
RxInt
extends
Rx
<
int
>
{
RxInt
(
int
initial
)
:
super
(
initial
);
RxInt
(
super
.
initial
);
/// Addition operator.
RxInt
operator
+(
int
other
)
{
...
...
@@ -881,7 +881,7 @@ class RxInt extends Rx<int> {
}
class
RxnInt
extends
Rx
<
int
?>
{
RxnInt
([
int
?
initial
])
:
super
(
initial
);
RxnInt
([
super
.
initial
]
);
/// Addition operator.
RxnInt
operator
+(
int
other
)
{
...
...
lib/get_rx/src/rx_types/rx_core/rx_string.dart
View file @
6da6d50
part of
rx_types
;
part of
'../rx_types.dart'
;
extension
RxStringExt
on
Rx
<
String
>
{
String
operator
+(
String
val
)
=>
value
+
val
;
...
...
@@ -250,7 +250,7 @@ extension RxnStringExt on Rx<String?> {
/// Rx class for `String` Type.
class
RxString
extends
Rx
<
String
>
implements
Comparable
<
String
>,
Pattern
{
RxString
(
String
initial
)
:
super
(
initial
);
RxString
(
super
.
initial
);
@override
Iterable
<
Match
>
allMatches
(
String
string
,
[
int
start
=
0
])
{
...
...
@@ -270,7 +270,7 @@ class RxString extends Rx<String> implements Comparable<String>, Pattern {
/// Rx class for `String` Type.
class
RxnString
extends
Rx
<
String
?>
implements
Comparable
<
String
>,
Pattern
{
RxnString
([
String
?
initial
])
:
super
(
initial
);
RxnString
([
super
.
initial
]
);
@override
Iterable
<
Match
>
allMatches
(
String
string
,
[
int
start
=
0
])
{
...
...
lib/get_rx/src/rx_types/rx_iterables/rx_list.dart
View file @
6da6d50
part of
rx_types
;
part of
'../rx_types.dart'
;
/// Create a list similar to `List<T>`
class
RxList
<
E
>
extends
GetListenable
<
List
<
E
>>
with
ListMixin
<
E
>,
RxObjectMixin
<
List
<
E
>>
{
RxList
([
List
<
E
>
initial
=
const
[]])
:
super
(
initial
);
RxList
([
super
.
initial
=
const
[]]
);
factory
RxList
.
filled
(
int
length
,
E
fill
,
{
bool
growable
=
false
})
{
return
RxList
(
List
.
filled
(
length
,
fill
,
growable:
growable
));
...
...
lib/get_rx/src/rx_types/rx_iterables/rx_map.dart
View file @
6da6d50
part of
rx_types
;
part of
'../rx_types.dart'
;
class
RxMap
<
K
,
V
>
extends
GetListenable
<
Map
<
K
,
V
>>
with
MapMixin
<
K
,
V
>,
RxObjectMixin
<
Map
<
K
,
V
>>
{
RxMap
([
Map
<
K
,
V
>
initial
=
const
{}])
:
super
(
initial
);
RxMap
([
super
.
initial
=
const
{}]
);
factory
RxMap
.
from
(
Map
<
K
,
V
>
other
)
{
return
RxMap
(
Map
.
from
(
other
));
...
...
lib/get_rx/src/rx_types/rx_iterables/rx_set.dart
View file @
6da6d50
part of
rx_types
;
part of
'../rx_types.dart'
;
class
RxSet
<
E
>
extends
GetListenable
<
Set
<
E
>>
with
SetMixin
<
E
>,
RxObjectMixin
<
Set
<
E
>>
{
RxSet
([
Set
<
E
>
initial
=
const
{}])
:
super
(
initial
);
RxSet
([
super
.
initial
=
const
{}]
);
/// Special override to push() element(s) in a reactive way
/// inside the List,
...
...
lib/get_state_manager/src/rx_flutter/rx_notifier.dart
View file @
6da6d50
...
...
@@ -211,7 +211,7 @@ class Value<T> extends ListNotifier
/// GetNotifier has a native status and state implementation, with the
/// Get Lifecycle
abstract
class
GetNotifier
<
T
>
extends
Value
<
T
>
with
GetLifeCycleMixin
{
GetNotifier
(
T
initial
)
:
super
(
initial
);
GetNotifier
(
super
.
initial
);
}
extension
StateExt
<
T
>
on
StateMixin
<
T
>
{
...
...
lib/get_state_manager/src/rx_flutter/rx_obx_widget.dart
View file @
6da6d50
...
...
@@ -11,7 +11,7 @@ typedef WidgetCallback = Widget Function();
/// - [Obx]
/// - [ObxValue]
abstract
class
ObxWidget
extends
ObxStatelessWidget
{
const
ObxWidget
({
Key
?
key
})
:
super
(
key:
key
);
const
ObxWidget
({
super
.
key
}
);
}
/// The simplest reactive widget in GetX.
...
...
@@ -47,7 +47,7 @@ class ObxValue<T extends RxInterface> extends ObxWidget {
final
Widget
Function
(
T
)
builder
;
final
T
data
;
const
ObxValue
(
this
.
builder
,
this
.
data
,
{
Key
?
key
})
:
super
(
key:
key
);
const
ObxValue
(
this
.
builder
,
this
.
data
,
{
super
.
key
}
);
@override
Widget
build
(
BuildContext
context
)
=>
builder
(
data
);
...
...
lib/get_state_manager/src/rx_flutter/rx_ticket_provider_mixin.dart
View file @
6da6d50
...
...
@@ -165,8 +165,7 @@ mixin GetTickerProviderStateMixin on GetxController implements TickerProvider {
}
class
_WidgetTicker
extends
Ticker
{
_WidgetTicker
(
TickerCallback
onTick
,
this
.
_creator
,
{
String
?
debugLabel
})
:
super
(
onTick
,
debugLabel:
debugLabel
);
_WidgetTicker
(
super
.
onTick
,
this
.
_creator
,
{
super
.
debugLabel
});
final
GetTickerProviderStateMixin
_creator
;
...
...
lib/get_state_manager/src/simple/get_responsive.dart
View file @
6da6d50
...
...
@@ -62,9 +62,8 @@ class GetResponsiveView<T> extends GetView<T> with GetResponsiveMixin {
GetResponsiveView
({
this
.
alwaysUseBuilder
=
false
,
ResponsiveScreenSettings
settings
=
const
ResponsiveScreenSettings
(),
Key
?
key
,
})
:
screen
=
ResponsiveScreen
(
settings
),
super
(
key:
key
);
super
.
key
,
})
:
screen
=
ResponsiveScreen
(
settings
);
}
class
GetResponsiveWidget
<
T
extends
GetLifeCycleMixin
>
extends
GetWidget
<
T
>
...
...
@@ -78,9 +77,8 @@ class GetResponsiveWidget<T extends GetLifeCycleMixin> extends GetWidget<T>
GetResponsiveWidget
({
this
.
alwaysUseBuilder
=
false
,
ResponsiveScreenSettings
settings
=
const
ResponsiveScreenSettings
(),
Key
?
key
,
})
:
screen
=
ResponsiveScreen
(
settings
),
super
(
key:
key
);
super
.
key
,
})
:
screen
=
ResponsiveScreen
(
settings
);
}
class
ResponsiveScreenSettings
{
...
...
lib/get_state_manager/src/simple/get_state.dart
View file @
6da6d50
...
...
@@ -47,7 +47,7 @@ class GetBuilder<T extends GetxController> extends StatelessWidget {
final
T
?
init
;
const
GetBuilder
({
Key
?
key
,
super
.
key
,
this
.
init
,
this
.
global
=
true
,
required
this
.
builder
,
...
...
@@ -60,7 +60,7 @@ class GetBuilder<T extends GetxController> extends StatelessWidget {
this
.
id
,
this
.
didChangeDependencies
,
this
.
didUpdateWidget
,
})
:
super
(
key:
key
)
;
});
@override
Widget
build
(
BuildContext
context
)
{
...
...
@@ -88,7 +88,7 @@ class GetBuilder<T extends GetxController> extends StatelessWidget {
abstract
class
Bind
<
T
>
extends
StatelessWidget
{
const
Bind
({
Key
?
key
,
super
.
key
,
required
this
.
child
,
this
.
init
,
this
.
global
=
true
,
...
...
@@ -101,7 +101,7 @@ abstract class Bind<T> extends StatelessWidget {
this
.
id
,
this
.
didChangeDependencies
,
this
.
didUpdateWidget
,
})
:
super
(
key:
key
)
;
});
final
InitBuilder
<
T
>?
init
;
...
...
@@ -296,7 +296,7 @@ class _FactoryBind<T> extends Bind<T> {
final
Widget
?
child
;
const
_FactoryBind
({
Key
?
key
,
super
.
key
,
this
.
child
,
this
.
init
,
this
.
create
,
...
...
@@ -310,7 +310,7 @@ class _FactoryBind<T> extends Bind<T> {
this
.
id
,
this
.
didChangeDependencies
,
this
.
didUpdateWidget
,
})
:
super
(
key:
key
,
child:
child
);
})
:
super
(
child:
child
);
@override
Bind
<
T
>
_copyWithChild
(
Widget
child
)
{
...
...
@@ -355,11 +355,10 @@ class Binds extends StatelessWidget {
final
Widget
child
;
Binds
({
Key
?
key
,
super
.
key
,
required
this
.
binds
,
required
this
.
child
,
})
:
assert
(
binds
.
isNotEmpty
),
super
(
key:
key
);
})
:
assert
(
binds
.
isNotEmpty
);
@override
Widget
build
(
BuildContext
context
)
=>
...
...
@@ -372,8 +371,8 @@ class Binder<T> extends InheritedWidget {
///
/// The [child] argument is required
const
Binder
({
Key
?
key
,
required
Widget
child
,
super
.
key
,
required
super
.
child
,
this
.
init
,
this
.
global
=
true
,
this
.
autoRemove
=
true
,
...
...
@@ -387,7 +386,7 @@ class Binder<T> extends InheritedWidget {
this
.
didChangeDependencies
,
this
.
didUpdateWidget
,
this
.
create
,
})
:
super
(
key:
key
,
child:
child
)
;
});
final
InitBuilder
<
T
>?
init
;
final
InstanceCreateBuilderCallback
?
create
;
...
...
@@ -419,7 +418,7 @@ class Binder<T> extends InheritedWidget {
/// The BindElement is responsible for injecting dependencies into the widget
/// tree so that they can be observed
class
BindElement
<
T
>
extends
InheritedElement
{
BindElement
(
Binder
<
T
>
widget
)
:
super
(
widget
)
{
BindElement
(
Binder
<
T
>
super
.
widget
)
{
initState
();
}
...
...
lib/get_state_manager/src/simple/get_view.dart
View file @
6da6d50
...
...
@@ -32,7 +32,7 @@ import 'get_widget_cache.dart';
/// }
///``
abstract
class
GetView
<
T
>
extends
StatelessWidget
{
const
GetView
({
Key
?
key
})
:
super
(
key:
key
);
const
GetView
({
super
.
key
}
);
final
String
?
tag
=
null
;
...
...
@@ -49,7 +49,7 @@ abstract class GetView<T> extends StatelessWidget {
/// GetWidget will have your own controller, and will be call events as `onInit`
/// and `onClose` when the controller get in/get out on memory.
abstract
class
GetWidget
<
S
extends
GetLifeCycleMixin
>
extends
GetWidgetCache
{
const
GetWidget
({
Key
?
key
})
:
super
(
key:
key
);
const
GetWidget
({
super
.
key
}
);
@protected
final
String
?
tag
=
null
;
...
...
lib/get_state_manager/src/simple/get_widget_cache.dart
View file @
6da6d50
import
'package:flutter/widgets.dart'
;
abstract
class
GetWidgetCache
extends
Widget
{
const
GetWidgetCache
({
Key
?
key
})
:
super
(
key:
key
);
const
GetWidgetCache
({
super
.
key
}
);
@override
GetWidgetCacheElement
createElement
()
=>
GetWidgetCacheElement
(
this
);
...
...
lib/get_state_manager/src/simple/mixin_builder.dart
View file @
6da6d50
...
...
@@ -18,7 +18,7 @@ class MixinBuilder<T extends GetxController> extends StatelessWidget {
final
T
?
init
;
const
MixinBuilder
({
Key
?
key
,
super
.
key
,
this
.
init
,
this
.
global
=
true
,
required
this
.
builder
,
...
...
@@ -28,7 +28,7 @@ class MixinBuilder<T extends GetxController> extends StatelessWidget {
this
.
id
,
this
.
didChangeDependencies
,
this
.
didUpdateWidget
,
})
:
super
(
key:
key
)
;
});
@override
Widget
build
(
BuildContext
context
)
{
...
...
lib/get_state_manager/src/simple/simple_builder.dart
View file @
6da6d50
...
...
@@ -30,12 +30,12 @@ class ValueBuilder<T> extends StatefulWidget {
final
void
Function
(
T
)?
onUpdate
;
const
ValueBuilder
({
Key
?
key
,
super
.
key
,
required
this
.
initialValue
,
this
.
onDispose
,
this
.
onUpdate
,
required
this
.
builder
,
})
:
super
(
key:
key
)
;
});
@override
ValueBuilderState
<
T
>
createState
()
=>
ValueBuilderState
<
T
>();
...
...
@@ -79,7 +79,7 @@ class ObxElement = StatelessElement with StatelessObserverComponent;
class
Observer
extends
ObxStatelessWidget
{
final
WidgetBuilder
builder
;
const
Observer
({
Key
?
key
,
required
this
.
builder
})
:
super
(
key:
key
);
const
Observer
({
super
.
key
,
required
this
.
builder
}
);
@override
Widget
build
(
BuildContext
context
)
=>
builder
(
context
);
...
...
@@ -88,7 +88,7 @@ class Observer extends ObxStatelessWidget {
/// A StatelessWidget than can listen reactive changes.
abstract
class
ObxStatelessWidget
extends
StatelessWidget
{
/// Initializes [key] for subclasses.
const
ObxStatelessWidget
({
Key
?
key
})
:
super
(
key:
key
);
const
ObxStatelessWidget
({
super
.
key
}
);
@override
StatelessElement
createElement
()
=>
ObxElement
(
this
);
}
...
...
lib/get_utils/src/equality/equality.dart
View file @
6da6d50
...
...
@@ -273,9 +273,7 @@ class IterableEquality<E> implements IEquality<Iterable<E>> {
/// and the elements of one set can be paired with the elements
/// of the other set, so that each pair are equal.
class
SetEquality
<
E
>
extends
_UnorderedEquality
<
E
,
Set
<
E
>>
{
const
SetEquality
(
[
IEquality
<
E
>
elementEquality
=
const
DefaultEquality
<
Never
>()])
:
super
(
elementEquality
);
const
SetEquality
([
super
.
elementEquality
=
const
DefaultEquality
<
Never
>()]);
@override
bool
isValidKey
(
Object
?
o
)
=>
o
is
Set
<
E
>;
...
...
@@ -332,8 +330,7 @@ abstract class _UnorderedEquality<E, T extends Iterable<E>>
/// of the other iterable, so that each pair are equal.
class
UnorderedIterableEquality
<
E
>
extends
_UnorderedEquality
<
E
,
Iterable
<
E
>>
{
const
UnorderedIterableEquality
(
[
IEquality
<
E
>
elementEquality
=
const
DefaultEquality
<
Never
>()])
:
super
(
elementEquality
);
[
super
.
elementEquality
=
const
DefaultEquality
<
Never
>()]);
@override
bool
isValidKey
(
Object
?
o
)
=>
o
is
Iterable
<
E
>;
...
...
lib/get_utils/src/extensions/context_extensions.dart
View file @
6da6d50
...
...
@@ -90,7 +90,7 @@ extension ContextExt on BuildContext {
double
get
devicePixelRatio
=>
MediaQuery
.
devicePixelRatioOf
(
this
);
/// similar to [MediaQuery.textScaleFactorOf(context)]
double
get
textScaleFactor
=>
MediaQuery
.
textScaleFacto
rOf
(
this
);
TextScaler
get
textScaleFactor
=>
MediaQuery
.
textScale
rOf
(
this
);
/// get the shortestSide from screen
double
get
mediaQueryShortestSide
=>
mediaQuerySize
.
shortestSide
;
...
...
lib/get_utils/src/widgets/otimized_listview.dart → lib/get_utils/src/widgets/o
p
timized_listview.dart
View file @
6da6d50
import
'package:flutter/material.dart'
;
class
OtimizedListView
<
T
>
extends
StatelessWidget
{
class
O
p
timizedListView
<
T
>
extends
StatelessWidget
{
final
List
<
T
>
list
;
final
Axis
scrollDirection
;
final
bool
reverse
;
...
...
@@ -11,8 +11,8 @@ class OtimizedListView<T> extends StatelessWidget {
final
Widget
onEmpty
;
final
int
length
;
final
Widget
Function
(
BuildContext
context
,
ValueKey
key
,
T
item
)
builder
;
const
OtimizedListView
({
Key
?
key
,
const
OptimizedListView
({
super
.
key
,
required
this
.
list
,
required
this
.
builder
,
this
.
scrollDirection
=
Axis
.
vertical
,
...
...
@@ -22,8 +22,7 @@ class OtimizedListView<T> extends StatelessWidget {
this
.
physics
,
this
.
onEmpty
=
const
SizedBox
.
shrink
(),
this
.
shrinkWrap
=
false
,
})
:
length
=
list
.
length
,
super
(
key:
key
);
})
:
length
=
list
.
length
;
@override
Widget
build
(
BuildContext
context
)
{
if
(
list
.
isEmpty
)
return
onEmpty
;
...
...
pubspec.yaml
View file @
6da6d50
...
...
@@ -14,7 +14,7 @@ dependencies:
web
:
any
dev_dependencies
:
flutter_lints
:
^
2.0.3
flutter_lints
:
^
4.0.0
flutter_test
:
sdk
:
flutter
...
...
test/navigation/dialog_test.dart
View file @
6da6d50
...
...
@@ -57,7 +57,7 @@ void main() {
}
class
YourDialogWidget
extends
StatelessWidget
{
const
YourDialogWidget
({
Key
?
key
})
:
super
(
key:
key
);
const
YourDialogWidget
({
super
.
key
}
);
@override
Widget
build
(
BuildContext
context
)
{
...
...
test/navigation/get_main_test.dart
View file @
6da6d50
...
...
@@ -570,7 +570,7 @@ void main() {
}
class
FirstScreen
extends
StatelessWidget
{
const
FirstScreen
({
Key
?
key
})
:
super
(
key:
key
);
const
FirstScreen
({
super
.
key
}
);
@override
Widget
build
(
BuildContext
context
)
{
...
...
@@ -580,7 +580,7 @@ class FirstScreen extends StatelessWidget {
}
class
SecondScreen
extends
StatelessWidget
{
const
SecondScreen
({
Key
?
key
})
:
super
(
key:
key
);
const
SecondScreen
({
super
.
key
}
);
@override
Widget
build
(
BuildContext
context
)
{
...
...
@@ -589,7 +589,7 @@ class SecondScreen extends StatelessWidget {
}
class
ThirdScreen
extends
StatelessWidget
{
const
ThirdScreen
({
Key
?
key
})
:
super
(
key:
key
);
const
ThirdScreen
({
super
.
key
}
);
@override
Widget
build
(
BuildContext
context
)
{
...
...
test/navigation/utils/wrapper.dart
View file @
6da6d50
...
...
@@ -8,12 +8,12 @@ class Wrapper extends StatelessWidget {
final
Transition
?
defaultTransition
;
const
Wrapper
({
Key
?
key
,
super
.
key
,
this
.
child
,
this
.
namedRoutes
,
this
.
initialRoute
,
this
.
defaultTransition
,
})
:
super
(
key:
key
)
;
});
@override
Widget
build
(
BuildContext
context
)
{
...
...
@@ -39,12 +39,12 @@ class WrapperNamed extends StatelessWidget {
final
Transition
?
defaultTransition
;
const
WrapperNamed
({
Key
?
key
,
super
.
key
,
this
.
child
,
this
.
namedRoutes
,
this
.
initialRoute
,
this
.
defaultTransition
,
})
:
super
(
key:
key
)
;
});
@override
Widget
build
(
BuildContext
context
)
{
...
...
test/utils/extensions/context_extensions_test.dart
View file @
6da6d50
...
...
@@ -63,7 +63,7 @@ void main() {
var
showNavbar
=
(
width
>
800
);
expect
(
showNavbar
,
context
.
showNavbar
);
var
textScaleFactor
=
mediaQuery
.
textScale
Facto
r
;
var
textScaleFactor
=
mediaQuery
.
textScaler
;
expect
(
textScaleFactor
,
context
.
textScaleFactor
);
});
}
...
...
test/utils/platform_test.dart
View file @
6da6d50
@TestOn
(
'vm'
)
library
;
import
'dart:io'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:get/get.dart'
;
...
...
test/utils/platform_web_test.dart
View file @
6da6d50
@TestOn
(
'browser'
)
library
;
import
'dart:io'
;
import
'package:flutter_test/flutter_test.dart'
;
...
...
Please
register
or
login
to post a comment