Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx_map_navigation
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
openSourceLibrary
clx_map_navigation
Commits
bf6feb40
提交
bf6feb40
authored
1月 06, 2023
作者:
袁静春
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
提交:修改导航退出返回多次问题;
上级
3d9e7573
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
35 行增加
和
34 行删除
+35
-34
AppFrameworkInfo.plist
example/ios/Flutter/AppFrameworkInfo.plist
+1
-1
Podfile
example/ios/Podfile
+1
-1
Podfile.lock
example/ios/Podfile.lock
+2
-2
project.pbxproj
example/ios/Runner.xcodeproj/project.pbxproj
+3
-3
map_config.dart
example/lib/map_config.dart
+0
-3
pubspec.lock
example/pubspec.lock
+12
-19
amap_navigation_widget.dart
lib/amap_navigation_widget.dart
+13
-3
amap_navigation_util.dart
lib/core/amap_navigation_util.dart
+1
-1
clx_map_navigation_method_channel.dart
lib/core/clx_map_navigation_method_channel.dart
+2
-1
没有找到文件。
example/ios/Flutter/AppFrameworkInfo.plist
浏览文件 @
bf6feb40
...
@@ -21,6 +21,6 @@
...
@@ -21,6 +21,6 @@
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
string
>
1.0
<
/string
>
<
string
>
1.0
<
/string
>
<
k
e
y
>
MinimumOSVersion
<
/k
e
y
>
<
k
e
y
>
MinimumOSVersion
<
/k
e
y
>
<
string
>
9
.0
<
/string
>
<
string
>
11
.0
<
/string
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
/plist
>
<
/plist
>
example/ios/Podfile
浏览文件 @
bf6feb40
# Uncomment this line to define a global platform for your project
# 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.
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV
[
'COCOAPODS_DISABLE_STATS'
]
=
'true'
ENV
[
'COCOAPODS_DISABLE_STATS'
]
=
'true'
...
...
example/ios/Podfile.lock
浏览文件 @
bf6feb40
...
@@ -26,8 +26,8 @@ SPEC CHECKSUMS:
...
@@ -26,8 +26,8 @@ SPEC CHECKSUMS:
AMapFoundation: f48153f724114b58da9b01875ab88a1f6856e3db
AMapFoundation: f48153f724114b58da9b01875ab88a1f6856e3db
AMapNavi: 04727c06ec51fc4d7c57d83e2542da81b32f2f59
AMapNavi: 04727c06ec51fc4d7c57d83e2542da81b32f2f59
clx_map_navigation: b73614901161608d76ebfe6ec266773bdfe00b26
clx_map_navigation: b73614901161608d76ebfe6ec266773bdfe00b26
Flutter:
50d75fe2f02b26cc09d224853bb45737f8b3214a
Flutter:
f04841e97a9d0b0a8025694d0796dd46242b2854
PODFILE CHECKSUM:
8e679eca47255a8ca8067c4c67aab20e64cb974d
PODFILE CHECKSUM:
663715e941f9adb426e33bf9376914006f9ea95b
COCOAPODS: 1.11.3
COCOAPODS: 1.11.3
example/ios/Runner.xcodeproj/project.pbxproj
浏览文件 @
bf6feb40
...
@@ -350,7 +350,7 @@
...
@@ -350,7 +350,7 @@
GCC_WARN_UNINITIALIZED_AUTOS
=
YES_AGGRESSIVE
;
GCC_WARN_UNINITIALIZED_AUTOS
=
YES_AGGRESSIVE
;
GCC_WARN_UNUSED_FUNCTION
=
YES
;
GCC_WARN_UNUSED_FUNCTION
=
YES
;
GCC_WARN_UNUSED_VARIABLE
=
YES
;
GCC_WARN_UNUSED_VARIABLE
=
YES
;
IPHONEOS_DEPLOYMENT_TARGET
=
9
.0
;
IPHONEOS_DEPLOYMENT_TARGET
=
11
.0
;
MTL_ENABLE_DEBUG_INFO
=
NO
;
MTL_ENABLE_DEBUG_INFO
=
NO
;
SDKROOT
=
iphoneos
;
SDKROOT
=
iphoneos
;
SUPPORTED_PLATFORMS
=
iphoneos
;
SUPPORTED_PLATFORMS
=
iphoneos
;
...
@@ -425,7 +425,7 @@
...
@@ -425,7 +425,7 @@
GCC_WARN_UNINITIALIZED_AUTOS
=
YES_AGGRESSIVE
;
GCC_WARN_UNINITIALIZED_AUTOS
=
YES_AGGRESSIVE
;
GCC_WARN_UNUSED_FUNCTION
=
YES
;
GCC_WARN_UNUSED_FUNCTION
=
YES
;
GCC_WARN_UNUSED_VARIABLE
=
YES
;
GCC_WARN_UNUSED_VARIABLE
=
YES
;
IPHONEOS_DEPLOYMENT_TARGET
=
9
.0
;
IPHONEOS_DEPLOYMENT_TARGET
=
11
.0
;
MTL_ENABLE_DEBUG_INFO
=
YES
;
MTL_ENABLE_DEBUG_INFO
=
YES
;
ONLY_ACTIVE_ARCH
=
YES
;
ONLY_ACTIVE_ARCH
=
YES
;
SDKROOT
=
iphoneos
;
SDKROOT
=
iphoneos
;
...
@@ -474,7 +474,7 @@
...
@@ -474,7 +474,7 @@
GCC_WARN_UNINITIALIZED_AUTOS
=
YES_AGGRESSIVE
;
GCC_WARN_UNINITIALIZED_AUTOS
=
YES_AGGRESSIVE
;
GCC_WARN_UNUSED_FUNCTION
=
YES
;
GCC_WARN_UNUSED_FUNCTION
=
YES
;
GCC_WARN_UNUSED_VARIABLE
=
YES
;
GCC_WARN_UNUSED_VARIABLE
=
YES
;
IPHONEOS_DEPLOYMENT_TARGET
=
9
.0
;
IPHONEOS_DEPLOYMENT_TARGET
=
11
.0
;
MTL_ENABLE_DEBUG_INFO
=
NO
;
MTL_ENABLE_DEBUG_INFO
=
NO
;
SDKROOT
=
iphoneos
;
SDKROOT
=
iphoneos
;
SUPPORTED_PLATFORMS
=
iphoneos
;
SUPPORTED_PLATFORMS
=
iphoneos
;
...
...
example/lib/map_config.dart
浏览文件 @
bf6feb40
...
@@ -11,7 +11,5 @@ class AMapConfig {
...
@@ -11,7 +11,5 @@ class AMapConfig {
static
onMapClosed
()
{
static
onMapClosed
()
{
print
(
"----- onMapClosed ---- 处理完了"
);
print
(
"----- onMapClosed ---- 处理完了"
);
}
}
}
}
\ No newline at end of file
example/pubspec.lock
浏览文件 @
bf6feb40
...
@@ -14,7 +14,7 @@ packages:
...
@@ -14,7 +14,7 @@ packages:
name: async
name: async
url: "https://pub.flutter-io.cn"
url: "https://pub.flutter-io.cn"
source: hosted
source: hosted
version: "2.
8.2
"
version: "2.
9.0
"
boolean_selector:
boolean_selector:
dependency: transitive
dependency: transitive
description:
description:
...
@@ -28,21 +28,14 @@ packages:
...
@@ -28,21 +28,14 @@ packages:
name: characters
name: characters
url: "https://pub.flutter-io.cn"
url: "https://pub.flutter-io.cn"
source: hosted
source: hosted
version: "1.2.0"
version: "1.2.1"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.1"
clock:
clock:
dependency: transitive
dependency: transitive
description:
description:
name: clock
name: clock
url: "https://pub.flutter-io.cn"
url: "https://pub.flutter-io.cn"
source: hosted
source: hosted
version: "1.1.
0
"
version: "1.1.
1
"
clx_map_navigation:
clx_map_navigation:
dependency: "direct main"
dependency: "direct main"
description:
description:
...
@@ -70,7 +63,7 @@ packages:
...
@@ -70,7 +63,7 @@ packages:
name: fake_async
name: fake_async
url: "https://pub.flutter-io.cn"
url: "https://pub.flutter-io.cn"
source: hosted
source: hosted
version: "1.3.
0
"
version: "1.3.
1
"
flutter:
flutter:
dependency: "direct main"
dependency: "direct main"
description: flutter
description: flutter
...
@@ -101,28 +94,28 @@ packages:
...
@@ -101,28 +94,28 @@ packages:
name: matcher
name: matcher
url: "https://pub.flutter-io.cn"
url: "https://pub.flutter-io.cn"
source: hosted
source: hosted
version: "0.12.1
1
"
version: "0.12.1
2
"
material_color_utilities:
material_color_utilities:
dependency: transitive
dependency: transitive
description:
description:
name: material_color_utilities
name: material_color_utilities
url: "https://pub.flutter-io.cn"
url: "https://pub.flutter-io.cn"
source: hosted
source: hosted
version: "0.1.
4
"
version: "0.1.
5
"
meta:
meta:
dependency: transitive
dependency: transitive
description:
description:
name: meta
name: meta
url: "https://pub.flutter-io.cn"
url: "https://pub.flutter-io.cn"
source: hosted
source: hosted
version: "1.
7
.0"
version: "1.
8
.0"
path:
path:
dependency: transitive
dependency: transitive
description:
description:
name: path
name: path
url: "https://pub.flutter-io.cn"
url: "https://pub.flutter-io.cn"
source: hosted
source: hosted
version: "1.8.
1
"
version: "1.8.
2
"
plugin_platform_interface:
plugin_platform_interface:
dependency: transitive
dependency: transitive
description:
description:
...
@@ -141,7 +134,7 @@ packages:
...
@@ -141,7 +134,7 @@ packages:
name: source_span
name: source_span
url: "https://pub.flutter-io.cn"
url: "https://pub.flutter-io.cn"
source: hosted
source: hosted
version: "1.
8.2
"
version: "1.
9.0
"
stack_trace:
stack_trace:
dependency: transitive
dependency: transitive
description:
description:
...
@@ -169,21 +162,21 @@ packages:
...
@@ -169,21 +162,21 @@ packages:
name: string_scanner
name: string_scanner
url: "https://pub.flutter-io.cn"
url: "https://pub.flutter-io.cn"
source: hosted
source: hosted
version: "1.1.
0
"
version: "1.1.
1
"
term_glyph:
term_glyph:
dependency: transitive
dependency: transitive
description:
description:
name: term_glyph
name: term_glyph
url: "https://pub.flutter-io.cn"
url: "https://pub.flutter-io.cn"
source: hosted
source: hosted
version: "1.2.
0
"
version: "1.2.
1
"
test_api:
test_api:
dependency: transitive
dependency: transitive
description:
description:
name: test_api
name: test_api
url: "https://pub.flutter-io.cn"
url: "https://pub.flutter-io.cn"
source: hosted
source: hosted
version: "0.4.
9
"
version: "0.4.
12
"
vector_math:
vector_math:
dependency: transitive
dependency: transitive
description:
description:
...
...
lib/amap_navigation_widget.dart
浏览文件 @
bf6feb40
...
@@ -10,7 +10,7 @@ import 'package:amap_flutter_base/amap_flutter_base.dart';
...
@@ -10,7 +10,7 @@ import 'package:amap_flutter_base/amap_flutter_base.dart';
import
'package:flutter/services.dart'
;
import
'package:flutter/services.dart'
;
final
MethodChannelClxMapNavigation
_methodChannel
=
ClxMapNavigationPlatform
.
instance
as
MethodChannelClxMapNavigation
;
final
MethodChannelClxMapNavigation
_methodChannel
=
ClxMapNavigationPlatform
.
instance
as
MethodChannelClxMapNavigation
;
typedef
void
MapClosedCallback
(
);
typedef
MapClosedCallback
=
void
Function
();
class
AMapNavigationWidget
extends
StatefulWidget
{
class
AMapNavigationWidget
extends
StatefulWidget
{
...
@@ -40,6 +40,9 @@ class AMapNavigationWidget extends StatefulWidget {
...
@@ -40,6 +40,9 @@ class AMapNavigationWidget extends StatefulWidget {
class
_MapNavigationState
extends
State
<
AMapNavigationWidget
>
{
class
_MapNavigationState
extends
State
<
AMapNavigationWidget
>
{
//消息订阅对象
late
StreamSubscription
_streamSubscription
;
@override
@override
void
initState
()
{
void
initState
()
{
super
.
initState
();
super
.
initState
();
...
@@ -51,11 +54,12 @@ class _MapNavigationState extends State<AMapNavigationWidget> {
...
@@ -51,11 +54,12 @@ class _MapNavigationState extends State<AMapNavigationWidget> {
_methodChannel
.
channel
().
setMethodCallHandler
((
call
)
=>
_handleMethodCall
(
call
));
_methodChannel
.
channel
().
setMethodCallHandler
((
call
)
=>
_handleMethodCall
(
call
));
}
}
// 监听
_connectStreams
()
{
_connectStreams
()
{
print
(
"---_connectStreams---"
);
print
(
"---_connectStreams---"
);
if
(
widget
.
onMapClosed
!=
null
)
{
if
(
widget
.
onMapClosed
!=
null
)
{
print
(
"------ _connectStreams listen ----- "
);
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> {
...
@@ -79,7 +83,6 @@ class _MapNavigationState extends State<AMapNavigationWidget> {
'endPoint'
:
widget
.
endPoint
,
'endPoint'
:
widget
.
endPoint
,
};
};
print
(
"--- build --- creationParams:
$creationParams
"
);
print
(
"--- build --- creationParams:
$creationParams
"
);
Widget
mapView
=
_methodChannel
.
buildMapNavigationView
(
Widget
mapView
=
_methodChannel
.
buildMapNavigationView
(
creationParams
,
creationParams
,
widget
.
gestureRecognizers
,
widget
.
gestureRecognizers
,
...
@@ -93,4 +96,11 @@ class _MapNavigationState extends State<AMapNavigationWidget> {
...
@@ -93,4 +96,11 @@ class _MapNavigationState extends State<AMapNavigationWidget> {
print
(
"********** 地图路径规划 ***********id="
+
id
.
toString
());
print
(
"********** 地图路径规划 ***********id="
+
id
.
toString
());
}
}
@override
void
dispose
()
{
super
.
dispose
();
//取消监听
_streamSubscription
.
cancel
();
}
}
}
lib/core/amap_navigation_util.dart
浏览文件 @
bf6feb40
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
class
AMapNavigationUtil
{
class
AMapNavigationUtil
{
static
AMapNavigationUtil
_instance
=
AMapNavigationUtil
.
_
();
static
final
AMapNavigationUtil
_instance
=
AMapNavigationUtil
.
_
();
static
double
_devicePixelRatio
=
0
;
static
double
_devicePixelRatio
=
0
;
static
void
init
(
BuildContext
context
)
{
static
void
init
(
BuildContext
context
)
{
_devicePixelRatio
=
MediaQuery
.
of
(
context
).
devicePixelRatio
;
_devicePixelRatio
=
MediaQuery
.
of
(
context
).
devicePixelRatio
;
...
...
lib/core/clx_map_navigation_method_channel.dart
浏览文件 @
bf6feb40
...
@@ -26,6 +26,7 @@ class MethodChannelClxMapNavigation extends ClxMapNavigationPlatform {
...
@@ -26,6 +26,7 @@ class MethodChannelClxMapNavigation extends ClxMapNavigationPlatform {
Set
<
Factory
<
OneSequenceGestureRecognizer
>>
gestureRecognizers
,
Set
<
Factory
<
OneSequenceGestureRecognizer
>>
gestureRecognizers
,
void
Function
(
int
id
)
onPlatformViewCreated
,
void
Function
(
int
id
)
onPlatformViewCreated
,
MapClosedCallback
?
onMapClosed
,)
{
MapClosedCallback
?
onMapClosed
,)
{
print
(
"--- buildMapNavigationView --- creationParams:
$creationParams
"
);
print
(
"--- buildMapNavigationView --- creationParams:
$creationParams
"
);
if
(
defaultTargetPlatform
==
TargetPlatform
.
android
)
{
if
(
defaultTargetPlatform
==
TargetPlatform
.
android
)
{
...
@@ -59,7 +60,7 @@ class MethodChannelClxMapNavigation extends ClxMapNavigationPlatform {
...
@@ -59,7 +60,7 @@ class MethodChannelClxMapNavigation extends ClxMapNavigationPlatform {
// 根据mapid返回相应的event.
// 根据mapid返回相应的event.
Stream
<
MapEvent
>
_events
()
=>
_mapEventStreamController
.
stream
;
Stream
<
MapEvent
>
_events
()
=>
_mapEventStreamController
.
stream
;
// 底部退出回调
// 底部退出回调
- whereType:返回特定对象【筛选】
Stream
<
MapClosedEvent
>
onMapClosed
()
{
Stream
<
MapClosedEvent
>
onMapClosed
()
{
return
_events
().
whereType
<
MapClosedEvent
>();
return
_events
().
whereType
<
MapClosedEvent
>();
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论