重构example项目结构
This commit is contained in:
@ -1,24 +1,15 @@
|
||||
import 'package:amap_map/amap_map.dart';
|
||||
import 'package:amap_map_example/base_page.dart';
|
||||
import 'package:amap_map_example/const_config.dart';
|
||||
import 'package:amap_map_example/widgets/amap_radio_group.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ChangeMapTypePage extends BasePage {
|
||||
ChangeMapTypePage(String title, String subTitle) : super(title, subTitle);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => _PageBody();
|
||||
}
|
||||
|
||||
class _PageBody extends StatefulWidget {
|
||||
_PageBody({Key? key}) : super(key: key);
|
||||
class ChangeMapTypePage extends StatefulWidget {
|
||||
ChangeMapTypePage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_PageBodyState createState() => _PageBodyState();
|
||||
}
|
||||
|
||||
class _PageBodyState extends State<_PageBody> {
|
||||
class _PageBodyState extends State<ChangeMapTypePage> {
|
||||
//地图类型
|
||||
late MapType _mapType;
|
||||
final Map<String, MapType> _radioValueMap = {
|
||||
|
@ -1,27 +1,16 @@
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:amap_map/amap_map.dart';
|
||||
import 'package:amap_map_example/base_page.dart';
|
||||
import 'package:amap_map_example/const_config.dart';
|
||||
import 'package:amap_map_example/widgets/amap_switch_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
class CustomMapStylePage extends BasePage {
|
||||
CustomMapStylePage(String title, String subTitle) : super(title, subTitle);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => _CustomMapStyleBody();
|
||||
}
|
||||
|
||||
class _CustomMapStyleBody extends StatefulWidget {
|
||||
_CustomMapStyleBody({Key? key}) : super(key: key);
|
||||
class CustomMapStylePage extends StatefulWidget {
|
||||
CustomMapStylePage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_CustomMapStyleState createState() => _CustomMapStyleState();
|
||||
}
|
||||
|
||||
class _CustomMapStyleState extends State<_CustomMapStyleBody> {
|
||||
class _CustomMapStyleState extends State<CustomMapStylePage> {
|
||||
bool _mapCreated = false;
|
||||
|
||||
CustomStyleOptions _customStyleOptions = CustomStyleOptions(false);
|
||||
|
@ -1,24 +1,15 @@
|
||||
import 'package:amap_map/amap_map.dart';
|
||||
import 'package:x_amap_base/x_amap_base.dart';
|
||||
import 'package:amap_map_example/base_page.dart';
|
||||
import 'package:amap_map_example/const_config.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class LimitMapBoundsPage extends BasePage {
|
||||
LimitMapBoundsPage(String title, String subTitle) : super(title, subTitle);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => _Body();
|
||||
}
|
||||
|
||||
class _Body extends StatefulWidget {
|
||||
_Body({Key? key}) : super(key: key);
|
||||
class LimitMapBoundsPage extends StatefulWidget {
|
||||
LimitMapBoundsPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_BodyState createState() => _BodyState();
|
||||
}
|
||||
|
||||
class _BodyState extends State<_Body> {
|
||||
class _BodyState extends State<LimitMapBoundsPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final AMapWidget amap = AMapWidget(
|
||||
|
@ -1,28 +1,18 @@
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:amap_map/amap_map.dart';
|
||||
import 'package:amap_map_example/base_page.dart';
|
||||
import 'package:amap_map_example/const_config.dart';
|
||||
import 'package:amap_map_example/widgets/amap_switch_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:x_amap_base/x_amap_base.dart';
|
||||
|
||||
class AllMapConfigDemoPage extends BasePage {
|
||||
AllMapConfigDemoPage(String title, String subTitle) : super(title, subTitle);
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return _MapUiBody();
|
||||
}
|
||||
}
|
||||
|
||||
class _MapUiBody extends StatefulWidget {
|
||||
class AllMapConfigDemoPage extends StatefulWidget {
|
||||
@override
|
||||
State<StatefulWidget> createState() => _MapUiBodyState();
|
||||
}
|
||||
|
||||
class _MapUiBodyState extends State<_MapUiBody> {
|
||||
class _MapUiBodyState extends State<AllMapConfigDemoPage> {
|
||||
//默认显示在北京天安门
|
||||
static final CameraPosition _kInitialPosition = const CameraPosition(
|
||||
target: LatLng(39.909187, 116.397451),
|
||||
|
@ -1,22 +1,14 @@
|
||||
import 'package:amap_map/amap_map.dart';
|
||||
import 'package:amap_map_example/base_page.dart';
|
||||
import 'package:amap_map_example/const_config.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
|
||||
class MyLocationPage extends BasePage {
|
||||
MyLocationPage(String title, String subTitle) : super(title, subTitle);
|
||||
@override
|
||||
Widget build(BuildContext context) => _Body();
|
||||
}
|
||||
|
||||
class _Body extends StatefulWidget {
|
||||
_Body({Key? key}) : super(key: key);
|
||||
class MyLocationPage extends StatefulWidget {
|
||||
MyLocationPage({Key? key}) : super(key: key);
|
||||
@override
|
||||
_BodyState createState() => _BodyState();
|
||||
}
|
||||
|
||||
class _BodyState extends State<_Body> {
|
||||
class _BodyState extends State<MyLocationPage> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
@ -44,6 +36,7 @@ class _BodyState extends State<_Body> {
|
||||
circleStrokeWidth: 1,
|
||||
),
|
||||
);
|
||||
|
||||
return Container(
|
||||
child: amap,
|
||||
);
|
||||
|
@ -1,23 +1,14 @@
|
||||
import 'package:amap_map/amap_map.dart';
|
||||
import 'package:amap_map_example/base_page.dart';
|
||||
import 'package:amap_map_example/const_config.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MinMaxZoomDemoPage extends BasePage {
|
||||
MinMaxZoomDemoPage(String title, String subTitle) : super(title, subTitle);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => _Body();
|
||||
}
|
||||
|
||||
class _Body extends StatefulWidget {
|
||||
_Body({Key? key}) : super(key: key);
|
||||
class MinMaxZoomDemoPage extends StatefulWidget {
|
||||
MinMaxZoomDemoPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_BodyState createState() => _BodyState();
|
||||
}
|
||||
|
||||
class _BodyState extends State<_Body> {
|
||||
class _BodyState extends State<MinMaxZoomDemoPage> {
|
||||
final double _minZoom = 10;
|
||||
final double _maxZoom = 15;
|
||||
String? _currentZoom;
|
||||
|
@ -1,23 +1,14 @@
|
||||
import 'package:amap_map/amap_map.dart';
|
||||
import 'package:x_amap_base/x_amap_base.dart';
|
||||
import 'package:amap_map_example/base_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MultiMapDemoPage extends BasePage {
|
||||
MultiMapDemoPage(String title, String subTitle) : super(title, subTitle);
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const _MultiMapDemoBody();
|
||||
}
|
||||
}
|
||||
|
||||
class _MultiMapDemoBody extends StatefulWidget {
|
||||
const _MultiMapDemoBody();
|
||||
class MultiMapDemoPage extends StatefulWidget {
|
||||
const MultiMapDemoPage();
|
||||
@override
|
||||
State<StatefulWidget> createState() => _MultiMapDemoState();
|
||||
}
|
||||
|
||||
class _MultiMapDemoState extends State<_MultiMapDemoBody> {
|
||||
class _MultiMapDemoState extends State<MultiMapDemoPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
|
@ -1,23 +1,13 @@
|
||||
import 'package:amap_map_example/base_page.dart';
|
||||
import 'package:amap_map_example/const_config.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:amap_map/amap_map.dart';
|
||||
|
||||
class ShowMapPage extends BasePage {
|
||||
ShowMapPage(String title, String subTitle) : super(title, subTitle);
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return _ShowMapPageBody();
|
||||
}
|
||||
}
|
||||
|
||||
class _ShowMapPageBody extends StatefulWidget {
|
||||
class ShowMapPage extends StatefulWidget {
|
||||
@override
|
||||
State<StatefulWidget> createState() => _ShowMapPageState();
|
||||
}
|
||||
|
||||
class _ShowMapPageState extends State<_ShowMapPageBody> {
|
||||
class _ShowMapPageState extends State<ShowMapPage> {
|
||||
List<Widget> _approvalNumberWidget = <Widget>[];
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
Reference in New Issue
Block a user