release: 1.0.9, add map language support

This commit is contained in:
Kuloud
2024-08-24 11:24:07 +08:00
parent b582025ac7
commit 4602f30730
16 changed files with 186 additions and 46 deletions

View File

@ -1,7 +1,7 @@
PODS:
- AMap3DMap (10.0.800):
- AMapFoundation (>= 1.8.0)
- amap_map (1.0.3):
- amap_map (1.0.8):
- AMap3DMap
- Flutter
- AMapFoundation (1.8.2)
@ -29,7 +29,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
AMap3DMap: 6761e0381f517978312e4f795ce77b2b9f6781a6
amap_map: 8773e5cacc760edf208b1e6e61000241d26385fa
amap_map: 5be213f350872f6ea406be964031572ab9a0d6e1
AMapFoundation: 9885c48fc3a78fdfb84a0299a2293e56ea3c9fec
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2

View File

@ -2,6 +2,7 @@ import 'dart:collection';
import 'package:amap_map_example/main.dart';
import 'package:amap_map_example/pages/interactive/map_ui_options.dart';
import 'package:amap_map_example/pages/map/change_map_lang.dart';
import 'package:amap_map_example/pages/map/limit_map_bounds.dart';
import 'package:amap_map_example/pages/map/map_my_location.dart';
import 'package:amap_map_example/pages/map/map_with_extension_page.dart';
@ -47,6 +48,14 @@ List<Demo> mapDemos() {
configurations: [
DemoConfiguration(buildRoute: (context) => LimitMapBoundsPage())
]),
Demo(
title: '地图显示语言',
category: DemoCategory.basic,
subtitle: '演示限定手机屏幕显示地图的范围',
slug: 'map-lang',
configurations: [
DemoConfiguration(buildRoute: (context) => ChangeMapLangPage())
]),
];
}

View File

@ -4,7 +4,6 @@ import 'package:amap_map_example/widgets/amap_radio_group.dart';
import 'package:amap_map_example/widgets/amap_switch_button.dart';
import 'package:flutter/material.dart';
import 'package:x_amap_base/x_amap_base.dart';
import 'package:x_common/utils/logger.dart';
class MapUIDemoPage extends StatefulWidget {
MapUIDemoPage({Key? key}) : super(key: key);

View File

@ -0,0 +1,73 @@
// Copyright 2024 kuloud
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
import 'package:amap_map/amap_map.dart';
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);
@override
_PageBodyState createState() => _PageBodyState();
}
class _PageBodyState extends State<ChangeMapLangPage> {
MapLanguage? _mapLang;
final Map<String, MapLanguage> _radioValueMap = {
'中文': MapLanguage.chinese,
'English': MapLanguage.english,
};
@override
void initState() {
super.initState();
_mapLang = MapLanguage.chinese;
}
@override
Widget build(BuildContext context) {
//创建地图
final AMapWidget map = AMapWidget(
mapLanguage: _mapLang,
);
return Container(
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Container(
height: MediaQuery.of(context).size.height * 0.6,
width: MediaQuery.of(context).size.width,
child: map,
),
Expanded(
child: SingleChildScrollView(
child: Container(
child: AMapRadioGroup(
groupLabel: '地图语言',
groupValue: _mapLang,
radioValueMap: _radioValueMap,
onChanged: (value) => {
setState(() {
_mapLang = value;
})
},
),
),
),
),
],
),
);
}
}

View File

@ -13,8 +13,6 @@
// import 'package:amap_map_extensions/amap_map_extensions.dart';
import 'package:flutter/material.dart';
import 'dart:typed_data';
import 'package:amap_map/amap_map.dart';
class MapWithExtensionPage extends StatefulWidget {

View File

@ -12,8 +12,8 @@ dependencies:
flutter:
sdk: flutter
permission_handler: ^11.3.0
flutter_plugin_android_lifecycle: ^2.0.17
permission_handler: ^11.3.1
flutter_plugin_android_lifecycle: ^2.0.21
amap_map:
# When depending on this package from a real application you should use:
@ -23,6 +23,7 @@ dependencies:
# the parent directory to use the current plugin's version.
path: ../
x_common: ^1.0.4
x_amap_base: ^1.0.3
# amap_map_extensions: ^0.0.1
# amap_map_extensions: