release: 1.0.12
This commit is contained in:
@ -14,10 +14,10 @@ import 'package:amap_map_example/widgets/amap_radio_group.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ChangeMapLangPage extends StatefulWidget {
|
||||
ChangeMapLangPage({Key? key}) : super(key: key);
|
||||
ChangeMapLangPage({super.key});
|
||||
|
||||
@override
|
||||
_PageBodyState createState() => _PageBodyState();
|
||||
State<ChangeMapLangPage> createState() => _PageBodyState();
|
||||
}
|
||||
|
||||
class _PageBodyState extends State<ChangeMapLangPage> {
|
||||
|
@ -3,10 +3,10 @@ import 'package:amap_map_example/widgets/amap_radio_group.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ChangeMapTypePage extends StatefulWidget {
|
||||
ChangeMapTypePage({Key? key}) : super(key: key);
|
||||
ChangeMapTypePage({super.key});
|
||||
|
||||
@override
|
||||
_PageBodyState createState() => _PageBodyState();
|
||||
State<ChangeMapTypePage> createState() => _PageBodyState();
|
||||
}
|
||||
|
||||
class _PageBodyState extends State<ChangeMapTypePage> {
|
||||
|
@ -4,16 +4,16 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
class CustomMapStylePage extends StatefulWidget {
|
||||
CustomMapStylePage({Key? key}) : super(key: key);
|
||||
CustomMapStylePage({super.key});
|
||||
|
||||
@override
|
||||
_CustomMapStyleState createState() => _CustomMapStyleState();
|
||||
State<CustomMapStylePage> createState() => _CustomMapStyleState();
|
||||
}
|
||||
|
||||
class _CustomMapStyleState extends State<CustomMapStylePage> {
|
||||
bool _mapCreated = false;
|
||||
|
||||
CustomStyleOptions _customStyleOptions = CustomStyleOptions(false);
|
||||
final CustomStyleOptions _customStyleOptions = CustomStyleOptions(false);
|
||||
//加载自定义地图样式
|
||||
void _loadCustomData() async {
|
||||
ByteData styleByteData = await rootBundle.load('assets/style.data');
|
||||
|
@ -3,10 +3,10 @@ import 'package:x_amap_base/x_amap_base.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class LimitMapBoundsPage extends StatefulWidget {
|
||||
LimitMapBoundsPage({Key? key}) : super(key: key);
|
||||
LimitMapBoundsPage({super.key});
|
||||
|
||||
@override
|
||||
_BodyState createState() => _BodyState();
|
||||
State<LimitMapBoundsPage> createState() => _BodyState();
|
||||
}
|
||||
|
||||
class _BodyState extends State<LimitMapBoundsPage> {
|
||||
|
@ -1,5 +1,3 @@
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:amap_map/amap_map.dart';
|
||||
import 'package:amap_map_example/widgets/amap_switch_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@ -54,10 +52,10 @@ class _MapUiBodyState extends State<AllMapConfigDemoPage> {
|
||||
|
||||
late AMapController _controller;
|
||||
|
||||
CustomStyleOptions _customStyleOptions = CustomStyleOptions(false);
|
||||
final CustomStyleOptions _customStyleOptions = CustomStyleOptions(false);
|
||||
|
||||
///自定义定位小蓝点
|
||||
MyLocationStyleOptions _myLocationStyleOptions =
|
||||
final MyLocationStyleOptions _myLocationStyleOptions =
|
||||
MyLocationStyleOptions(false);
|
||||
@override
|
||||
void initState() {
|
||||
@ -100,7 +98,7 @@ class _MapUiBodyState extends State<AllMapConfigDemoPage> {
|
||||
onPoiTouched: _onMapPoiTouched,
|
||||
);
|
||||
|
||||
Widget _mapTypeRadio(String label, MapType radioValue) {
|
||||
Widget mapTypeRadio(String label, MapType radioValue) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
@ -118,16 +116,16 @@ class _MapUiBodyState extends State<AllMapConfigDemoPage> {
|
||||
);
|
||||
}
|
||||
|
||||
final List<Widget> _mapTypeList = [
|
||||
_mapTypeRadio('普通地图', MapType.normal),
|
||||
_mapTypeRadio('卫星地图', MapType.satellite),
|
||||
_mapTypeRadio('导航地图', MapType.navi),
|
||||
_mapTypeRadio('公交地图', MapType.bus),
|
||||
_mapTypeRadio('黑夜模式', MapType.night),
|
||||
final List<Widget> mapTypeList = [
|
||||
mapTypeRadio('普通地图', MapType.normal),
|
||||
mapTypeRadio('卫星地图', MapType.satellite),
|
||||
mapTypeRadio('导航地图', MapType.navi),
|
||||
mapTypeRadio('公交地图', MapType.bus),
|
||||
mapTypeRadio('黑夜模式', MapType.night),
|
||||
];
|
||||
|
||||
//ui控制
|
||||
final List<Widget> _uiOptions = [
|
||||
final List<Widget> uiOptions = [
|
||||
AMapSwitchButton(
|
||||
label: Text('显示路况'),
|
||||
defaultValue: _trafficEnabled,
|
||||
@ -233,7 +231,7 @@ class _MapUiBodyState extends State<AllMapConfigDemoPage> {
|
||||
),
|
||||
];
|
||||
|
||||
Widget _mapTypeOptions() {
|
||||
Widget mapTypeOptions() {
|
||||
return Container(
|
||||
padding: EdgeInsets.all(5),
|
||||
child: Column(
|
||||
@ -243,14 +241,14 @@ class _MapUiBodyState extends State<AllMapConfigDemoPage> {
|
||||
Text('地图样式', style: TextStyle(fontWeight: FontWeight.w600)),
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 10),
|
||||
child: createGridView(_mapTypeList),
|
||||
child: createGridView(mapTypeList),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _myLocationStyleContainer() {
|
||||
Widget myLocationStyleContainer() {
|
||||
return Container(
|
||||
padding: EdgeInsets.all(5),
|
||||
child: Row(
|
||||
@ -273,7 +271,7 @@ class _MapUiBodyState extends State<AllMapConfigDemoPage> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _uiOptionsWidget() {
|
||||
Widget uiOptionsWidget() {
|
||||
return Container(
|
||||
padding: EdgeInsets.all(5),
|
||||
child: Column(
|
||||
@ -283,14 +281,14 @@ class _MapUiBodyState extends State<AllMapConfigDemoPage> {
|
||||
Text('UI操作', style: TextStyle(fontWeight: FontWeight.w600)),
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 10),
|
||||
child: createGridView(_uiOptions),
|
||||
child: createGridView(uiOptions),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _gesturesOptiosWeidget() {
|
||||
Widget gesturesOptiosWeidget() {
|
||||
return Container(
|
||||
padding: EdgeInsets.all(5),
|
||||
child: Column(
|
||||
@ -307,13 +305,13 @@ class _MapUiBodyState extends State<AllMapConfigDemoPage> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _optionsItem() {
|
||||
Widget optionsItem() {
|
||||
return Column(
|
||||
children: [
|
||||
_mapTypeOptions(),
|
||||
_myLocationStyleContainer(),
|
||||
_uiOptionsWidget(),
|
||||
_gesturesOptiosWeidget(),
|
||||
mapTypeOptions(),
|
||||
myLocationStyleContainer(),
|
||||
uiOptionsWidget(),
|
||||
gesturesOptiosWeidget(),
|
||||
TextButton(
|
||||
child: const Text('moveCamera到首开'),
|
||||
onPressed: _moveCameraToShoukai,
|
||||
@ -337,7 +335,7 @@ class _MapUiBodyState extends State<AllMapConfigDemoPage> {
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Container(
|
||||
child: _optionsItem(),
|
||||
child: optionsItem(),
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -366,7 +364,7 @@ class _MapUiBodyState extends State<AllMapConfigDemoPage> {
|
||||
Widget createGridView(List<Widget> widgets) {
|
||||
return GridView.count(
|
||||
primary: false,
|
||||
physics: new NeverScrollableScrollPhysics(),
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
//水平子Widget之间间距
|
||||
crossAxisSpacing: 1.0,
|
||||
//垂直子Widget之间间距
|
||||
|
@ -3,9 +3,9 @@ import 'package:flutter/material.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
|
||||
class MyLocationPage extends StatefulWidget {
|
||||
MyLocationPage({Key? key}) : super(key: key);
|
||||
MyLocationPage({super.key});
|
||||
@override
|
||||
_BodyState createState() => _BodyState();
|
||||
State<MyLocationPage> createState() => _BodyState();
|
||||
}
|
||||
|
||||
class _BodyState extends State<MyLocationPage> {
|
||||
|
@ -2,10 +2,10 @@ import 'package:amap_map/amap_map.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MinMaxZoomDemoPage extends StatefulWidget {
|
||||
MinMaxZoomDemoPage({Key? key}) : super(key: key);
|
||||
MinMaxZoomDemoPage({super.key});
|
||||
|
||||
@override
|
||||
_BodyState createState() => _BodyState();
|
||||
State<MinMaxZoomDemoPage> createState() => _BodyState();
|
||||
}
|
||||
|
||||
class _BodyState extends State<MinMaxZoomDemoPage> {
|
||||
|
@ -8,7 +8,7 @@ class ShowMapPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _ShowMapPageState extends State<ShowMapPage> {
|
||||
List<Widget> _approvalNumberWidget = <Widget>[];
|
||||
final List<Widget> _approvalNumberWidget = <Widget>[];
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final AMapWidget map = AMapWidget(
|
||||
|
Reference in New Issue
Block a user