[Flutter] Android沉侵式標題欄頂部疊加層去除

可能你的app是這樣:app

框起來部分和標題欄顏色並不一致。ide

調用下面的代碼能夠變成同樣。ui

import 'package:flutter/services.dart';

 

    static SystemUiOverlayStyle uiStyle = const SystemUiOverlayStyle(
        systemNavigationBarColor: const Color(0x00000000),
        systemNavigationBarDividerColor: null,
        statusBarColor: const Color(0x00000000),
        systemNavigationBarIconBrightness: Brightness.dark,
        statusBarIconBrightness: Brightness.dark,
        statusBarBrightness: Brightness.dark,
    );

    static appUIStyle() {
        SystemChrome.setSystemUIOverlayStyle(uiStyle);
    }

而後在每一個頁面initState中調用 spa

appUIStyle 

 

要是想謝個人話,點個贊就好了。code

相關文章
相關標籤/搜索