import 'package:flutter/services.dart'; import 'dart:io';
class _MyAppState extends State<MyApp> { //android 沉浸式 @override Widget build(BuildContext context) { if (Platform.isAndroid) { SystemUiOverlayStyle systemUiOverlayStyle = SystemUiOverlayStyle(statusBarColor: Colors.transparent); SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle); } // return MaterialApp( home: Demo(), ); } }