728x90
SystemChrome.setSystemUIOverlayStyle를 사용한다.
import 'package:flutter/services.dart';
// dark
@override
Widget build(BuildContext context) {
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.dark);
return const Placeholder();
}
// statusBarColor
@override
Widget build(BuildContext context) {
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
statusBarColor: Colors.red
));
return const Placeholder();
}
// systemNavigationBarColor
@override
Widget build(BuildContext context) {
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
systemNavigationBarColor: Colors.blue
));
return const Placeholder();
}
// statusBarColor, systemNavigationBarColor
@override
Widget build(BuildContext context) {
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
systemNavigationBarColor: Colors.blue,
statusBarColor: Colors.red,
));
return const Placeholder();
}
setSystemUIOverlayStyle method - SystemChrome class - services library - Dart API
void setSystemUIOverlayStyle(SystemUiOverlayStyle style ) Specifies the style to use for the system overlays that are visible (if any). This method will schedule the embedder update to be run in a microtask. Any subsequent calls to this method during the c
api.flutter.dev
반응형
'android' 카테고리의 다른 글
llvm Preprocessor 미리 정의 된 모든 매크로 확인 방법. (0) | 2021.06.15 |
---|---|
[Flutter] 시스템 디스플레이 모드(라이트, 다크)가 변경 되었을때 상태바 색상 변경 방법. (0) | 2021.05.30 |
[Flutter] 교육 앱, 만 13세 미만 아동을 주요 대상으로 제작된 앱 광고 설정. (0) | 2021.05.30 |
Android Studio, Kotlin Gradle and IDE plugins versions are different (0) | 2021.05.29 |
Android Studio(macOS), Filesystem Case-Sensitivity Mismatch (0) | 2021.05.29 |