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> { class _HomePageState extends State<HomePage> {
bool enabled = false; bool enabled = false;
late AMapController _mapController;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -223,19 +223,54 @@ class _HomePageState extends State<HomePage> {
} }
Widget buildBottomWidget() { Widget buildBottomWidget() {
const AMapWidget map = AMapWidget( AMapWidget map = AMapWidget(
///SDK ///SDK
privacyStatement: ConstConfig.amapPrivacyStatement, privacyStatement: ConstConfig.amapPrivacyStatement,
apiKey: ConstConfig.amapApiKeys, 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( return Expanded(
child: Container( child: Stack(
children: [
Container(
margin: const EdgeInsets.only(top: 10,bottom: 10), margin: const EdgeInsets.only(top: 10,bottom: 10),
decoration: const BoxDecoration( decoration: const BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(5))), borderRadius: BorderRadius.all(Radius.circular(5))),
child: map, 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');
}
} }