Flutter 앱: 시스템 네비게이션 바 흰색으로 변경
This commit is contained in:
parent
168da7d61e
commit
bf6d4567a3
3 changed files with 42 additions and 25 deletions
|
|
@ -5,6 +5,7 @@
|
||||||
<!-- Show a splash screen on the activity. Automatically removed when
|
<!-- Show a splash screen on the activity. Automatically removed when
|
||||||
the Flutter engine draws its first frame -->
|
the Flutter engine draws its first frame -->
|
||||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||||
|
<item name="android:navigationBarColor">@android:color/white</item>
|
||||||
</style>
|
</style>
|
||||||
<!-- Theme applied to the Android Window as soon as the process has started.
|
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||||
This theme determines the color of the Android Window while your
|
This theme determines the color of the Android Window while your
|
||||||
|
|
@ -14,5 +15,6 @@
|
||||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||||
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||||
<item name="android:windowBackground">?android:colorBackground</item>
|
<item name="android:windowBackground">?android:colorBackground</item>
|
||||||
|
<item name="android:navigationBarColor">@android:color/white</item>
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
<!-- Show a splash screen on the activity. Automatically removed when
|
<!-- Show a splash screen on the activity. Automatically removed when
|
||||||
the Flutter engine draws its first frame -->
|
the Flutter engine draws its first frame -->
|
||||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||||
|
<item name="android:navigationBarColor">@android:color/white</item>
|
||||||
</style>
|
</style>
|
||||||
<!-- Theme applied to the Android Window as soon as the process has started.
|
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||||
This theme determines the color of the Android Window while your
|
This theme determines the color of the Android Window while your
|
||||||
|
|
@ -14,5 +15,6 @@
|
||||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||||
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||||
<item name="android:windowBackground">?android:colorBackground</item>
|
<item name="android:windowBackground">?android:colorBackground</item>
|
||||||
|
<item name="android:navigationBarColor">@android:color/white</item>
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
|
|
@ -16,11 +16,15 @@ import 'core/constants.dart';
|
||||||
void main() {
|
void main() {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
|
||||||
// 상태바 스타일 설정
|
// 상태바 및 네비게이션 바 스타일 설정
|
||||||
SystemChrome.setSystemUIOverlayStyle(
|
SystemChrome.setSystemUIOverlayStyle(
|
||||||
const SystemUiOverlayStyle(
|
const SystemUiOverlayStyle(
|
||||||
|
// 상태바
|
||||||
statusBarColor: Colors.transparent,
|
statusBarColor: Colors.transparent,
|
||||||
statusBarIconBrightness: Brightness.dark,
|
statusBarIconBrightness: Brightness.dark,
|
||||||
|
// 네비게이션 바 (소프트키)
|
||||||
|
systemNavigationBarColor: Colors.white,
|
||||||
|
systemNavigationBarIconBrightness: Brightness.dark,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -36,31 +40,40 @@ class Fromis9App extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MaterialApp.router(
|
return AnnotatedRegion<SystemUiOverlayStyle>(
|
||||||
title: 'fromis_9',
|
value: const SystemUiOverlayStyle(
|
||||||
debugShowCheckedModeBanner: false,
|
statusBarColor: Colors.transparent,
|
||||||
theme: ThemeData(
|
statusBarIconBrightness: Brightness.dark,
|
||||||
useMaterial3: true,
|
systemNavigationBarColor: Colors.white,
|
||||||
colorScheme: ColorScheme.fromSeed(
|
systemNavigationBarIconBrightness: Brightness.dark,
|
||||||
seedColor: AppColors.primary,
|
systemNavigationBarDividerColor: Colors.transparent,
|
||||||
brightness: Brightness.light,
|
),
|
||||||
),
|
child: MaterialApp.router(
|
||||||
scaffoldBackgroundColor: AppColors.background,
|
title: 'fromis_9',
|
||||||
appBarTheme: const AppBarTheme(
|
debugShowCheckedModeBanner: false,
|
||||||
backgroundColor: Colors.white,
|
theme: ThemeData(
|
||||||
foregroundColor: AppColors.textPrimary,
|
useMaterial3: true,
|
||||||
elevation: 0,
|
colorScheme: ColorScheme.fromSeed(
|
||||||
scrolledUnderElevation: 1,
|
seedColor: AppColors.primary,
|
||||||
centerTitle: true,
|
brightness: Brightness.light,
|
||||||
titleTextStyle: TextStyle(
|
),
|
||||||
color: AppColors.primary,
|
scaffoldBackgroundColor: AppColors.background,
|
||||||
fontSize: 20,
|
appBarTheme: const AppBarTheme(
|
||||||
fontWeight: FontWeight.bold,
|
backgroundColor: Colors.white,
|
||||||
),
|
foregroundColor: AppColors.textPrimary,
|
||||||
),
|
elevation: 0,
|
||||||
fontFamily: 'Pretendard',
|
scrolledUnderElevation: 1,
|
||||||
|
centerTitle: true,
|
||||||
|
titleTextStyle: TextStyle(
|
||||||
|
color: AppColors.primary,
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
fontFamily: 'Pretendard',
|
||||||
|
),
|
||||||
|
routerConfig: appRouter,
|
||||||
),
|
),
|
||||||
routerConfig: appRouter,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue