release: 1.0.9, add map language support
This commit is contained in:
@ -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);
|
||||
|
73
example/lib/pages/map/change_map_lang.dart
Normal file
73
example/lib/pages/map/change_map_lang.dart
Normal 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;
|
||||
})
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -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 {
|
||||
|
Reference in New Issue
Block a user