[英]How to make device top panel (status bar) have the same background color as AppBar in flutter?
[英]How to make the status bar background same as app background - Flutter - Make text black on white status bar?
尝试这个:
import 'package:flutter/services.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
statusBarIconBrightness: Brightness.dark,
systemNavigationBarIconBrightness: Brightness.light,
statusBarColor: Colors.black, //any color of your choice
systemNavigationBarColor: Color(0xff282828),
));
runApp(const YourApp());
}
Container(
color: Colors.blue, // Status bar color
child: SafeArea(
left: false,
right: false,
bottom: false,
child: Scaffold(
appBar: AppBar(
backgroundColor: Colors.blue, // App bar color
),
),
),
),
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.