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
Rod
2020-05-17 16:11:26 +1000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1411baf532982ba05fe390be687231134e0f4df1
1411baf5
1 parent
41df2365
Added ChangeThemeMode
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletions
lib/src/get_main.dart
lib/src/root/root_controller.dart
lib/src/root/root_widget.dart
lib/src/get_main.dart
View file @
1411baf
...
...
@@ -599,6 +599,10 @@ class Get {
_get
.
_getController
.
setTheme
(
theme
);
}
Get
.
changeThemeMode
(
ThemeMode
themeMode
)
{
Get
().
_getController
.
setThemeMode
(
themeMode
);
}
Get
.
restartApp
()
{
_get
.
_getController
.
restartApp
();
}
...
...
lib/src/root/root_controller.dart
View file @
1411baf
...
...
@@ -6,12 +6,18 @@ class GetMaterialController extends GetController {
ParseRoute
parse
=
ParseRoute
();
Key
key
=
UniqueKey
();
ThemeData
theme
;
ThemeMode
themeMode
;
void
setTheme
(
ThemeData
value
)
{
theme
=
value
;
update
(
this
);
}
void
setThemeMode
(
ThemeMode
value
)
{
themeMode
=
value
;
update
(
this
);
}
void
restartApp
()
{
key
=
UniqueKey
();
update
(
this
);
...
...
lib/src/root/root_widget.dart
View file @
1411baf
...
...
@@ -213,7 +213,7 @@ class GetMaterialApp extends StatelessWidget {
color:
color
,
theme:
_
.
theme
??
theme
??
ThemeData
.
fallback
(),
darkTheme:
darkTheme
,
themeMode:
themeMode
??
ThemeMode
.
system
,
themeMode:
_
.
themeMode
??
themeMode
??
ThemeMode
.
system
,
locale:
locale
,
localizationsDelegates:
localizationsDelegates
,
localeListResolutionCallback:
localeListResolutionCallback
,
...
...
Please
register
or
login
to post a comment