提交 7c8e1423 authored 作者: shixiaochen's avatar shixiaochen

Merge remote-tracking branch 'origin/main'

......@@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>9.0</string>
<string>11.0</string>
</dict>
</plist>
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
# platform :ios, '11.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
......
......@@ -26,8 +26,8 @@ SPEC CHECKSUMS:
AMapFoundation: f48153f724114b58da9b01875ab88a1f6856e3db
AMapNavi: 04727c06ec51fc4d7c57d83e2542da81b32f2f59
clx_map_navigation: b73614901161608d76ebfe6ec266773bdfe00b26
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
PODFILE CHECKSUM: 8e679eca47255a8ca8067c4c67aab20e64cb974d
PODFILE CHECKSUM: 663715e941f9adb426e33bf9376914006f9ea95b
COCOAPODS: 1.11.3
......@@ -350,7 +350,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
......@@ -425,7 +425,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
......@@ -474,7 +474,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
......
......@@ -11,7 +11,5 @@ class AMapConfig {
static onMapClosed() {
print("----- onMapClosed ---- 处理完了");
}
}
\ No newline at end of file
......@@ -14,7 +14,7 @@ packages:
name: async
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.8.2"
version: "2.9.0"
boolean_selector:
dependency: transitive
description:
......@@ -28,21 +28,14 @@ packages:
name: characters
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.1"
version: "1.2.1"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
version: "1.1.1"
clx_map_navigation:
dependency: "direct main"
description:
......@@ -70,7 +63,7 @@ packages:
name: fake_async
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.0"
version: "1.3.1"
flutter:
dependency: "direct main"
description: flutter
......@@ -101,28 +94,28 @@ packages:
name: matcher
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.12.11"
version: "0.12.12"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.4"
version: "0.1.5"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.7.0"
version: "1.8.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.8.1"
version: "1.8.2"
plugin_platform_interface:
dependency: transitive
description:
......@@ -141,7 +134,7 @@ packages:
name: source_span
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.8.2"
version: "1.9.0"
stack_trace:
dependency: transitive
description:
......@@ -169,21 +162,21 @@ packages:
name: string_scanner
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
version: "1.1.1"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0"
version: "1.2.1"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.4.9"
version: "0.4.12"
vector_math:
dependency: transitive
description:
......
......@@ -10,7 +10,7 @@ import 'package:amap_flutter_base/amap_flutter_base.dart';
import 'package:flutter/services.dart';
final MethodChannelClxMapNavigation _methodChannel = ClxMapNavigationPlatform.instance as MethodChannelClxMapNavigation;
typedef void MapClosedCallback();
typedef MapClosedCallback = void Function();
class AMapNavigationWidget extends StatefulWidget {
......@@ -40,6 +40,9 @@ class AMapNavigationWidget extends StatefulWidget {
class _MapNavigationState extends State<AMapNavigationWidget> {
//消息订阅对象
late StreamSubscription _streamSubscription;
@override
void initState() {
super.initState();
......@@ -51,11 +54,12 @@ class _MapNavigationState extends State<AMapNavigationWidget> {
_methodChannel.channel().setMethodCallHandler((call) => _handleMethodCall(call));
}
// 监听
_connectStreams() {
print("---_connectStreams---");
if (widget.onMapClosed != null) {
print("------ _connectStreams listen ----- ");
_methodChannel.onMapClosed().listen((MapClosedEvent e) => widget.onMapClosed!());
_streamSubscription = _methodChannel.onMapClosed().listen((MapClosedEvent e) => widget.onMapClosed!());
}
}
......@@ -79,7 +83,6 @@ class _MapNavigationState extends State<AMapNavigationWidget> {
'endPoint': widget.endPoint,
};
print("--- build --- creationParams: $creationParams");
Widget mapView = _methodChannel.buildMapNavigationView(
creationParams,
widget.gestureRecognizers,
......@@ -93,4 +96,11 @@ class _MapNavigationState extends State<AMapNavigationWidget> {
print("********** 地图路径规划 ***********id="+id.toString());
}
@override
void dispose() {
super.dispose();
//取消监听
_streamSubscription.cancel();
}
}
import 'package:flutter/material.dart';
class AMapNavigationUtil {
static AMapNavigationUtil _instance = AMapNavigationUtil._();
static final AMapNavigationUtil _instance = AMapNavigationUtil._();
static double _devicePixelRatio = 0;
static void init(BuildContext context) {
_devicePixelRatio = MediaQuery.of(context).devicePixelRatio;
......
......@@ -26,6 +26,7 @@ class MethodChannelClxMapNavigation extends ClxMapNavigationPlatform {
Set<Factory<OneSequenceGestureRecognizer>> gestureRecognizers,
void Function(int id) onPlatformViewCreated,
MapClosedCallback? onMapClosed,) {
print("--- buildMapNavigationView --- creationParams: $creationParams");
if (defaultTargetPlatform == TargetPlatform.android) {
......@@ -59,7 +60,7 @@ class MethodChannelClxMapNavigation extends ClxMapNavigationPlatform {
// 根据mapid返回相应的event.
Stream<MapEvent> _events() => _mapEventStreamController.stream;
// 底部退出回调
// 底部退出回调 - whereType:返回特定对象【筛选】
Stream<MapClosedEvent> onMapClosed() {
return _events().whereType<MapClosedEvent>();
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论