mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-25 00:40:39 +00:00
Fixed navigation bar color
Cleanup
This commit is contained in:
parent
cdd714f12c
commit
56480cca0a
2 changed files with 28 additions and 40 deletions
|
@ -15,46 +15,33 @@ import 'utils/stop_type_provider.dart';
|
|||
|
||||
final RouteObserver<PageRoute> routeObserver = RouteObserver<PageRoute>();
|
||||
|
||||
class Application extends StatefulWidget {
|
||||
class Application extends StatelessWidget {
|
||||
final EvSourceType evSource;
|
||||
|
||||
const Application(this.evSource, {super.key});
|
||||
|
||||
@override
|
||||
State<Application> createState() => _ApplicationState();
|
||||
}
|
||||
|
||||
class _ApplicationState extends State<Application> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
final mySystemTheme = SystemUiOverlayStyle.light.copyWith(
|
||||
statusBarColor: Colors.transparent,
|
||||
statusBarBrightness: Brightness.light,
|
||||
statusBarIconBrightness: Brightness.dark,
|
||||
systemNavigationBarColor: Colors.transparent,
|
||||
systemNavigationBarIconBrightness: Brightness.dark,
|
||||
);
|
||||
SystemChrome.setSystemUIOverlayStyle(mySystemTheme);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return FutureBuilder<SharedPreferences>(
|
||||
future: SharedPreferences.getInstance(),
|
||||
builder: (context, snapshot) {
|
||||
builder: (_, snapshot) {
|
||||
if (snapshot.data != null) {
|
||||
return MultiProvider(
|
||||
providers: [
|
||||
Provider(create: (_) => UserPreferencesService(snapshot.data!)),
|
||||
Provider.value(value: widget.evSource),
|
||||
Provider.value(value: evSource),
|
||||
],
|
||||
child: Provider(
|
||||
create: (context) => PermissionsService(),
|
||||
create: (_) => PermissionsService(),
|
||||
child: StopTypeProvider(
|
||||
child: ThemeProvider(
|
||||
initialPrimaryColor: const Color(0xFF2196f3),
|
||||
builder: (context, child) => MaterialApp(
|
||||
builder: (context, child) => AnnotatedRegion(
|
||||
value: SystemUiOverlayStyle(
|
||||
statusBarColor: context.watch<ThemeData>().colorScheme.surface,
|
||||
systemNavigationBarColor: context.watch<ThemeData>().colorScheme.surface,
|
||||
),
|
||||
child: MaterialApp(
|
||||
theme: context.watch<ThemeData>(),
|
||||
localizationsDelegates: const [
|
||||
S.delegate,
|
||||
|
@ -67,7 +54,7 @@ class _ApplicationState extends State<Application> {
|
|||
data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
|
||||
child: child!,
|
||||
),
|
||||
home: const MeteringFlow(),
|
||||
initialRoute: "metering",
|
||||
routes: {
|
||||
"metering": (context) => const MeteringFlow(),
|
||||
"settings": (context) => const SettingsScreen(),
|
||||
|
@ -76,6 +63,7 @@ class _ApplicationState extends State<Application> {
|
|||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return const SizedBox();
|
||||
|
|
|
@ -80,7 +80,7 @@ class AnimatedDialogState extends State<AnimatedDialog> with SingleTickerProvide
|
|||
),
|
||||
));
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
final mediaQuery = MediaQuery.of(context);
|
||||
|
||||
_closedSize = _key.currentContext!.size!;
|
||||
|
|
Loading…
Reference in a new issue