feat: Android 15 edge-to-edge 모드 지원
- immersiveSticky → edgeToEdge 모드 변경 - deprecated된 네비게이션바 색상 API 제거 - 시스템이 네비게이션바 색상 자동 처리
This commit is contained in:
@@ -35,12 +35,9 @@ const bool enableAdMob = true;
|
||||
Future<void> main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
// 시스템 네비게이션 바 숨김 (Immersive Sticky 모드)
|
||||
// 스와이프 시 일시적으로 나타났다가 자동으로 사라짐
|
||||
SystemChrome.setEnabledSystemUIMode(
|
||||
SystemUiMode.immersiveSticky,
|
||||
overlays: [SystemUiOverlay.top], // 상태바만 유지
|
||||
);
|
||||
// Android 15 edge-to-edge 모드 활성화
|
||||
// 콘텐츠가 시스템 바 영역까지 확장됨
|
||||
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
||||
|
||||
// 구글 모바일 광고 SDK 초기화 (웹이 아니고, Android/iOS에서만)
|
||||
if (!kIsWeb && (Platform.isAndroid || Platform.isIOS) && enableAdMob) {
|
||||
|
||||
@@ -305,9 +305,9 @@ class AdaptiveTheme {
|
||||
}
|
||||
|
||||
/// 시스템 테마에 따른 상태바 스타일 적용
|
||||
/// Android 15+ edge-to-edge 호환: deprecated된 네비게이션바 색상 API 제거
|
||||
static void applySystemUIOverlay(BuildContext context) {
|
||||
final brightness = Theme.of(context).brightness;
|
||||
final isOled = Theme.of(context).scaffoldBackgroundColor == Colors.black;
|
||||
|
||||
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
|
||||
statusBarColor: Colors.transparent,
|
||||
@@ -315,13 +315,8 @@ class AdaptiveTheme {
|
||||
brightness == Brightness.dark ? Brightness.light : Brightness.dark,
|
||||
statusBarBrightness:
|
||||
brightness == Brightness.dark ? Brightness.light : Brightness.dark,
|
||||
systemNavigationBarColor: isOled
|
||||
? Colors.black
|
||||
: (brightness == Brightness.dark
|
||||
? const Color(0xFF121212)
|
||||
: Colors.white),
|
||||
systemNavigationBarIconBrightness:
|
||||
brightness == Brightness.dark ? Brightness.light : Brightness.dark,
|
||||
// Android 15+: 네비게이션바 색상은 시스템이 자동 처리
|
||||
systemNavigationBarContrastEnforced: false,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user