new UI + new targets.
This commit is contained in:
+35
-38
@@ -22,16 +22,7 @@ void main() async {
|
||||
DeviceOrientation.portraitDown,
|
||||
]);
|
||||
|
||||
// Set system UI overlay style globally for the app
|
||||
SystemChrome.setSystemUIOverlayStyle(
|
||||
SystemUiOverlayStyle(
|
||||
statusBarColor: Colors.grey[900],
|
||||
systemNavigationBarColor: Colors.grey[900],
|
||||
systemNavigationBarIconBrightness: Brightness.light,
|
||||
// No grey scrim behind 3-button navigation; we paint the strip ourselves
|
||||
systemNavigationBarContrastEnforced: false,
|
||||
),
|
||||
);
|
||||
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
||||
|
||||
runApp(const MyApp());
|
||||
}
|
||||
@@ -41,37 +32,43 @@ class MyApp extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
title: 'SD Kovinar',
|
||||
debugShowCheckedModeBanner: false,
|
||||
theme: AppTheme.light(),
|
||||
darkTheme: AppTheme.dark(),
|
||||
builder: (context, child) {
|
||||
final originalTextScaler = MediaQuery.of(context).textScaler;
|
||||
final clampedScale =
|
||||
originalTextScaler.clamp(minScaleFactor: 0.8, maxScaleFactor: 1.2);
|
||||
// Edge-to-edge (Android 15+) ignores the navigation bar color, so paint
|
||||
// the system bar strip ourselves on every screen, matching our bars.
|
||||
final systemBar = MediaQuery.viewPaddingOf(context).bottom;
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context).copyWith(
|
||||
textScaler: clampedScale,
|
||||
),
|
||||
child: Stack(
|
||||
children: [
|
||||
child!,
|
||||
Positioned(
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
height: systemBar,
|
||||
child: IgnorePointer(child: ColoredBox(color: AppTheme.bar)),
|
||||
// Theme (Sistem / Svetla / Temna) and the hit colour change the whole app live
|
||||
return ListenableBuilder(
|
||||
listenable: AppSettings.instance,
|
||||
builder: (context, _) {
|
||||
final palette = AppSettings.instance.palette;
|
||||
return MaterialApp(
|
||||
title: 'SD Kovinar',
|
||||
debugShowCheckedModeBanner: false,
|
||||
theme: AppTheme.theme(palette),
|
||||
builder: (context, child) {
|
||||
final originalTextScaler = MediaQuery.of(context).textScaler;
|
||||
final clampedScale = originalTextScaler.clamp(minScaleFactor: 0.8, maxScaleFactor: 1.2);
|
||||
// Edge-to-edge (Android 15+) ignores the navigation bar color, so paint
|
||||
// the system bar strip ourselves on every screen, matching our bars.
|
||||
final systemBar = MediaQuery.viewPaddingOf(context).bottom;
|
||||
return AnnotatedRegion<SystemUiOverlayStyle>(
|
||||
value: AppTheme.overlay(palette),
|
||||
child: MediaQuery(
|
||||
data: MediaQuery.of(context).copyWith(textScaler: clampedScale),
|
||||
child: Stack(
|
||||
children: [
|
||||
child!,
|
||||
Positioned(
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
height: systemBar,
|
||||
child: IgnorePointer(child: ColoredBox(color: palette.nav)),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
home: const HomeScreen(),
|
||||
);
|
||||
},
|
||||
home: const HomeScreen(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user