[Flutter] StatusBar 색상 변경

조형민·2022년 8월 7일
0

Flutter

목록 보기
7/10

앱 전체에 적용

appBarTheme: AppBarTheme(
            systemOverlayStyle: SystemUiOverlayStyle(
              // Status bar color
              statusBarColor: Colors.red, // 안드로이드만?? (iOS에서는 아무 변화없음)
              // statusBarIconBrightness: Brightness.dark,
              statusBarBrightness: Brightness.light, // iOS에서 먹히는 설정(검정 글씨로 표시됨)
            ),
          ),

AppBar별 적용

AppBar(
  systemOverlayStyle: SystemUiOverlayStyle(
    statusBarColor: Colors.green, // <-- SEE HERE
    statusBarIconBrightness: Brightness.dark, //<-- For Android SEE HERE (dark icons)
    statusBarBrightness: Brightness.light, //<-- For iOS SEE HERE (dark icons)
    ```

AppBar가 없는 경우 적용

return AnnotatedRegion<SystemUiOverlayStyle>(
      value: SystemUiOverlayStyle.light,
      child: Scaffold(
        backgroundColor: Colors.white,
        body: SafeArea(

참고 링크
https://www.flutterbeads.com/change-status-bar-color-in-flutter/

profile
기획하다가 Flutter 배우는 늦깎이 코린이

0개의 댓글