bottom widget second commit

main
zhuce 2024-02-23 20:12:18 +08:00
parent 2223d7165f
commit bd18be317c
1 changed files with 44 additions and 9 deletions

View File

@ -14,7 +14,7 @@ class HomePage extends StatefulWidget {
class _HomePageState extends State<HomePage> {
bool enabled = false;
late AMapController _mapController;
@override
Widget build(BuildContext context) {
return Scaffold(
@ -223,19 +223,54 @@ class _HomePageState extends State<HomePage> {
}
Widget buildBottomWidget() {
const AMapWidget map = AMapWidget(
AMapWidget map = AMapWidget(
///SDK
privacyStatement: ConstConfig.amapPrivacyStatement,
apiKey: ConstConfig.amapApiKeys,
mapType: MapType.navi,
scaleEnabled: false,
myLocationStyleOptions: MyLocationStyleOptions(
true,
circleFillColor: Colors.lightBlue,
circleStrokeColor: Colors.blue,
circleStrokeWidth: 1,
),
onMapCreated: (AMapController controller){
setState(() {
_mapController = controller;
getApprovalNumber();
});
},
);
return Expanded(
child: Container(
margin: const EdgeInsets.only(top: 10,bottom: 10),
decoration: const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(5))),
child: map,
),
child: Stack(
children: [
Container(
margin: const EdgeInsets.only(top: 10,bottom: 10),
decoration: const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(5))),
child: map,
),
Positioned(
bottom: 20,
right: 20,
child: Image.asset("images/3.0x/current_location.png",width: 30,height: 30,),
)
],
)
);
}
///
void getApprovalNumber() async {
//
String? mapContentApprovalNumber =
await _mapController.getMapContentApprovalNumber();
//
String? satelliteImageApprovalNumber =
await _mapController.getSatelliteImageApprovalNumber();
print('地图审图号(普通地图): $mapContentApprovalNumber');
print('地图审图号(卫星地图): $satelliteImageApprovalNumber');
}
}