我正在尝试构建一个小型应用程序,并且在三星Galaxy S9 +的应用程序上方确实有一个黑条。 使用模拟器时,该栏也会显示在其中。
有人可以帮助我找到造成此问题的原因吗?
查看所附图片。
感谢帮助
这是主屏幕代码
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'register_house.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'findMe',
home: MapSample(),
);
}
}
class MapSample extends StatefulWidget {
@override
State<MapSample> createState() => MapSampleState();
}
class MapSampleState extends State<MapSample> {
Completer<GoogleMapController> _controller = Completer();
static final CameraPosition _homePageLocation = CameraPosition(
target: LatLng(3.8189673, 11.5010141),
zoom: 14.4746,
);
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text('findMe'),
),
body: GoogleMap(
mapType: MapType.hybrid,
initialCameraPosition: _homePageLocation,
onMapCreated: (GoogleMapController controller) {
_controller.complete(controller);
},
),
floatingActionButton: FloatingActionButton.extended(
onPressed: goToRegisterPage,
label: Text('Add my House'),
icon: Icon(Icons.home),
),
);
}
void _pushPage(BuildContext context, Widget page) {
Navigator.of(context).push(
MaterialPageRoute<void>(builder: (_) => page),
);
}
void goToRegisterPage() {
_pushPage(context, RegisterPage());
}
} //delimits class