Reputation: 21
Black bar at the top of the Android emulator in full screen mode
Did I do something wrong?
I am new to stackoverflow and cannot add images yet
Emulator Screenshot
Virtual Device Settings:
Pixel 5 6.0 1080x2340 xxhdpi
Android API 33 x86_64
Startup orientation: Portrait
Emulated Performance:
Host: Windows 11
Flutter doctor: No issues found!
main.dart
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void main() {
runApp(const MyApp());
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []);
}
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: Root(),
);
}
}
class Root extends StatelessWidget {
const Root({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
height: MediaQuery.of(context).size.height,
color: Colors.red,
);
}
}
Upvotes: 1
Views: 546
Reputation: 443
can you try this;
void main(){
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
));
runApp(const MyApp());
}
Upvotes: 0