Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx_map_poi_search
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
openSourceLibrary
clx_map_poi_search
Commits
fcc475e2
提交
fcc475e2
authored
12月 02, 2022
作者:
袁静春
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
提交:修改文件目录和配置;
上级
9bdd74bd
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
7 行增加
和
46 行删除
+7
-46
clx_map_poi_search.dart
lib/clx_map_poi_search.dart
+3
-31
clx_map_poi_search_method_channel.dart
lib/core/clx_map_poi_search_method_channel.dart
+1
-7
clx_map_poi_search_platform_interface.dart
lib/core/clx_map_poi_search_platform_interface.dart
+1
-6
clx_map_poi_search_method_channel_test.dart
test/clx_map_poi_search_method_channel_test.dart
+1
-1
clx_map_poi_search_test.dart
test/clx_map_poi_search_test.dart
+1
-1
没有找到文件。
lib/clx_map_poi_search.dart
浏览文件 @
fcc475e2
import
'dart:async'
;
import
'package:amap_flutter_base/amap_flutter_base.dart'
;
import
'package:clx_map_poi_search/core/clx_map_poi_search_platform_interface.dart'
;
import
'package:clx_map_poi_search/core/poi_result.dart'
;
import
'clx_map_poi_search_platform_interface.dart'
;
class
ClxMapPoiSearch
{
...
...
@@ -10,26 +10,13 @@ class ClxMapPoiSearch {
ClxMapPoiSearch
.
_
()
{
setupSearch
();
}
setupSearch
()
{
}
// late final StreamController<MapEvent> mapEventStreamController;
setupSearch
()
{
// MethodChannel searchChannel = ClxMapPoiSearchPlatform.instance.getSearchChannel as MethodChannel;
// searchChannel.setMethodCallHandler((call) => _handleMethodCall(call));
// handleMethodCall的`broadcast`
// mapEventStreamController = StreamController<MapEvent>.broadcast();
}
/// init Search
/// init
initPoiSearch
(
AMapApiKey
apiKey
)
{
ClxMapPoiSearchPlatform
.
instance
.
initPoiSearch
(
apiKey
);
}
/// Demo
Future
<
String
?>
getPlatformVersion
()
{
return
ClxMapPoiSearchPlatform
.
instance
.
getPlatformVersion
();
}
/// poi 搜索
Future
<
PoiResult
?>
keywordsSearch
(
String
keyWord
)
{
return
ClxMapPoiSearchPlatform
.
instance
.
keywordsSearch
(
keyWord
);
...
...
@@ -39,19 +26,4 @@ class ClxMapPoiSearch {
Future
<
PoiResult
?>
aroundSearch
(
double
latitude
,
double
longitude
)
{
return
ClxMapPoiSearchPlatform
.
instance
.
aroundSearch
(
latitude
,
longitude
);
}
// 回调函数
// Future<dynamic> _handleMethodCall(MethodCall call) async {
// switch (call.method) {
// case 'camera#searchPOIEvent':
// try {
// mapEventStreamController.add(
// MapSearchPOIEvent(PoiResult.toPoiResult(call.arguments['searchPOIResult'])!),
// );
// } catch (e) {
// print("camera#searchPOIEvent error===>" + e.toString());
// }
// break;
// }
// }
}
lib/clx_map_poi_search_method_channel.dart
→
lib/c
ore/c
lx_map_poi_search_method_channel.dart
浏览文件 @
fcc475e2
import
'package:amap_flutter_base/amap_flutter_base.dart'
;
import
'package:clx_map_poi_search/core/clx_map_poi_search_platform_interface.dart'
;
import
'package:clx_map_poi_search/core/poi_result.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/services.dart'
;
import
'clx_map_poi_search_platform_interface.dart'
;
/// An implementation of [ClxMapPoiSearchPlatform] that uses method channels.
class
MethodChannelClxMapPoiSearch
extends
ClxMapPoiSearchPlatform
{
...
...
@@ -22,12 +22,6 @@ class MethodChannelClxMapPoiSearch extends ClxMapPoiSearchPlatform {
});
}
@override
Future
<
String
?>
getPlatformVersion
()
async
{
final
version
=
await
methodChannel
.
invokeMethod
<
String
>(
'getPlatformVersion'
);
return
version
;
}
// 关键字搜索
@override
Future
<
PoiResult
?>
keywordsSearch
(
String
keywords
)
async
{
...
...
lib/clx_map_poi_search_platform_interface.dart
→
lib/c
ore/c
lx_map_poi_search_platform_interface.dart
浏览文件 @
fcc475e2
import
'package:amap_flutter_base/amap_flutter_base.dart'
;
import
'package:clx_map_poi_search/core/clx_map_poi_search_method_channel.dart'
;
import
'package:clx_map_poi_search/core/poi_result.dart'
;
import
'package:flutter/services.dart'
;
import
'package:plugin_platform_interface/plugin_platform_interface.dart'
;
import
'clx_map_poi_search_method_channel.dart'
;
abstract
class
ClxMapPoiSearchPlatform
extends
PlatformInterface
{
/// Constructs a ClxMapPoiSearchPlatform.
...
...
@@ -38,11 +38,6 @@ abstract class ClxMapPoiSearchPlatform extends PlatformInterface {
throw
UnimplementedError
(
'initPoiSearch() has not been implemented.'
);
}
// 获取平台version
Future
<
String
?>
getPlatformVersion
()
{
throw
UnimplementedError
(
'platformVersion() has not been implemented.'
);
}
// 关键字搜索
Future
<
PoiResult
?>
keywordsSearch
(
String
keywords
)
async
{
throw
UnimplementedError
(
'keywordsSearch() has not been implemented.'
);
...
...
test/clx_map_poi_search_method_channel_test.dart
浏览文件 @
fcc475e2
import
'package:flutter/services.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:clx_map_poi_search/clx_map_poi_search_method_channel.dart'
;
import
'package:clx_map_poi_search/c
ore/c
lx_map_poi_search_method_channel.dart'
;
void
main
(
)
{
MethodChannelClxMapPoiSearch
platform
=
MethodChannelClxMapPoiSearch
();
...
...
test/clx_map_poi_search_test.dart
浏览文件 @
fcc475e2
import
'package:flutter_test/flutter_test.dart'
;
import
'package:clx_map_poi_search/clx_map_poi_search.dart'
;
import
'package:clx_map_poi_search/clx_map_poi_search_platform_interface.dart'
;
import
'package:clx_map_poi_search/clx_map_poi_search_method_channel.dart'
;
import
'package:clx_map_poi_search/c
ore/c
lx_map_poi_search_method_channel.dart'
;
import
'package:plugin_platform_interface/plugin_platform_interface.dart'
;
class
MockClxMapPoiSearchPlatform
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论