Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ginkgo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Fred
ginkgo
Commits
561b4533
Commit
561b4533
authored
10 months ago
by
vjrj
Browse files
Options
Downloads
Patches
Plain Diff
Use of simple themes
parent
778a28cf
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/main.dart
+26
-17
26 additions, 17 deletions
lib/main.dart
with
26 additions
and
17 deletions
lib/main.dart
+
26
−
17
View file @
561b4533
import
'dart:async'
;
import
'dart:convert'
;
import
'dart:io'
;
import
'package:connectivity_wrapper/connectivity_wrapper.dart'
;
...
...
@@ -13,7 +12,6 @@ import 'package:flutter/services.dart';
import
'package:flutter_bloc/flutter_bloc.dart'
;
import
'package:flutter_displaymode/flutter_displaymode.dart'
;
import
'package:introduction_screen/introduction_screen.dart'
;
import
'package:json_theme/json_theme.dart'
;
import
'package:l10n_esperanto/l10n_esperanto.dart'
;
import
'package:lehttp_overrides/lehttp_overrides.dart'
;
import
'package:once/once.dart'
;
...
...
@@ -63,15 +61,25 @@ const String fetchWalletsTransactionsTask =
void
main
()
async
{
await
NotificationController
.
initializeLocalNotifications
();
final
String
themeDarkStr
=
await
rootBundle
.
loadString
(
'assets/appainter_theme_dark.json'
);
final
dynamic
themeDarkJson
=
jsonDecode
(
themeDarkStr
);
final
ThemeData
themeDark
=
ThemeDecoder
.
decodeThemeData
(
themeDarkJson
)
!
;
// const int seedColorOld = 0xff526600;
final
String
themeLightStr
=
await
rootBundle
.
loadString
(
'assets/appainter_theme_light.json'
);
final
dynamic
themeLightJson
=
jsonDecode
(
themeLightStr
);
final
ThemeData
themeLight
=
ThemeDecoder
.
decodeThemeData
(
themeLightJson
)
!
;
const
int
seedColor
=
0xff98FB98
;
final
int
seedColorDark
=
Colors
.
lightGreen
.
value
;
final
ThemeData
lightTheme
=
ThemeData
.
from
(
colorScheme:
ColorScheme
.
fromSeed
(
seedColor:
const
Color
(
seedColor
),
// brightness: Brightness.light,
),
useMaterial3:
true
,
);
final
ThemeData
darkTheme
=
ThemeData
.
from
(
colorScheme:
ColorScheme
.
fromSeed
(
seedColor:
Color
(
seedColorDark
),
brightness:
Brightness
.
dark
,
),
useMaterial3:
true
,
);
// To resolve Let's Encrypt SSL certificate problems with Android 7.1.1 and below
if
(
!
kIsWeb
&&
Platform
.
isAndroid
)
{
...
...
@@ -175,7 +183,7 @@ void main() async {
// Add other BlocProviders here if needed
],
child:
GinkgoApp
(
themeDark:
themeDark
,
t
heme
L
ight
:
t
heme
L
ight
)),
GinkgoApp
(
darkTheme:
darkT
heme
,
l
ight
T
heme
:
l
ight
Theme
)),
)));
});
if
(
inDevelopment
)
{
...
...
@@ -334,14 +342,14 @@ PageViewModel createPageViewModel(
class
GinkgoApp
extends
StatefulWidget
{
const
GinkgoApp
(
{
super
.
key
,
required
this
.
themeLight
,
required
this
.
themeDark
});
{
super
.
key
,
required
this
.
lightTheme
,
required
this
.
darkTheme
});
// The navigator key is necessary to navigate using static methods
static
final
GlobalKey
<
NavigatorState
>
navigatorKey
=
GlobalKey
<
NavigatorState
>();
final
ThemeData
themeDark
;
final
ThemeData
themeLight
;
final
ThemeData
darkTheme
;
final
ThemeData
lightTheme
;
@override
State
<
GinkgoApp
>
createState
()
=
>
_GinkgoAppState
();
...
...
@@ -490,8 +498,9 @@ class _GinkgoAppState extends State<GinkgoApp> {
await
onKeyScanned
(
context
,
link
);
if
(
!
mounted
)
{
return
;
}
else
{
context
.
read
<
BottomNavCubit
>()
.
updateIndex
(
0
);
}
context
.
read
<
BottomNavCubit
>()
.
updateIndex
(
0
);
}
}
},
onError:
(
Object
err
)
{
...
...
@@ -524,8 +533,8 @@ class _GinkgoAppState extends State<GinkgoApp> {
child:
MaterialApp
(
/// Localization is not available for the title.
title:
'Ğ1nkgo'
,
theme:
widget
.
themeLight
,
darkTheme:
widget
.
themeDark
,
theme:
widget
.
lightTheme
,
darkTheme:
widget
.
darkTheme
,
navigatorKey:
GinkgoApp
.
navigatorKey
,
scaffoldMessengerKey:
globalMessengerKey
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment