Commit c48decfbdd8f69414ff9eed8dad2ec6568731408

Authored by weixin_45529955
1 parent 615a4551

多图上传

Showing 75 changed files with 2450 additions and 2107 deletions

Too many changes to show.

To preserve performance only 75 of 75+ files are displayed.

@@ -83,8 +83,8 @@ android { @@ -83,8 +83,8 @@ android {
83 83
84 ndk { 84 ndk {
85 //选择要添加的对应 cpu 类型的 .so 库。 85 //选择要添加的对应 cpu 类型的 .so 库。
86 - abiFilters 'arm64-v8a', 'x86_64', 'mips64' //魅族64位,不支持32位  
87 - // abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'x86_64','x86', 'mips', 'mips64' 86 + // abiFilters 'arm64-v8a', 'x86_64', 'mips64' //魅族64位,不支持32位
  87 + abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'x86_64','x86', 'mips', 'mips64'
88 } 88 }
89 89
90 lintOptions { 90 lintOptions {
1 -import 'package:csp_amap_flutter_base/csp_amap_flutter_base.dart'; 1 +// import 'package:csp_amap_flutter_base/csp_amap_flutter_base.dart';
2 2
3 -class ConstConfig {  
4 - static const AMapApiKey amapApiKeys = AMapApiKey(  
5 - androidKey: '900f72eeee0f21e435cebb0ef155582a', //测试key  
6 - iosKey: '4dfdec97b7bf0b8c13e94777103015a9', //测试key  
7 - ohosKey: '7c2081e92ec65bfffa2df0a5464f0c7b'); //我的账户下面的ceshikey  
8 - static const AMapPrivacyStatement amapPrivacyStatement =  
9 - AMapPrivacyStatement(hasContains: true, hasShow: true, hasAgree: true);  
10 -} 3 +// class ConstConfig {
  4 +// static const AMapApiKey amapApiKeys = AMapApiKey(
  5 +// androidKey: '900f72eeee0f21e435cebb0ef155582a', //测试key
  6 +// iosKey: '4dfdec97b7bf0b8c13e94777103015a9', //测试key
  7 +// ohosKey: '7c2081e92ec65bfffa2df0a5464f0c7b'); //我的账户下面的ceshikey
  8 +// static const AMapPrivacyStatement amapPrivacyStatement =
  9 +// AMapPrivacyStatement(hasContains: true, hasShow: true, hasAgree: true);
  10 +// }
1 -// import 'dart:async';  
2 -  
3 -// import 'package:amap_map_fluttify/amap_map_fluttify.dart';  
4 -// import 'package:flutter/cupertino.dart';  
5 -  
6 -// import 'package:flutter/material.dart';  
7 -  
8 -// import 'package:flutter_easyrefresh/easy_refresh.dart';  
9 -  
10 -  
11 -// import 'package:one_key/res/colors.dart';  
12 -  
13 -// import 'package:one_key/utils/misc.dart';  
14 -  
15 -// import 'package:one_key/utils/screen_util.dart';  
16 -// import 'package:one_key/utils/utils.dart';  
17 -  
18 -// import 'package:one_key/widgets/system_app_bar.dart';  
19 -// import 'package:permission_handler/permission_handler.dart';  
20 -  
21 -// import '../../utils/common_utils.dart';  
22 -// // import 'package:demo/resources/custom_text_style.dart';  
23 -// // import 'package:demo/utils/misc.dart';  
24 -  
25 -// // import 'package:demo/widgets/network_state/page_loading.dart';  
26 -  
27 -// class MapChoicePointPage extends StatefulWidget {  
28 -// final String? long;  
29 -// final String? lat;  
30 -// MapChoicePointPage({Key? key, this.long, this.lat}) : super(key: key);  
31 -  
32 -// @override  
33 -// _MapChoicePointPageState createState() => _MapChoicePointPageState();  
34 -// }  
35 -  
36 -// class _MapChoicePointPageState extends State<MapChoicePointPage> {  
37 -// AmapController? _controller;  
38 -// List<Poi>? poiList;  
39 -// static List<PoiModel?> list = [];  
40 -// static List<PoiModel> searchlist = [];  
41 -// PoiModel? poiModel;  
42 -// String keyword = "";  
43 -// String? address = "";  
44 -// bool isloading = true;  
45 -  
46 -// double latitude = 39.684670899;  
47 -// double longitude = 118.17630045;  
48 -  
49 -// double latitudeLocation = 39.684670899;  
50 -// double longitudeLocation = 118.17630045;  
51 -  
52 -// List<InputTip> inputTipDatas = [];  
53 -// int page = 1;  
54 -// EasyRefreshController refreshController = EasyRefreshController();  
55 -// bool flag = true;  
56 -  
57 -// @override  
58 -// void initState() {  
59 -// super.initState();  
60 -  
61 -// if (widget.long != null && widget.long != '' && widget.long != 'null') {  
62 -// longitude = double.parse(widget.long!);  
63 -// }  
64 -// if (widget.lat != null && widget.lat != '' && widget.lat != 'null') {  
65 -// latitude = double.parse(widget.lat!);  
66 -// }  
67 -  
68 -// WidgetsBinding.instance.addPostFrameCallback((_) async {  
69 -// _requestLocationPermission();  
70 -  
71 -// // ama  
72 -// // let marker = new AMap.Marker({//添加标记点  
73 -// // position: this.position,  
74 -// // map: map  
75 -// });  
76 -// }  
77 -  
78 -// // Future<bool> checkLocationPermission() async {  
79 -// // PermissionStatus permissionStatus = await Permission.location.status;  
80 -// // if (permissionStatus == PermissionStatus.granted) {  
81 -// // return true;  
82 -// // } else {  
83 -// // return false;  
84 -// // }  
85 -// // }  
86 -  
87 -// /// 检查权限并定  
88 -// // _getLocationPermission() async {  
89 -// // if (!(await checkPermission(Permission.location))) {  
90 -// // //没有定位权限  
91 -  
92 -// // //申请定位权限  
93 -// // _requestLocationPermission();  
94 -// // } else {  
95 -// // //去定位  
96 -// // _requestLocationPermission();  
97 -// // }  
98 -// // }  
99 -  
100 -// /// 获取定位权限  
101 -// _requestLocationPermission() async {  
102 -// await AmapLocation.instance.updatePrivacyShow(true);  
103 -// await AmapLocation.instance.updatePrivacyAgree(true);  
104 -// bool canLocation = false;  
105 -  
106 -// if (!(await checkPermission(Permission.location))) {  
107 -// //没有定位权限  
108 -  
109 -// //申请定位权限  
110 -// canLocation = await requestPermission(Permission.location);  
111 -// } else {  
112 -// canLocation = true;  
113 -// }  
114 -// // bool canLocation = await requestPermission(Permission.location);  
115 -// // 单次定位  
116 -// if (canLocation) {  
117 -// Future.delayed(Duration(milliseconds: 200), () async {  
118 -// await AmapLocation.instance.updatePrivacyShow(true);  
119 -// await AmapLocation.instance.updatePrivacyAgree(true);  
120 -// final location = await AmapLocation.instance.fetchLocation(  
121 -// // needAddress: true,  
122 -// // mode: LocationAccuracy.High,  
123 -// // timeout: Duration(seconds: 10)  
124 -// );  
125 -  
126 -// if (location.city == null || location.city == '') //网络不好,定位失败  
127 -// {  
128 -// // App.sp.setString("lat", "39.684670899");  
129 -// // App.sp.setString("lng", "118.17630045");  
130 -// } else {  
131 -// if (widget.long == null ||  
132 -// widget.long == '' ||  
133 -// widget.long == 'null') {  
134 -// latitude = location.latLng!.latitude;  
135 -// longitude = location.latLng!.longitude;  
136 -// if (_controller != null) {  
137 -// _controller!.setCenterCoordinate(LatLng(  
138 -// location.latLng!.latitude, location.latLng!.longitude));  
139 -// }  
140 -  
141 -// page = 1;  
142 -  
143 -// _loadData(  
144 -// LatLng(location.latLng!.latitude, location.latLng!.longitude));  
145 -  
146 -// setState(() {});  
147 -// }  
148 -// latitudeLocation = location.latLng!.latitude;  
149 -// longitudeLocation = location.latLng!.longitude;  
150 -// }  
151 -// });  
152 -// } else {  
153 -// //无权限  
154 -// }  
155 -// }  
156 -  
157 -// @override  
158 -// Widget build(BuildContext context) {  
159 -// return Scaffold(  
160 -// resizeToAvoidBottomInset: false, //防止底部布局被顶起  
161 -// appBar: SystemAppBar(  
162 -// '选择位置信息',  
163 -// onTap: () {  
164 -// if (Navigator.canPop(context)) {  
165 -// Navigator.pop(context);  
166 -// }  
167 -// },  
168 -// ),  
169 -  
170 -// body: Column(  
171 -// children: <Widget>[  
172 -// // Theme(  
173 -// // data: new  
174 -// // ThemeData(  
175 -// // // primaryColor: MyColours.color_438E93,  
176 -// // // hintColor: MyColours.color_438E93),  
177 -// // child:  
178 -// // Container(  
179 -// // color: MyColours.color_438E93,  
180 -// // decoration: BoxDecoration(  
181 -// // color: MyColours.color_438E93,  
182 -// // boxShadow: [  
183 -// // BoxShadow(color: Colors.white, spreadRadius: 1),  
184 -// // ],  
185 -// // ),  
186 -  
187 -// // padding: EdgeInsets.all(5),  
188 -// // child:  
189 -  
190 -// // ),  
191 -// // ),  
192 -// // ListView.builder(  
193 -// // shrinkWrap: true,  
194 -// // itemCount: inputTipDatas.length,  
195 -// // itemBuilder: (context, index) {  
196 -// // InputTip inputTip = inputTipDatas[index];  
197 -// // return InkWell(  
198 -// // onTap: () {  
199 -// // // searchAroundAddress(inputTip.name ?? '');  
200 -// // // searchPoiId(inputTip.poiId ?? '');  
201 -// // // _loadData(inputTip.coordinate ??  
202 -// // // LatLng(latitude, longitude));  
203 -// // },  
204 -// // child: Container(  
205 -// // child: Row(  
206 -// // children: [  
207 -// // Text(  
208 -// // inputTip.name ?? '',  
209 -// // style: TextStyle(  
210 -// // fontSize: font(15),  
211 -// // color: MyColours.color_515151),  
212 -// // ),  
213 -// // HEmptyView(10),  
214 -// // Expanded(  
215 -// // child: Text(  
216 -// // (inputTip.district ?? '') +  
217 -// // (inputTip.address ?? ''),  
218 -// // style: TextStyle(  
219 -// // fontSize: font(13),  
220 -// // color: MyColours.color_999999),  
221 -// // ),  
222 -// // ),  
223 -// // ],  
224 -// // )));  
225 -// // })  
226 -// // ],  
227 -// // ),  
228 -  
229 -// Stack(  
230 -// children: [  
231 -// Container(  
232 -// height: w(300),  
233 -// child: Stack(  
234 -// children: <Widget>[  
235 -// AmapView(  
236 -// showZoomControl: false,  
237 -  
238 -// /// 是否显示指南针控件  
239 -// showCompass: true,  
240 -  
241 -// /// 是否显示比例尺控件  
242 -// showScaleControl: true,  
243 -  
244 -// /// 是否使能缩放手势  
245 -// zoomGesturesEnabled: true,  
246 -  
247 -// /// 是否使能滚动手势  
248 -// scrollGesturesEnabled: true,  
249 -  
250 -// /// 是否使能旋转手势  
251 -// rotateGestureEnabled: false,  
252 -// centerCoordinate: LatLng(latitude, longitude),  
253 -// maskDelay: Duration(milliseconds: 500),  
254 -// zoomLevel: 19,  
255 -// onMapCreated: (controller) async {  
256 -// _controller = controller;  
257 -// _controller!  
258 -// .setCenterCoordinate(LatLng(latitude, longitude));  
259 -// // if (await requestPermission(PermissionGroup.location)) {  
260 -// // await controller.showMyLocation(true);  
261 -// // await controller?.showLocateControl(true);  
262 -// // final latLng = await _controller?.getLocation(  
263 -// // delay: Duration(seconds: 2));  
264 -// // await enableFluttifyLog(false); // 关闭log  
265 -// // _loadData(latLng);  
266 -// // } else {  
267 -// // //无权限  
268 -// // _showLocPemWidget();  
269 -// // }  
270 -// },  
271 -// // markers: [],  
272 -// onMapMoveEnd: (MapMove move) async {  
273 -// latitude = move.coordinate!.latitude;  
274 -// longitude = move.coordinate!.longitude;  
275 -// page = 1;  
276 -// _loadData(move.coordinate!);  
277 -// },  
278 -// ),  
279 -// Center(  
280 -// child: Icon(  
281 -// Icons.place,  
282 -// size: w(32),  
283 -// color: Color(0xFFFF0000),  
284 -// ),  
285 -// ),  
286 -// Positioned(  
287 -// right: w(10),  
288 -// bottom: w(10),  
289 -// child: InkWell(  
290 -// onTap: () {  
291 -// _controller!.setCenterCoordinate(  
292 -// LatLng(latitudeLocation, longitudeLocation));  
293 -// },  
294 -// child: Container(  
295 -// decoration: BoxDecoration(  
296 -// color: MyColours.color_ffffff,  
297 -// borderRadius: BorderRadius.circular(r(5))),  
298 -// padding: EdgeInsets.all(w(5)),  
299 -// child: Image.asset(  
300 -// Utils.getImgPath('location_map'),  
301 -// width: w(25),  
302 -// ),  
303 -// )),  
304 -// )  
305 -// ],  
306 -// ),  
307 -// ),  
308 -// Positioned(  
309 -// top: w(10),  
310 -// left: w(20),  
311 -// right: w(20),  
312 -// child: Container(  
313 -// // height: w(45),  
314 -// padding: EdgeInsets.symmetric(vertical: w(10)),  
315 -// decoration: BoxDecoration(  
316 -// color: Colors.white,  
317 -// borderRadius: BorderRadius.circular(r(10))),  
318 -// child: TextField(  
319 -// textAlignVertical: TextAlignVertical.center,  
320 -// style: TextStyle(  
321 -// color: MyColours.color_515151,  
322 -// fontSize: font(15),  
323 -// ),  
324 -// controller:  
325 -// TextEditingController.fromValue(TextEditingValue(  
326 -// // 设置内容  
327 -// text: keyword,  
328 -// selection: TextSelection.fromPosition(TextPosition(  
329 -// affinity: TextAffinity.downstream,  
330 -// offset: keyword.length)),  
331 -// // 保持光标在最后  
332 -// )),  
333 -// decoration: InputDecoration(  
334 -// // border: b,  
335 -// // border: OutlineInputBorder(  
336 -// // borderRadius: BorderRadius.all(Radius.circular(40)),  
337 -// // ),  
338 -// border: OutlineInputBorder(borderSide: BorderSide.none),  
339 -// hintText: '输入关键字',  
340 -// isCollapsed: true,  
341 -  
342 -// hintStyle: TextStyle(  
343 -// color: MyColours.color_999999, fontSize: font(15)),  
344 -// // contentPadding: const EdgeInsets.symmetric(  
345 -// // vertical: 8, horizontal: 1),  
346 -// prefixIconConstraints: BoxConstraints(maxWidth: w(40)),  
347 -// prefixIcon: Padding(  
348 -// padding: EdgeInsets.only(left: w(10), right: w(10)),  
349 -// child: SizedBox(  
350 -// width: w(30),  
351 -// child: Image.asset(  
352 -// Utils.getImgPath('search_black'),  
353 -// ))),  
354 -// suffixIconConstraints: BoxConstraints(maxWidth: w(32)),  
355 -// suffixIcon: InkWell(  
356 -// child: Padding(  
357 -// padding: EdgeInsets.only(left: w(10), right: w(10)),  
358 -// child: SizedBox(  
359 -// width: w(22),  
360 -// child: Image.asset(  
361 -// Utils.getImgPath('delete_black'),  
362 -// ))),  
363 -// onTap: () {  
364 -// keyword = "";  
365 -// setState(() {});  
366 -// },  
367 -// ),  
368 -// fillColor: Colors.white,  
369 -// filled: true,  
370 -// ),  
371 -  
372 -// inputFormatters: [],  
373 -// //内容改变的回调  
374 -// onChanged: (text) {  
375 -// print('change $text');  
376 -// keyword = text;  
377 -  
378 -// //搜索  
379 -  
380 -// JhCommonUtils.debounce(  
381 -// () => _fetchInputTips(text.toString()));  
382 -// },  
383 -// //内容提交(按回车)的回调  
384 -// onSubmitted: (text) {  
385 -// print('submit $text');  
386 -// // 触发关闭弹出来的键盘。  
387 -// keyword = text;  
388 -// FocusScope.of(context).requestFocus(FocusNode());  
389 -// setState(() {  
390 -// // isloading = true;  
391 -// });  
392 -  
393 -// // _fetchInputTips(text.toString());  
394 -  
395 -// // searchAroundAddress(text.toString());  
396 -// },  
397 -// //按回车时调用  
398 -// onEditingComplete: () {  
399 -// print('onEditingComplete');  
400 -// },  
401 -// ),  
402 -// ),  
403 -// )  
404 -// ],  
405 -// ),  
406 -  
407 -// Expanded(  
408 -// flex: 1,  
409 -// child: Visibility(  
410 -// visible: !isloading,  
411 -// maintainSize: false,  
412 -// maintainSemantics: false,  
413 -// maintainInteractivity: false,  
414 -// replacement: Center(  
415 -// child: CupertinoActivityIndicator(),  
416 -// ),  
417 -// child: EasyRefresh.custom(  
418 -// controller: refreshController,  
419 -// slivers: [  
420 -// SliverList(  
421 -// delegate: SliverChildBuilderDelegate(  
422 -// (BuildContext context, int position) {  
423 -// print("itemBuilder" + list.length.toString());  
424 -// PoiModel item = list[position]!;  
425 -// return InkWell(  
426 -// child: Column(  
427 -// children: <Widget>[  
428 -// Container(  
429 -// margin: EdgeInsets.only(  
430 -// top: 8, bottom: 5, left: 10),  
431 -// child: Row(  
432 -// children: <Widget>[  
433 -// Icon(  
434 -// Icons.place,  
435 -// size: 20.0,  
436 -// color: position == 0  
437 -// ? Colors.green  
438 -// : Colors.grey,  
439 -// ),  
440 -// Expanded(  
441 -// child: Text(item.title,  
442 -// style: TextStyle(  
443 -// fontSize: 16,  
444 -// color: position == 0  
445 -// ? Colors.green  
446 -// : Color(0xFF787878))))  
447 -// ],  
448 -// ),  
449 -// ),  
450 -// Container(  
451 -// margin: EdgeInsets.only(  
452 -// top: 5, bottom: 5, left: 18),  
453 -// alignment: Alignment.centerLeft,  
454 -// child: Text(  
455 -// item.address!,  
456 -// style: TextStyle(  
457 -// fontSize: 14,  
458 -// color: Color(0xFF646464),  
459 -// ),  
460 -// ),  
461 -// ),  
462 -// Divider(  
463 -// height: 1,  
464 -// )  
465 -// ],  
466 -// ),  
467 -// onTap: () async {  
468 -// // await _controller.setCenterCoordinate(  
469 -// // LatLng(item.latLng.latitude, item.latLng.longitude),  
470 -// // zoomLevel: 16);  
471 -// if (Navigator.canPop(context)) {  
472 -// Navigator.pop(context, {  
473 -// 'address': item.address,  
474 -// 'lat': item.latLng!.latitude.toString(),  
475 -// 'lng': item.latLng!.longitude.toString()  
476 -// });  
477 -// }  
478 -// },  
479 -// );  
480 -// },  
481 -// childCount: list.length,  
482 -// ),  
483 -// )  
484 -// ],  
485 -// onRefresh: () async {  
486 -// if (flag) {  
487 -// page = 1;  
488 -// _loadData(LatLng(latitude, longitude));  
489 -// }  
490 -// },  
491 -// onLoad: () async {  
492 -// if (flag) {  
493 -// page++;  
494 -// _loadData(LatLng(latitude, longitude),  
495 -// showloading: false);  
496 -// }  
497 -// },  
498 -// )),  
499 -// ),  
500 -// ],  
501 -// ),  
502 -// );  
503 -// }  
504 -  
505 -// _fetchInputTips(String text) async {  
506 -// flag = false;  
507 -// page = 1;  
508 -// // setState(() {  
509 -// // isloading = true;  
510 -// // });  
511 -  
512 -// /// 逆地理编码(坐标转地址)  
513 -// ///  
514 -// ///  
515 -// await AmapLocation.instance.updatePrivacyShow(true);  
516 -// await AmapLocation.instance.updatePrivacyAgree(true);  
517 -  
518 -// LatLng latLng = LatLng(latitude, longitude);  
519 -// ReGeocode reGeocodeList = await AmapSearch.instance.searchReGeocode(latLng);  
520 -  
521 -// // print(await reGeocodeList.toFutureString());  
522 -// address = reGeocodeList.formatAddress;  
523 -  
524 -// await AmapLocation.instance.updatePrivacyShow(true);  
525 -// await AmapLocation.instance.updatePrivacyAgree(true);  
526 -// inputTipDatas = await AmapSearch.instance.fetchInputTips(  
527 -// text,  
528 -// city: "",  
529 -// );  
530 -// print(inputTipDatas);  
531 -  
532 -// poiModel = new PoiModel("当前位置", address, latLng);  
533 -// list.clear();  
534 -// list.add(poiModel);  
535 -// for (var inputTip in inputTipDatas) {  
536 -// String? title = await inputTip.name ?? '';  
537 -// String? cityStr =  
538 -// await (inputTip.district ?? '') + (inputTip.address ?? '');  
539 -  
540 -// LatLng? latLng = await inputTip.coordinate;  
541 -  
542 -// list.add(new PoiModel(title.toString(), cityStr, latLng));  
543 -// }  
544 -  
545 -  
546 -// print(list);  
547 -  
548 -// setState(() {  
549 -// // isloading = false;  
550 -// });  
551 -// }  
552 -  
553 -// void _loadData(LatLng latLng, {showloading = true}) async {  
554 -// flag = true;  
555 -// setState(() {  
556 -// if (showloading) {  
557 -// isloading = true;  
558 -// }  
559 -// });  
560 -  
561 -// /// 逆地理编码(坐标转地址)  
562 -// ///  
563 -// ///  
564 -  
565 -// await AmapLocation.instance.updatePrivacyShow(true);  
566 -// await AmapLocation.instance.updatePrivacyAgree(true);  
567 -// if (page == 1) {  
568 -// ReGeocode reGeocodeList = await AmapSearch.instance.searchReGeocode(  
569 -// latLng,  
570 -// );  
571 -// // print(await reGeocodeList.toFutureString());  
572 -// address = reGeocodeList.formatAddress;  
573 -// poiModel = new PoiModel("当前位置", address, latLng);  
574 -// list.clear();  
575 -// list.add(poiModel);  
576 -// }  
577 -// final poiList =  
578 -// await AmapSearch.instance.searchAround(latLng, city: "", page: page);  
579 -  
580 -// for (var poi in poiList) {  
581 -// String? title = await poi.title;  
582 -// String? cityName = await poi.cityName;  
583 -// String? provinceName = await poi.provinceName;  
584 -// String? address = await poi.address;  
585 -// LatLng? latLng = await poi.latLng;  
586 -// String? bussniss = poi.businessArea;  
587 -  
588 -// list.add(new PoiModel(  
589 -// title.toString(),  
590 -// provinceName.toString() +  
591 -// cityName.toString() +  
592 -// address.toString() +  
593 -// bussniss.toString(),  
594 -// latLng));  
595 -// }  
596 -  
597 -// setState(() {  
598 -// if (showloading) {  
599 -// isloading = false;  
600 -// }  
601 -// });  
602 -// }  
603 -  
604 -// // void searchPoiId(String text) async {  
605 -// // await AmapLocation.instance.updatePrivacyShow(true);  
606 -// // await AmapLocation.instance.updatePrivacyAgree(true);  
607 -// // Poi? poi = await AmapSearch.instance.searchPoiId(  
608 -// // text,  
609 -// // );  
610 -// // print(poi);  
611 -// // }  
612 -  
613 -// // void searchAroundAddress(String text) async {  
614 -// // await AmapLocation.instance.updatePrivacyShow(true);  
615 -// // await AmapLocation.instance.updatePrivacyAgree(true);  
616 -// // final poiList = await AmapSearch.instance.searchKeyword(  
617 -// // text,  
618 -// // city: "",  
619 -// // );  
620 -// // // final poiList = await AmapSearch.instance.searchAround(  
621 -// // // LatLng(latitude, longitude),  
622 -// // // city: "",  
623 -// // // radius: 100000000000000  
624 -  
625 -// // // );  
626 -  
627 -// // list.clear();  
628 -// // list.add(poiModel);  
629 -// // for (var poi in poiList) {  
630 -// // String? title = await poi.title;  
631 -// // LatLng? latLng = await poi.latLng;  
632 -// // String? cityName = await poi.cityName;  
633 -// // String? provinceName = await poi.provinceName;  
634 -// // String? address = await poi.address;  
635 -// // list.add(new PoiModel(  
636 -// // title.toString(),  
637 -// // provinceName.toString() + cityName.toString() + address.toString(),  
638 -// // latLng));  
639 -// // }  
640 -// // setState(() {  
641 -// // isloading = false;  
642 -// // FocusScope.of(context).requestFocus(FocusNode());  
643 -// // });  
644 -// // }  
645 -// }  
646 -  
647 -// class PoiModel {  
648 -// LatLng? latLng;  
649 -// String title;  
650 -// String? address;  
651 -  
652 -// PoiModel(this.title, this.address, this.latLng);  
653 -// } 1 +import 'dart:async';
  2 +
  3 +import 'package:amap_map_fluttify/amap_map_fluttify.dart';
  4 +import 'package:flutter/cupertino.dart';
  5 +
  6 +import 'package:flutter/material.dart';
  7 +
  8 +import 'package:flutter_easyrefresh/easy_refresh.dart';
  9 +
  10 +
  11 +import 'package:one_key/res/colors.dart';
  12 +
  13 +import 'package:one_key/utils/misc.dart';
  14 +
  15 +import 'package:one_key/utils/screen_util.dart';
  16 +import 'package:one_key/utils/utils.dart';
  17 +
  18 +import 'package:one_key/widgets/system_app_bar.dart';
  19 +import 'package:permission_handler/permission_handler.dart';
  20 +
  21 +import '../../utils/common_utils.dart';
  22 +// import 'package:demo/resources/custom_text_style.dart';
  23 +// import 'package:demo/utils/misc.dart';
  24 +
  25 +// import 'package:demo/widgets/network_state/page_loading.dart';
  26 +
  27 +class MapChoicePointPage extends StatefulWidget {
  28 + final String? long;
  29 + final String? lat;
  30 + MapChoicePointPage({Key? key, this.long, this.lat}) : super(key: key);
  31 +
  32 + @override
  33 + _MapChoicePointPageState createState() => _MapChoicePointPageState();
  34 +}
  35 +
  36 +class _MapChoicePointPageState extends State<MapChoicePointPage> {
  37 + AmapController? _controller;
  38 + List<Poi>? poiList;
  39 + static List<PoiModel?> list = [];
  40 + static List<PoiModel> searchlist = [];
  41 + PoiModel? poiModel;
  42 + String keyword = "";
  43 + String? address = "";
  44 + bool isloading = true;
  45 +
  46 + double latitude = 39.684670899;
  47 + double longitude = 118.17630045;
  48 +
  49 + double latitudeLocation = 39.684670899;
  50 + double longitudeLocation = 118.17630045;
  51 +
  52 + List<InputTip> inputTipDatas = [];
  53 + int page = 1;
  54 + EasyRefreshController refreshController = EasyRefreshController();
  55 + bool flag = true;
  56 +
  57 + @override
  58 + void initState() {
  59 + super.initState();
  60 +
  61 + if (widget.long != null && widget.long != '' && widget.long != 'null') {
  62 + longitude = double.parse(widget.long!);
  63 + }
  64 + if (widget.lat != null && widget.lat != '' && widget.lat != 'null') {
  65 + latitude = double.parse(widget.lat!);
  66 + }
  67 +
  68 + WidgetsBinding.instance.addPostFrameCallback((_) async {
  69 + _requestLocationPermission();
  70 +
  71 + // ama
  72 + // let marker = new AMap.Marker({//添加标记点
  73 + // position: this.position,
  74 + // map: map
  75 + });
  76 + }
  77 +
  78 + // Future<bool> checkLocationPermission() async {
  79 + // PermissionStatus permissionStatus = await Permission.location.status;
  80 + // if (permissionStatus == PermissionStatus.granted) {
  81 + // return true;
  82 + // } else {
  83 + // return false;
  84 + // }
  85 + // }
  86 +
  87 + /// 检查权限并定
  88 + // _getLocationPermission() async {
  89 + // if (!(await checkPermission(Permission.location))) {
  90 + // //没有定位权限
  91 +
  92 + // //申请定位权限
  93 + // _requestLocationPermission();
  94 + // } else {
  95 + // //去定位
  96 + // _requestLocationPermission();
  97 + // }
  98 + // }
  99 +
  100 + /// 获取定位权限
  101 + _requestLocationPermission() async {
  102 + await AmapLocation.instance.updatePrivacyShow(true);
  103 + await AmapLocation.instance.updatePrivacyAgree(true);
  104 + bool canLocation = false;
  105 +
  106 + if (!(await checkPermission(Permission.location))) {
  107 + //没有定位权限
  108 +
  109 + //申请定位权限
  110 + canLocation = await requestPermission(Permission.location);
  111 + } else {
  112 + canLocation = true;
  113 + }
  114 + // bool canLocation = await requestPermission(Permission.location);
  115 + // 单次定位
  116 + if (canLocation) {
  117 + Future.delayed(Duration(milliseconds: 200), () async {
  118 + await AmapLocation.instance.updatePrivacyShow(true);
  119 + await AmapLocation.instance.updatePrivacyAgree(true);
  120 + final location = await AmapLocation.instance.fetchLocation(
  121 + // needAddress: true,
  122 + // mode: LocationAccuracy.High,
  123 + // timeout: Duration(seconds: 10)
  124 + );
  125 +
  126 + if (location.city == null || location.city == '') //网络不好,定位失败
  127 + {
  128 + // App.sp.setString("lat", "39.684670899");
  129 + // App.sp.setString("lng", "118.17630045");
  130 + } else {
  131 + if (widget.long == null ||
  132 + widget.long == '' ||
  133 + widget.long == 'null') {
  134 + latitude = location.latLng!.latitude;
  135 + longitude = location.latLng!.longitude;
  136 + if (_controller != null) {
  137 + _controller!.setCenterCoordinate(LatLng(
  138 + location.latLng!.latitude, location.latLng!.longitude));
  139 + }
  140 +
  141 + page = 1;
  142 +
  143 + _loadData(
  144 + LatLng(location.latLng!.latitude, location.latLng!.longitude));
  145 +
  146 + setState(() {});
  147 + }
  148 + latitudeLocation = location.latLng!.latitude;
  149 + longitudeLocation = location.latLng!.longitude;
  150 + }
  151 + });
  152 + } else {
  153 + //无权限
  154 + }
  155 + }
  156 +
  157 + @override
  158 + Widget build(BuildContext context) {
  159 + return Scaffold(
  160 + resizeToAvoidBottomInset: false, //防止底部布局被顶起
  161 + appBar: SystemAppBar(
  162 + '选择位置信息',
  163 + onTap: () {
  164 + if (Navigator.canPop(context)) {
  165 + Navigator.pop(context);
  166 + }
  167 + },
  168 + ),
  169 +
  170 + body: Column(
  171 + children: <Widget>[
  172 + // Theme(
  173 + // data: new
  174 + // ThemeData(
  175 + // // primaryColor: MyColours.color_438E93,
  176 + // // hintColor: MyColours.color_438E93),
  177 + // child:
  178 + // Container(
  179 + // color: MyColours.color_438E93,
  180 + // decoration: BoxDecoration(
  181 + // color: MyColours.color_438E93,
  182 + // boxShadow: [
  183 + // BoxShadow(color: Colors.white, spreadRadius: 1),
  184 + // ],
  185 + // ),
  186 +
  187 + // padding: EdgeInsets.all(5),
  188 + // child:
  189 +
  190 + // ),
  191 + // ),
  192 + // ListView.builder(
  193 + // shrinkWrap: true,
  194 + // itemCount: inputTipDatas.length,
  195 + // itemBuilder: (context, index) {
  196 + // InputTip inputTip = inputTipDatas[index];
  197 + // return InkWell(
  198 + // onTap: () {
  199 + // // searchAroundAddress(inputTip.name ?? '');
  200 + // // searchPoiId(inputTip.poiId ?? '');
  201 + // // _loadData(inputTip.coordinate ??
  202 + // // LatLng(latitude, longitude));
  203 + // },
  204 + // child: Container(
  205 + // child: Row(
  206 + // children: [
  207 + // Text(
  208 + // inputTip.name ?? '',
  209 + // style: TextStyle(
  210 + // fontSize: font(15),
  211 + // color: MyColours.color_515151),
  212 + // ),
  213 + // HEmptyView(10),
  214 + // Expanded(
  215 + // child: Text(
  216 + // (inputTip.district ?? '') +
  217 + // (inputTip.address ?? ''),
  218 + // style: TextStyle(
  219 + // fontSize: font(13),
  220 + // color: MyColours.color_999999),
  221 + // ),
  222 + // ),
  223 + // ],
  224 + // )));
  225 + // })
  226 + // ],
  227 + // ),
  228 +
  229 + Stack(
  230 + children: [
  231 + Container(
  232 + height: w(300),
  233 + child: Stack(
  234 + children: <Widget>[
  235 + AmapView(
  236 + showZoomControl: false,
  237 +
  238 + /// 是否显示指南针控件
  239 + showCompass: true,
  240 +
  241 + /// 是否显示比例尺控件
  242 + showScaleControl: true,
  243 +
  244 + /// 是否使能缩放手势
  245 + zoomGesturesEnabled: true,
  246 +
  247 + /// 是否使能滚动手势
  248 + scrollGesturesEnabled: true,
  249 +
  250 + /// 是否使能旋转手势
  251 + rotateGestureEnabled: false,
  252 + centerCoordinate: LatLng(latitude, longitude),
  253 + maskDelay: Duration(milliseconds: 500),
  254 + zoomLevel: 19,
  255 + onMapCreated: (controller) async {
  256 + _controller = controller;
  257 + _controller!
  258 + .setCenterCoordinate(LatLng(latitude, longitude));
  259 + // if (await requestPermission(PermissionGroup.location)) {
  260 + // await controller.showMyLocation(true);
  261 + // await controller?.showLocateControl(true);
  262 + // final latLng = await _controller?.getLocation(
  263 + // delay: Duration(seconds: 2));
  264 + // await enableFluttifyLog(false); // 关闭log
  265 + // _loadData(latLng);
  266 + // } else {
  267 + // //无权限
  268 + // _showLocPemWidget();
  269 + // }
  270 + },
  271 + // markers: [],
  272 + onMapMoveEnd: (MapMove move) async {
  273 + latitude = move.coordinate!.latitude;
  274 + longitude = move.coordinate!.longitude;
  275 + page = 1;
  276 + _loadData(move.coordinate!);
  277 + },
  278 + ),
  279 + Center(
  280 + child: Icon(
  281 + Icons.place,
  282 + size: w(32),
  283 + color: Color(0xFFFF0000),
  284 + ),
  285 + ),
  286 + Positioned(
  287 + right: w(10),
  288 + bottom: w(10),
  289 + child: InkWell(
  290 + onTap: () {
  291 + _controller!.setCenterCoordinate(
  292 + LatLng(latitudeLocation, longitudeLocation));
  293 + },
  294 + child: Container(
  295 + decoration: BoxDecoration(
  296 + color: MyColours.color_ffffff,
  297 + borderRadius: BorderRadius.circular(r(5))),
  298 + padding: EdgeInsets.all(w(5)),
  299 + child: Image.asset(
  300 + Utils.getImgPath('location_map'),
  301 + width: w(25),
  302 + ),
  303 + )),
  304 + )
  305 + ],
  306 + ),
  307 + ),
  308 + Positioned(
  309 + top: w(10),
  310 + left: w(20),
  311 + right: w(20),
  312 + child: Container(
  313 + // height: w(45),
  314 + padding: EdgeInsets.symmetric(vertical: w(10)),
  315 + decoration: BoxDecoration(
  316 + color: Colors.white,
  317 + borderRadius: BorderRadius.circular(r(10))),
  318 + child: TextField(
  319 + textAlignVertical: TextAlignVertical.center,
  320 + style: TextStyle(
  321 + color: MyColours.color_515151,
  322 + fontSize: font(15),
  323 + ),
  324 + controller:
  325 + TextEditingController.fromValue(TextEditingValue(
  326 + // 设置内容
  327 + text: keyword,
  328 + selection: TextSelection.fromPosition(TextPosition(
  329 + affinity: TextAffinity.downstream,
  330 + offset: keyword.length)),
  331 + // 保持光标在最后
  332 + )),
  333 + decoration: InputDecoration(
  334 + // border: b,
  335 + // border: OutlineInputBorder(
  336 + // borderRadius: BorderRadius.all(Radius.circular(40)),
  337 + // ),
  338 + border: OutlineInputBorder(borderSide: BorderSide.none),
  339 + hintText: '输入关键字',
  340 + isCollapsed: true,
  341 +
  342 + hintStyle: TextStyle(
  343 + color: MyColours.color_999999, fontSize: font(15)),
  344 + // contentPadding: const EdgeInsets.symmetric(
  345 + // vertical: 8, horizontal: 1),
  346 + prefixIconConstraints: BoxConstraints(maxWidth: w(40)),
  347 + prefixIcon: Padding(
  348 + padding: EdgeInsets.only(left: w(10), right: w(10)),
  349 + child: SizedBox(
  350 + width: w(30),
  351 + child: Image.asset(
  352 + Utils.getImgPath('search_black'),
  353 + ))),
  354 + suffixIconConstraints: BoxConstraints(maxWidth: w(32)),
  355 + suffixIcon: InkWell(
  356 + child: Padding(
  357 + padding: EdgeInsets.only(left: w(10), right: w(10)),
  358 + child: SizedBox(
  359 + width: w(22),
  360 + child: Image.asset(
  361 + Utils.getImgPath('delete_black'),
  362 + ))),
  363 + onTap: () {
  364 + keyword = "";
  365 + setState(() {});
  366 + },
  367 + ),
  368 + fillColor: Colors.white,
  369 + filled: true,
  370 + ),
  371 +
  372 + inputFormatters: [],
  373 + //内容改变的回调
  374 + onChanged: (text) {
  375 + print('change $text');
  376 + keyword = text;
  377 +
  378 + //搜索
  379 +
  380 + JhCommonUtils.debounce(
  381 + () => _fetchInputTips(text.toString()));
  382 + },
  383 + //内容提交(按回车)的回调
  384 + onSubmitted: (text) {
  385 + print('submit $text');
  386 + // 触发关闭弹出来的键盘。
  387 + keyword = text;
  388 + FocusScope.of(context).requestFocus(FocusNode());
  389 + setState(() {
  390 + // isloading = true;
  391 + });
  392 +
  393 + // _fetchInputTips(text.toString());
  394 +
  395 + // searchAroundAddress(text.toString());
  396 + },
  397 + //按回车时调用
  398 + onEditingComplete: () {
  399 + print('onEditingComplete');
  400 + },
  401 + ),
  402 + ),
  403 + )
  404 + ],
  405 + ),
  406 +
  407 + Expanded(
  408 + flex: 1,
  409 + child: Visibility(
  410 + visible: !isloading,
  411 + maintainSize: false,
  412 + maintainSemantics: false,
  413 + maintainInteractivity: false,
  414 + replacement: Center(
  415 + child: CupertinoActivityIndicator(),
  416 + ),
  417 + child: EasyRefresh.custom(
  418 + controller: refreshController,
  419 + slivers: [
  420 + SliverList(
  421 + delegate: SliverChildBuilderDelegate(
  422 + (BuildContext context, int position) {
  423 + print("itemBuilder" + list.length.toString());
  424 + PoiModel item = list[position]!;
  425 + return InkWell(
  426 + child: Column(
  427 + children: <Widget>[
  428 + Container(
  429 + margin: EdgeInsets.only(
  430 + top: 8, bottom: 5, left: 10),
  431 + child: Row(
  432 + children: <Widget>[
  433 + Icon(
  434 + Icons.place,
  435 + size: 20.0,
  436 + color: position == 0
  437 + ? Colors.green
  438 + : Colors.grey,
  439 + ),
  440 + Expanded(
  441 + child: Text(item.title,
  442 + style: TextStyle(
  443 + fontSize: 16,
  444 + color: position == 0
  445 + ? Colors.green
  446 + : Color(0xFF787878))))
  447 + ],
  448 + ),
  449 + ),
  450 + Container(
  451 + margin: EdgeInsets.only(
  452 + top: 5, bottom: 5, left: 18),
  453 + alignment: Alignment.centerLeft,
  454 + child: Text(
  455 + item.address!,
  456 + style: TextStyle(
  457 + fontSize: 14,
  458 + color: Color(0xFF646464),
  459 + ),
  460 + ),
  461 + ),
  462 + Divider(
  463 + height: 1,
  464 + )
  465 + ],
  466 + ),
  467 + onTap: () async {
  468 + // await _controller.setCenterCoordinate(
  469 + // LatLng(item.latLng.latitude, item.latLng.longitude),
  470 + // zoomLevel: 16);
  471 + if (Navigator.canPop(context)) {
  472 + Navigator.pop(context, {
  473 + 'address': item.address,
  474 + 'lat': item.latLng!.latitude.toString(),
  475 + 'lng': item.latLng!.longitude.toString()
  476 + });
  477 + }
  478 + },
  479 + );
  480 + },
  481 + childCount: list.length,
  482 + ),
  483 + )
  484 + ],
  485 + onRefresh: () async {
  486 + if (flag) {
  487 + page = 1;
  488 + _loadData(LatLng(latitude, longitude));
  489 + }
  490 + },
  491 + onLoad: () async {
  492 + if (flag) {
  493 + page++;
  494 + _loadData(LatLng(latitude, longitude),
  495 + showloading: false);
  496 + }
  497 + },
  498 + )),
  499 + ),
  500 + ],
  501 + ),
  502 + );
  503 + }
  504 +
  505 + _fetchInputTips(String text) async {
  506 + flag = false;
  507 + page = 1;
  508 + // setState(() {
  509 + // isloading = true;
  510 + // });
  511 +
  512 + /// 逆地理编码(坐标转地址)
  513 + ///
  514 + ///
  515 + await AmapLocation.instance.updatePrivacyShow(true);
  516 + await AmapLocation.instance.updatePrivacyAgree(true);
  517 +
  518 + LatLng latLng = LatLng(latitude, longitude);
  519 + ReGeocode reGeocodeList = await AmapSearch.instance.searchReGeocode(latLng);
  520 +
  521 + // print(await reGeocodeList.toFutureString());
  522 + address = reGeocodeList.formatAddress;
  523 +
  524 + await AmapLocation.instance.updatePrivacyShow(true);
  525 + await AmapLocation.instance.updatePrivacyAgree(true);
  526 + inputTipDatas = await AmapSearch.instance.fetchInputTips(
  527 + text,
  528 + city: "",
  529 + );
  530 + print(inputTipDatas);
  531 +
  532 + poiModel = new PoiModel("当前位置", address, latLng);
  533 + list.clear();
  534 + list.add(poiModel);
  535 + for (var inputTip in inputTipDatas) {
  536 + String? title = await inputTip.name ?? '';
  537 + String? cityStr =
  538 + await (inputTip.district ?? '') + (inputTip.address ?? '');
  539 +
  540 + LatLng? latLng = await inputTip.coordinate;
  541 +
  542 + list.add(new PoiModel(title.toString(), cityStr, latLng));
  543 + }
  544 +
  545 +
  546 + print(list);
  547 +
  548 + setState(() {
  549 + // isloading = false;
  550 + });
  551 + }
  552 +
  553 + void _loadData(LatLng latLng, {showloading = true}) async {
  554 + flag = true;
  555 + setState(() {
  556 + if (showloading) {
  557 + isloading = true;
  558 + }
  559 + });
  560 +
  561 + /// 逆地理编码(坐标转地址)
  562 + ///
  563 + ///
  564 +
  565 + await AmapLocation.instance.updatePrivacyShow(true);
  566 + await AmapLocation.instance.updatePrivacyAgree(true);
  567 + if (page == 1) {
  568 + ReGeocode reGeocodeList = await AmapSearch.instance.searchReGeocode(
  569 + latLng,
  570 + );
  571 + // print(await reGeocodeList.toFutureString());
  572 + address = reGeocodeList.formatAddress;
  573 + poiModel = new PoiModel("当前位置", address, latLng);
  574 + list.clear();
  575 + list.add(poiModel);
  576 + }
  577 + final poiList =
  578 + await AmapSearch.instance.searchAround(latLng, city: "", page: page);
  579 +
  580 + for (var poi in poiList) {
  581 + String? title = await poi.title;
  582 + String? cityName = await poi.cityName;
  583 + String? provinceName = await poi.provinceName;
  584 + String? address = await poi.address;
  585 + LatLng? latLng = await poi.latLng;
  586 + String? bussniss = poi.businessArea;
  587 +
  588 + list.add(new PoiModel(
  589 + title.toString(),
  590 + provinceName.toString() +
  591 + cityName.toString() +
  592 + address.toString() +
  593 + bussniss.toString(),
  594 + latLng));
  595 + }
  596 +
  597 + setState(() {
  598 + if (showloading) {
  599 + isloading = false;
  600 + }
  601 + });
  602 + }
  603 +
  604 + // void searchPoiId(String text) async {
  605 + // await AmapLocation.instance.updatePrivacyShow(true);
  606 + // await AmapLocation.instance.updatePrivacyAgree(true);
  607 + // Poi? poi = await AmapSearch.instance.searchPoiId(
  608 + // text,
  609 + // );
  610 + // print(poi);
  611 + // }
  612 +
  613 + // void searchAroundAddress(String text) async {
  614 + // await AmapLocation.instance.updatePrivacyShow(true);
  615 + // await AmapLocation.instance.updatePrivacyAgree(true);
  616 + // final poiList = await AmapSearch.instance.searchKeyword(
  617 + // text,
  618 + // city: "",
  619 + // );
  620 + // // final poiList = await AmapSearch.instance.searchAround(
  621 + // // LatLng(latitude, longitude),
  622 + // // city: "",
  623 + // // radius: 100000000000000
  624 +
  625 + // // );
  626 +
  627 + // list.clear();
  628 + // list.add(poiModel);
  629 + // for (var poi in poiList) {
  630 + // String? title = await poi.title;
  631 + // LatLng? latLng = await poi.latLng;
  632 + // String? cityName = await poi.cityName;
  633 + // String? provinceName = await poi.provinceName;
  634 + // String? address = await poi.address;
  635 + // list.add(new PoiModel(
  636 + // title.toString(),
  637 + // provinceName.toString() + cityName.toString() + address.toString(),
  638 + // latLng));
  639 + // }
  640 + // setState(() {
  641 + // isloading = false;
  642 + // FocusScope.of(context).requestFocus(FocusNode());
  643 + // });
  644 + // }
  645 +}
  646 +
  647 +class PoiModel {
  648 + LatLng? latLng;
  649 + String title;
  650 + String? address;
  651 +
  652 + PoiModel(this.title, this.address, this.latLng);
  653 +}
1 -import 'dart:async';  
2 -// import 'dart:js_interop'; 1 +// import 'dart:async';
  2 +// // import 'dart:js_interop';
3 3
4 -import 'package:flutter/material.dart'; 4 +// import 'package:flutter/material.dart';
5 5
6 -import 'package:csp_amap_flutter_map/csp_amap_flutter_map.dart';  
7 -import 'package:csp_amap_flutter_location/amap_flutter_location.dart';  
8 -import 'package:csp_amap_flutter_location/amap_location_option.dart';  
9 -import 'package:flutter/cupertino.dart'; 6 +// import 'package:csp_amap_flutter_map/csp_amap_flutter_map.dart';
  7 +// import 'package:csp_amap_flutter_location/amap_flutter_location.dart';
  8 +// import 'package:csp_amap_flutter_location/amap_location_option.dart';
  9 +// import 'package:flutter/cupertino.dart';
10 10
11 -// import 'package:flutter/material.dart'; 11 +// // import 'package:flutter/material.dart';
12 12
13 -import 'package:csp_amap_flutter_base/csp_amap_flutter_base.dart'; 13 +// import 'package:csp_amap_flutter_base/csp_amap_flutter_base.dart';
14 14
15 -import 'package:flutter_easyrefresh/easy_refresh.dart';  
16 -  
17 -import 'package:one_key/pages/create_store/const_config.dart';  
18 -import 'package:one_key/pages/create_store/map_inputs_model.dart';  
19 -  
20 -import 'package:one_key/res/colors.dart';  
21 -import 'package:one_key/utils/common_utils.dart';  
22 -  
23 -import 'package:one_key/utils/misc.dart';  
24 -  
25 -import 'package:one_key/utils/screen_util.dart';  
26 -import 'package:one_key/utils/utils.dart';  
27 -  
28 -import 'package:one_key/widgets/system_app_bar.dart';  
29 -import 'package:permission_handler/permission_handler.dart';  
30 -  
31 -// import '../../utils/common_utils.dart';  
32 -// import 'package:demo/resources/custom_text_style.dart';  
33 -// import 'package:demo/utils/misc.dart';  
34 -  
35 -// import 'package:demo/widgets/network_state/page_loading.dart';  
36 -  
37 -class MapChoicePointPage extends StatefulWidget {  
38 - final String? long;  
39 - final String? lat;  
40 - MapChoicePointPage({Key? key, this.long, this.lat}) : super(key: key);  
41 -  
42 - @override  
43 - _MapChoicePointPageState createState() => _MapChoicePointPageState();  
44 -}  
45 -  
46 -class _MapChoicePointPageState extends State<MapChoicePointPage> {  
47 - late AMapController _mapController;  
48 - final double _minZoom = 3;  
49 - final double _maxZoom = 20;  
50 - String? _currentZoom;  
51 - // List<Poi>? poiList;  
52 - static List<PoiModel?> list = [];  
53 - static List<PoiModel> searchlist = [];  
54 - PoiModel? poiModel;  
55 - String keyword = "";  
56 - String? address = "";  
57 - bool isloading = true;  
58 -  
59 - double latitude = 39.684670899;  
60 - double longitude = 118.17630045;  
61 -  
62 - double latitudeLocation = 39.684670899;  
63 - double longitudeLocation = 118.17630045;  
64 -  
65 - List<MapInputsModel> inputTipDatas = [];  
66 - int page = 1;  
67 - EasyRefreshController refreshController = EasyRefreshController();  
68 - bool flag = true;  
69 -  
70 - /// 存储定位结果  
71 - Map<String, Object>? _locationResult;  
72 -  
73 - /// 定位结果监听器  
74 - StreamSubscription<Map<String, Object>>? _locationListener;  
75 -  
76 - /// 地理位置解析结果监听器  
77 - StreamSubscription<Map<String, Object>>? _geocodeSearchListener;  
78 -  
79 - /// 高德定位插件实例  
80 - final AMapFlutterLocation _locationPlugin = new AMapFlutterLocation();  
81 -  
82 - @override  
83 - void initState() {  
84 - super.initState();  
85 -  
86 - if (widget.long != null && widget.long != '' && widget.long != 'null') {  
87 - longitude = double.parse(widget.long!);  
88 - }  
89 - if (widget.lat != null && widget.lat != '' && widget.lat != 'null') {  
90 - latitude = double.parse(widget.lat!);  
91 - }  
92 -  
93 - WidgetsBinding.instance.addPostFrameCallback((_) async {  
94 - AMapInitializer.init(context, apiKey: ConstConfig.amapApiKeys);  
95 - AMapInitializer.updatePrivacyAgree(ConstConfig.amapPrivacyStatement);  
96 -  
97 - AMapFlutterLocation.setApiKey("1dbf56e2e8a4d0e4cdc2df9efd36bc71",  
98 - "dfb64c0463cb53927914364b5c09aba0",  
99 - ohosKey: "7c2081e92ec65bfffa2df0a5464f0c7b");  
100 -  
101 - /// 设置是否已经包含高德隐私政策并弹窗展示显示用户查看,如果未包含或者没有弹窗展示,高德定位SDK将不会工作  
102 - ///  
103 - /// 高德SDK合规使用方案请参考官网地址:https://lbs.amap.com/news/sdkhgsy  
104 - /// <b>必须保证在调用定位功能之前调用, 建议首次启动App时弹出《隐私政策》并取得用户同意</b>  
105 - ///  
106 - /// 高德SDK合规使用方案请参考官网地址:https://lbs.amap.com/news/sdkhgsy  
107 - ///  
108 - /// [hasContains] 隐私声明中是否包含高德隐私政策说明  
109 - ///  
110 - /// [hasShow] 隐私权政策是否弹窗展示告知用户  
111 - AMapFlutterLocation.updatePrivacyShow(true, true);  
112 -  
113 - /// 设置是否已经取得用户同意,如果未取得用户同意,高德定位SDK将不会工作  
114 - ///  
115 - /// 高德SDK合规使用方案请参考官网地址:https://lbs.amap.com/news/sdkhgsy  
116 - ///  
117 - /// <b>必须保证在调用定位功能之前调用, 建议首次启动App时弹出《隐私政策》并取得用户同意</b>  
118 - ///  
119 - /// [hasAgree] 隐私权政策是否已经取得用户同意  
120 - AMapFlutterLocation.updatePrivacyAgree(true);  
121 - _requestLocationPermission();  
122 -  
123 - // ama  
124 - // let marker = new AMap.Marker({//添加标记点  
125 - // position: this.position,  
126 - // map: map  
127 - });  
128 -  
129 - _geocodeSearchListener = _locationPlugin  
130 - .onGeocodeSearchChange()  
131 - .listen((Map<String, Object> result) {  
132 - // setState(() {  
133 -  
134 - if (result.containsKey('errorCode')) {  
135 - Utils.showToast(result['errorInfo'].toString());  
136 - } else {  
137 - _locationResult = result;  
138 -  
139 - print(_locationResult);  
140 - }  
141 - });  
142 -  
143 - /// 注册定位结果监听  
144 - /// 通过监听器接收定位结果并更新UI  
145 - _locationListener = _locationPlugin  
146 - .onLocationChanged()  
147 - .listen((Map<String, Object> result) {  
148 - // setState(() {  
149 -  
150 - if (result.containsKey('errorCode')) {  
151 - Utils.showToast(result['errorInfo'].toString());  
152 - } else {  
153 - _locationResult = result;  
154 -  
155 - print(_locationResult);  
156 -  
157 - if (result['latitude'] == null || result['latitude'] == '') //网络不好,定位失败  
158 - {  
159 - // App.sp.setString("lat", "39.684670899");  
160 - // App.sp.setString("lng", "118.17630045");  
161 - } else {  
162 - if (widget.long == null ||  
163 - widget.long == '' ||  
164 - widget.long == 'null') {  
165 - latitude = double.parse(result['latitude'].toString());  
166 - longitude = double.parse(result['longitude'].toString());  
167 - // if (_mapController != null) {  
168 - _mapController.moveCamera(  
169 - CameraUpdate.newLatLng(LatLng(latitude, longitude)));  
170 -  
171 - // }  
172 - page = 1;  
173 -  
174 - // _loadData(LatLng(latitude, longitude));  
175 -  
176 - // setState(() {});  
177 - }  
178 - latitudeLocation = latitude;  
179 - longitudeLocation = longitude;  
180 - _mapController.moveCamera(  
181 - CameraUpdate.newLatLng(LatLng(latitudeLocation, longitudeLocation)),  
182 - animated: true,  
183 - );  
184 - _loadData(LatLng(latitude, longitude));  
185 - }  
186 - }  
187 - });  
188 - }  
189 -  
190 - @override  
191 - void dispose() {  
192 - super.dispose();  
193 -  
194 - /// 移除定位监听  
195 - /// 防止内存泄漏  
196 - if (null != _locationListener) {  
197 - _locationListener?.cancel();  
198 - }  
199 -  
200 - if (null != _geocodeSearchListener) {  
201 - _geocodeSearchListener?.cancel();  
202 - }  
203 -  
204 - /// 销毁定位  
205 - /// 释放定位资源  
206 - _locationPlugin.destroy();  
207 - }  
208 -  
209 - // Future<bool> checkLocationPermission() async {  
210 - // PermissionStatus permissionStatus = await Permission.location.status;  
211 - // if (permissionStatus == PermissionStatus.granted) {  
212 - // return true;  
213 - // } else {  
214 - // return false;  
215 - // }  
216 - // }  
217 -  
218 - /// 检查权限并定  
219 - // _getLocationPermission() async {  
220 - // if (!(await checkPermission(Permission.location))) {  
221 - // //没有定位权限  
222 -  
223 - // //申请定位权限  
224 - // _requestLocationPermission();  
225 - // } else {  
226 - // //去定位  
227 - // _requestLocationPermission();  
228 - // }  
229 - // }  
230 -  
231 - /// 设置定位参数  
232 - /// 配置定位选项,如精度、频率等  
233 - void _setLocationOption() {  
234 - AMapLocationOption locationOption = new AMapLocationOption();  
235 -  
236 - /// 是否单次定位  
237 - /// false表示连续定位  
238 - locationOption.onceLocation = true;  
239 -  
240 - /// 是否需要返回逆地理信息  
241 - /// true表示需要返回地址信息  
242 - locationOption.needAddress = true;  
243 -  
244 - /// 是否需要返回逆地理编码信息  
245 - locationOption.locatingWithReGeocode = true;  
246 -  
247 - /// 逆地理信息的语言类型  
248 - /// 默认为自动适配当前系统语言  
249 - locationOption.geoLanguage = GeoLanguage.DEFAULT;  
250 -  
251 - /// iOS 14定位精度权限设置  
252 - /// 设置为模糊定位精度  
253 - locationOption.desiredLocationAccuracyAuthorizationMode =  
254 - AMapLocationAccuracyAuthorizationMode.ReduceAccuracy;  
255 -  
256 - /// iOS 14精确定位目的key  
257 - /// 需要与info.plist中配置一致  
258 - locationOption.fullAccuracyPurposeKey = "AMapLocationScene";  
259 -  
260 - /// 设置Android端连续定位的定位间隔  
261 - /// 单位:毫秒  
262 - locationOption.locationInterval = 2000;  
263 -  
264 - /// 设置Android端的定位模式  
265 - /// 可选值:  
266 - /// [AMapLocationMode.Battery_Saving] 低功耗模式  
267 - /// [AMapLocationMode.Device_Sensors] 仅设备模式  
268 - /// [AMapLocationMode.Hight_Accuracy] 高精度模式  
269 - locationOption.locationMode = AMapLocationMode.Hight_Accuracy;  
270 -  
271 - /// 设置iOS端的定位最小更新距离  
272 - /// -1表示不限制距离  
273 - locationOption.distanceFilter = -1;  
274 -  
275 - /// 设置iOS端期望的定位精度  
276 - /// 可选值:  
277 - /// [DesiredAccuracy.Best] 最高精度  
278 - /// [DesiredAccuracy.BestForNavigation] 适用于导航场景的高精度  
279 - /// [DesiredAccuracy.NearestTenMeters] 10米  
280 - /// [DesiredAccuracy.Kilometer] 1000米  
281 - /// [DesiredAccuracy.ThreeKilometers] 3000米  
282 - locationOption.desiredAccuracy = DesiredAccuracy.Best;  
283 -  
284 - /// 设置iOS端是否允许系统暂停定位  
285 - /// false表示不允许系统暂停定位  
286 - locationOption.pausesLocationUpdatesAutomatically = false;  
287 -  
288 - /// 将定位参数设置给定位插件  
289 - _locationPlugin.setLocationOption(locationOption);  
290 - }  
291 -  
292 - /// 获取定位权限  
293 - _requestLocationPermission() async {  
294 - /// [hasShow] 隐私权政策是否弹窗展示告知用户  
295 - AMapFlutterLocation.updatePrivacyShow(true, true);  
296 -  
297 - /// [hasAgree] 隐私权政策是否已经取得用户同意  
298 - AMapFlutterLocation.updatePrivacyAgree(true);  
299 - // await AMapFlutterLocation.instance.updatePrivacyShow(true);  
300 - // await AmapLocation.instance.updatePrivacyAgree(true);  
301 - bool canLocation = false;  
302 -  
303 - if (!(await checkPermission(Permission.location))) {  
304 - //没有定位权限  
305 -  
306 - //申请定位权限  
307 - canLocation = await requestPermission(Permission.location);  
308 - } else {  
309 - canLocation = true;  
310 - }  
311 - // bool canLocation = await requestPermission(Permission.location);  
312 - // 单次定位  
313 - if (canLocation) {  
314 - Future.delayed(Duration(milliseconds: 200), () async {  
315 - /// [hasShow] 隐私权政策是否弹窗展示告知用户  
316 - AMapFlutterLocation.updatePrivacyShow(true, true);  
317 -  
318 - /// [hasAgree] 隐私权政策是否已经取得用户同意  
319 - AMapFlutterLocation.updatePrivacyAgree(true);  
320 - _startLocation();  
321 - // final location = await AmapLocation.instance.fetchLocation(  
322 - // // needAddress: true,  
323 - // // mode: LocationAccuracy.High,  
324 - // // timeout: Duration(seconds: 10)  
325 - // );  
326 -  
327 - // if (location.city == null || location.city == '') //网络不好,定位失败  
328 - // {  
329 - // // App.sp.setString("lat", "39.684670899");  
330 - // // App.sp.setString("lng", "118.17630045");  
331 - // } else {  
332 - // if (widget.long == null ||  
333 - // widget.long == '' ||  
334 - // widget.long == 'null') {  
335 - // latitude = location.latLng!.latitude;  
336 - // longitude = location.latLng!.longitude;  
337 - // if (_controller != null) {  
338 - // _controller!.setCenterCoordinate(LatLng(  
339 - // location.latLng!.latitude, location.latLng!.longitude));  
340 - // }  
341 -  
342 - // page = 1;  
343 -  
344 - // _loadData(  
345 - // LatLng(location.latLng!.latitude, location.latLng!.longitude));  
346 -  
347 - // setState(() {});  
348 - // }  
349 - // latitudeLocation = location.latLng!.latitude;  
350 - // longitudeLocation = location.latLng!.longitude;  
351 - // }  
352 - });  
353 - } else {  
354 - //无权限  
355 - }  
356 - }  
357 -  
358 - // 开始定位  
359 - /// 设置定位参数并启动定位  
360 - void _startLocation() {  
361 - /// 开始定位之前设置定位参数  
362 - _setLocationOption();  
363 - _locationPlugin.startLocation();  
364 - }  
365 -  
366 - /// 停止定位  
367 - /// 停止定位服务  
368 - void _stopLocation() {  
369 - _locationPlugin.stopLocation();  
370 - }  
371 -  
372 - void onMapCreated(AMapController controller) {  
373 - // setState(() {  
374 - _mapController = controller;  
375 - // _mapController.moveCamera(  
376 - // CameraUpdate.newLatLng(LatLng(latitudeLocation, longitudeLocation)),  
377 - // animated: true,  
378 - // );  
379 - // getApprovalNumber();  
380 - // });  
381 - }  
382 -  
383 - /// 获取审图号  
384 - // void getApprovalNumber() async {  
385 - // //普通地图审图号  
386 - // String mapContentApprovalNumber =  
387 - // (await _mapController.getMapContentApprovalNumber());  
388 - // //卫星地图审图号  
389 - // String satelliteImageApprovalNumber =  
390 - // (await _mapController.getSatelliteImageApprovalNumber());  
391 -  
392 - // print('地图审图号(普通地图): $mapContentApprovalNumber');  
393 - // print('地图审图号(卫星地图): $satelliteImageApprovalNumber');  
394 - // }  
395 -  
396 - //移动视野  
397 - // void _onCameraMove(CameraPosition cameraPosition) {  
398 - // latitude = cameraPosition.target.latitude;  
399 - // longitude = cameraPosition.target.longitude;  
400 - // page = 1;  
401 - // _loadData(cameraPosition.target);  
402 - // }  
403 -  
404 - //移动地图结束  
405 - void _onCameraMoveEnd(CameraPosition cameraPosition) {  
406 - setState(() {  
407 - _currentZoom = '当前缩放级别:${cameraPosition.zoom}';  
408 - });  
409 -  
410 - _mapController.moveCamera(  
411 - CameraUpdate.zoomTo(cameraPosition.zoom),  
412 - animated: true,  
413 - );  
414 - latitude = cameraPosition.target.latitude;  
415 - longitude = cameraPosition.target.longitude;  
416 - page = 1;  
417 - _loadData(cameraPosition.target);  
418 - }  
419 -  
420 - @override  
421 - Widget build(BuildContext context) {  
422 - final AMapWidget amap = AMapWidget(  
423 - initialCameraPosition:  
424 - CameraPosition(target: LatLng(latitude, longitude), zoom: 16),  
425 - onMapCreated: onMapCreated,  
426 - // onCameraMove: _onCameraMove,  
427 - onCameraMoveEnd: _onCameraMoveEnd,  
428 - minMaxZoomPreference: MinMaxZoomPreference(_minZoom, _maxZoom),  
429 - scaleEnabled: true,  
430 - );  
431 -  
432 - return Scaffold(  
433 - resizeToAvoidBottomInset: false, //防止底部布局被顶起  
434 - appBar: SystemAppBar(  
435 - '选择位置信息',  
436 - onTap: () {  
437 - if (Navigator.canPop(context)) {  
438 - Navigator.pop(context);  
439 - }  
440 - },  
441 - ),  
442 -  
443 - body: Column(  
444 - children: <Widget>[  
445 - // Theme(  
446 - // data: new  
447 - // ThemeData(  
448 - // // primaryColor: MyColours.color_438E93,  
449 - // // hintColor: MyColours.color_438E93),  
450 - // child:  
451 - // Container(  
452 - // color: MyColours.color_438E93,  
453 - // decoration: BoxDecoration(  
454 - // color: MyColours.color_438E93,  
455 - // boxShadow: [  
456 - // BoxShadow(color: Colors.white, spreadRadius: 1),  
457 - // ],  
458 - // ),  
459 -  
460 - // padding: EdgeInsets.all(5),  
461 - // child:  
462 -  
463 - // ),  
464 - // ),  
465 - // ListView.builder(  
466 - // shrinkWrap: true,  
467 - // itemCount: inputTipDatas.length,  
468 - // itemBuilder: (context, index) {  
469 - // InputTip inputTip = inputTipDatas[index];  
470 - // return InkWell(  
471 - // onTap: () {  
472 - // // searchAroundAddress(inputTip.name ?? '');  
473 - // // searchPoiId(inputTip.poiId ?? '');  
474 - // // _loadData(inputTip.coordinate ??  
475 - // // LatLng(latitude, longitude));  
476 - // },  
477 - // child: Container(  
478 - // child: Row(  
479 - // children: [  
480 - // Text(  
481 - // inputTip.name ?? '',  
482 - // style: TextStyle(  
483 - // fontSize: font(15),  
484 - // color: MyColours.color_515151),  
485 - // ),  
486 - // HEmptyView(10),  
487 - // Expanded(  
488 - // child: Text(  
489 - // (inputTip.district ?? '') +  
490 - // (inputTip.address ?? ''),  
491 - // style: TextStyle(  
492 - // fontSize: font(13),  
493 - // color: MyColours.color_999999),  
494 - // ),  
495 - // ),  
496 - // ],  
497 - // )));  
498 - // })  
499 - // ],  
500 - // ),  
501 -  
502 - Stack(  
503 - children: [  
504 - Container(  
505 - height: w(300),  
506 - child: Stack(  
507 - children: <Widget>[  
508 - amap,  
509 - // AmapView(  
510 - // showZoomControl: false,  
511 -  
512 - // /// 是否显示指南针控件  
513 - // showCompass: true,  
514 -  
515 - // /// 是否显示比例尺控件  
516 - // showScaleControl: true,  
517 -  
518 - // /// 是否使能缩放手势  
519 - // zoomGesturesEnabled: true,  
520 -  
521 - // /// 是否使能滚动手势  
522 - // scrollGesturesEnabled: true,  
523 -  
524 - // /// 是否使能旋转手势  
525 - // rotateGestureEnabled: false,  
526 - // centerCoordinate: LatLng(latitude, longitude),  
527 - // maskDelay: Duration(milliseconds: 500),  
528 - // zoomLevel: 19,  
529 - // onMapCreated: (controller) async {  
530 - // _controller = controller;  
531 - // _controller!  
532 - // .setCenterCoordinate(LatLng(latitude, longitude));  
533 - // // if (await requestPermission(PermissionGroup.location)) {  
534 - // // await controller.showMyLocation(true);  
535 - // // await controller?.showLocateControl(true);  
536 - // // final latLng = await _controller?.getLocation(  
537 - // // delay: Duration(seconds: 2));  
538 - // // await enableFluttifyLog(false); // 关闭log  
539 - // // _loadData(latLng);  
540 - // // } else {  
541 - // // //无权限  
542 - // // _showLocPemWidget();  
543 - // // }  
544 - // },  
545 - // // markers: [],  
546 - // onMapMoveEnd: (MapMove move) async {  
547 - // latitude = move.coordinate!.latitude;  
548 - // longitude = move.coordinate!.longitude;  
549 - // page = 1;  
550 - // _loadData(move.coordinate!);  
551 - // },  
552 - // ),  
553 - Center(  
554 - child: Icon(  
555 - Icons.place,  
556 - size: w(32),  
557 - color: Color(0xFFFF0000),  
558 - ),  
559 - ),  
560 - Positioned(  
561 - right: w(10),  
562 - bottom: w(10),  
563 - child: InkWell(  
564 - onTap: () {  
565 - _mapController.moveCamera(  
566 - CameraUpdate.newLatLng(  
567 - LatLng(latitudeLocation, longitudeLocation)),  
568 - animated: true,  
569 - );  
570 - },  
571 - child: Container(  
572 - decoration: BoxDecoration(  
573 - color: MyColours.color_ffffff,  
574 - borderRadius: BorderRadius.circular(r(5))),  
575 - padding: EdgeInsets.all(w(5)),  
576 - child: Image.asset(  
577 - Utils.getImgPath('location_map'),  
578 - width: w(25),  
579 - ),  
580 - )),  
581 - )  
582 - ],  
583 - ),  
584 - ),  
585 - Positioned(  
586 - top: w(10),  
587 - left: w(20),  
588 - right: w(20),  
589 - child: Container(  
590 - // height: w(45),  
591 - padding: EdgeInsets.symmetric(vertical: w(10)),  
592 - decoration: BoxDecoration(  
593 - color: Colors.white,  
594 - borderRadius: BorderRadius.circular(r(10))),  
595 - child: TextField(  
596 - textAlignVertical: TextAlignVertical.center,  
597 - style: TextStyle(  
598 - color: MyColours.color_515151,  
599 - fontSize: font(15),  
600 - ),  
601 - controller:  
602 - TextEditingController.fromValue(TextEditingValue(  
603 - // 设置内容  
604 - text: keyword,  
605 - selection: TextSelection.fromPosition(TextPosition(  
606 - affinity: TextAffinity.downstream,  
607 - offset: keyword.length)),  
608 - // 保持光标在最后  
609 - )),  
610 - decoration: InputDecoration(  
611 - // border: b,  
612 - // border: OutlineInputBorder(  
613 - // borderRadius: BorderRadius.all(Radius.circular(40)),  
614 - // ),  
615 - border: OutlineInputBorder(borderSide: BorderSide.none),  
616 - hintText: '输入关键字',  
617 - isCollapsed: true,  
618 -  
619 - hintStyle: TextStyle(  
620 - color: MyColours.color_999999, fontSize: font(15)),  
621 - // contentPadding: const EdgeInsets.symmetric(  
622 - // vertical: 8, horizontal: 1),  
623 - prefixIconConstraints: BoxConstraints(maxWidth: w(40)),  
624 - prefixIcon: Padding(  
625 - padding: EdgeInsets.only(left: w(10), right: w(10)),  
626 - child: SizedBox(  
627 - width: w(30),  
628 - child: Image.asset(  
629 - Utils.getImgPath('search_black'),  
630 - ))),  
631 - suffixIconConstraints: BoxConstraints(maxWidth: w(32)),  
632 - suffixIcon: InkWell(  
633 - child: Padding(  
634 - padding: EdgeInsets.only(left: w(10), right: w(10)),  
635 - child: SizedBox(  
636 - width: w(22),  
637 - child: Image.asset(  
638 - Utils.getImgPath('delete_black'),  
639 - ))),  
640 - onTap: () {  
641 - keyword = "";  
642 - setState(() {});  
643 - },  
644 - ),  
645 - fillColor: Colors.white,  
646 - filled: true,  
647 - ),  
648 -  
649 - inputFormatters: [],  
650 - //内容改变的回调  
651 - onChanged: (text) {  
652 - print('change $text');  
653 - keyword = text;  
654 -  
655 - //搜索  
656 -  
657 - if (text != null && text.trim().length > 0) {  
658 - JhCommonUtils.debounce(  
659 - () => _fetchInputTips(text.toString()));  
660 - }  
661 - },  
662 - //内容提交(按回车)的回调  
663 - onSubmitted: (text) {  
664 - print('submit $text');  
665 - // 触发关闭弹出来的键盘。  
666 - keyword = text;  
667 - FocusScope.of(context).requestFocus(FocusNode());  
668 - setState(() {  
669 - // isloading = true;  
670 - });  
671 -  
672 - // _fetchInputTips(text.toString());  
673 -  
674 - // searchAroundAddress(text.toString());  
675 - },  
676 - //按回车时调用  
677 - onEditingComplete: () {  
678 - print('onEditingComplete');  
679 - },  
680 - ),  
681 - ),  
682 - )  
683 - ],  
684 - ),  
685 -  
686 - Expanded(  
687 - flex: 1,  
688 - child: Visibility(  
689 - visible: !isloading,  
690 - maintainSize: false,  
691 - maintainSemantics: false,  
692 - maintainInteractivity: false,  
693 - replacement: Center(  
694 - child: CupertinoActivityIndicator(),  
695 - ),  
696 - child: EasyRefresh.custom(  
697 - controller: refreshController,  
698 - slivers: [  
699 - SliverList(  
700 - delegate: SliverChildBuilderDelegate(  
701 - (BuildContext context, int position) {  
702 - print("itemBuilder" + list.length.toString());  
703 - PoiModel item = list[position]!;  
704 - return InkWell(  
705 - child: Column(  
706 - children: <Widget>[  
707 - Container(  
708 - margin: EdgeInsets.only(  
709 - top: 8, bottom: 5, left: 10),  
710 - child: Row(  
711 - children: <Widget>[  
712 - Icon(  
713 - Icons.place,  
714 - size: 20.0,  
715 - color: position == 0  
716 - ? Colors.green  
717 - : Colors.grey,  
718 - ),  
719 - Expanded(  
720 - child: Text(item.title,  
721 - style: TextStyle(  
722 - fontSize: 16,  
723 - color: position == 0  
724 - ? Colors.green  
725 - : Color(0xFF787878))))  
726 - ],  
727 - ),  
728 - ),  
729 - Container(  
730 - margin: EdgeInsets.only(  
731 - top: 5, bottom: 5, left: 18),  
732 - alignment: Alignment.centerLeft,  
733 - child: Text(  
734 - item.address!,  
735 - style: TextStyle(  
736 - fontSize: 14,  
737 - color: Color(0xFF646464),  
738 - ),  
739 - ),  
740 - ),  
741 - Divider(  
742 - height: 1,  
743 - )  
744 - ],  
745 - ),  
746 - onTap: () async {  
747 - // await _controller.setCenterCoordinate(  
748 - // LatLng(item.latLng.latitude, item.latLng.longitude),  
749 - // zoomLevel: 16);  
750 - if (Navigator.canPop(context)) {  
751 - Navigator.pop(context, {  
752 - 'address': item.address,  
753 - 'lat': item.latLng!.latitude.toString(),  
754 - 'lng': item.latLng!.longitude.toString()  
755 - });  
756 - }  
757 - },  
758 - );  
759 - },  
760 - childCount: list.length,  
761 - ),  
762 - )  
763 - ],  
764 - onRefresh: () async {  
765 - if (flag) {  
766 - page = 1;  
767 - _loadData(LatLng(latitude, longitude));  
768 - }  
769 - },  
770 - onLoad: () async {  
771 - if (flag) {  
772 - page++;  
773 - _loadData(LatLng(latitude, longitude),  
774 - showloading: false);  
775 - }  
776 - },  
777 - )),  
778 - ),  
779 - ],  
780 - ),  
781 - );  
782 - }  
783 -  
784 - _fetchInputTips(String text) async {  
785 - flag = false;  
786 - page = 1;  
787 - // setState(() {  
788 - // isloading = true;  
789 - // });  
790 -  
791 - /// 逆地理编码(坐标转地址)  
792 - ///  
793 - ///  
794 - // await AmapLocation.instance.updatePrivacyShow(true);  
795 - // await AmapLocation.instance.updatePrivacyAgree(true);  
796 -  
797 - LatLng latLng = LatLng(latitude, longitude);  
798 -  
799 - address = await _locationPlugin  
800 - .onGeocodeSearch(true, [latLng.longitude, latLng.latitude]);  
801 -  
802 - // await AmapLocation.instance.updatePrivacyShow(true);  
803 - // await AmapLocation.instance.updatePrivacyAgree(true);  
804 -  
805 - List<dynamic> temp = await _locationPlugin.doInputtipsRequest(  
806 - text,  
807 - city: "",  
808 - );  
809 -  
810 - inputTipDatas = [];  
811 -  
812 - temp.forEach((element) {  
813 - inputTipDatas.add(MapInputsModel.fromJson(element));  
814 - });  
815 -  
816 - print(inputTipDatas);  
817 - poiModel = new PoiModel("当前位置", address, latLng);  
818 - list.clear();  
819 - list.add(poiModel);  
820 - for (var inputTip in inputTipDatas) {  
821 - String? title = await inputTip.name ?? '';  
822 - String? cityStr = (inputTip.district ?? '') + (inputTip.city ?? '');  
823 -  
824 - // LatLng? latLng = await inputTip.point;  
825 -  
826 - list.add(new PoiModel(title.toString(), cityStr, latLng));  
827 - }  
828 -  
829 - print(list);  
830 -  
831 - setState(() {  
832 - // isloading = false;  
833 - });  
834 - }  
835 -  
836 - void _loadData(LatLng latLng, {showloading = true}) async {  
837 - flag = true;  
838 - setState(() {  
839 - if (showloading) {  
840 - isloading = true;  
841 - }  
842 - });  
843 -  
844 - /// 逆地理编码(坐标转地址)  
845 - ///  
846 - ///  
847 - ///  
848 -  
849 - // await AmapLocation.instance.updatePrivacyShow(true);  
850 - // await AmapLocation.instance.updatePrivacyAgree(true);  
851 - if (page == 1) {  
852 - address = await _locationPlugin  
853 - .onGeocodeSearch(true, [latLng.longitude, latLng.latitude]);  
854 - poiModel = new PoiModel("当前位置", address, latLng);  
855 - list.clear();  
856 - list.add(poiModel);  
857 - }  
858 - // final poiList  
859 - List<dynamic> temp = await _locationPlugin.poiSearchAround(  
860 - keyword, latLng.longitude, latLng.latitude);  
861 -  
862 - List<MapRoundSearchModel> searchData = [];  
863 -  
864 - temp.forEach((element) {  
865 - searchData.add(MapRoundSearchModel.fromJson(element));  
866 - });  
867 -  
868 - print(searchData);  
869 -  
870 - for (var poi in searchData) {  
871 - String? title = await poi.title;  
872 - String? cityName = await poi.cityName;  
873 - String? provinceName = await poi.provinceName;  
874 - String? snippet = await poi.snippet;  
875 - String? adName = await poi.adName;  
876 - LatLng? latLng = LatLng(poi.latitude ?? 0, poi.longitude ?? 0);  
877 - String? bussniss = poi.businessArea;  
878 -  
879 - list.add(new PoiModel(  
880 - title.toString(),  
881 - provinceName.toString() +  
882 - cityName.toString() +  
883 - adName.toString() +  
884 - // address.toString() +  
885 - bussniss.toString() +  
886 - snippet.toString(),  
887 - latLng));  
888 - }  
889 -  
890 - setState(() {  
891 - if (showloading) {  
892 - isloading = false;  
893 - }  
894 - });  
895 - }  
896 -  
897 - // void searchPoiId(String text) async {  
898 - // await AmapLocation.instance.updatePrivacyShow(true);  
899 - // await AmapLocation.instance.updatePrivacyAgree(true);  
900 - // Poi? poi = await AmapSearch.instance.searchPoiId(  
901 - // text,  
902 - // );  
903 - // print(poi);  
904 - // }  
905 -  
906 - // void searchAroundAddress(String text) async {  
907 - // await AmapLocation.instance.updatePrivacyShow(true);  
908 - // await AmapLocation.instance.updatePrivacyAgree(true);  
909 - // final poiList = await AmapSearch.instance.searchKeyword(  
910 - // text,  
911 - // city: "",  
912 - // );  
913 - // // final poiList = await AmapSearch.instance.searchAround(  
914 - // // LatLng(latitude, longitude),  
915 - // // city: "",  
916 - // // radius: 100000000000000  
917 -  
918 - // // );  
919 -  
920 - // list.clear();  
921 - // list.add(poiModel);  
922 - // for (var poi in poiList) {  
923 - // String? title = await poi.title;  
924 - // LatLng? latLng = await poi.latLng;  
925 - // String? cityName = await poi.cityName;  
926 - // String? provinceName = await poi.provinceName;  
927 - // String? address = await poi.address;  
928 - // list.add(new PoiModel(  
929 - // title.toString(),  
930 - // provinceName.toString() + cityName.toString() + address.toString(),  
931 - // latLng));  
932 - // }  
933 - // setState(() {  
934 - // isloading = false;  
935 - // FocusScope.of(context).requestFocus(FocusNode());  
936 - // });  
937 - // }  
938 -}  
939 -  
940 -class PoiModel {  
941 - LatLng? latLng;  
942 - String title;  
943 - String? address;  
944 -  
945 - PoiModel(this.title, this.address, this.latLng);  
946 -} 15 +// import 'package:flutter_easyrefresh/easy_refresh.dart';
  16 +
  17 +// import 'package:one_key/pages/create_store/const_config.dart';
  18 +// import 'package:one_key/pages/create_store/map_inputs_model.dart';
  19 +
  20 +// import 'package:one_key/res/colors.dart';
  21 +// import 'package:one_key/utils/common_utils.dart';
  22 +
  23 +// import 'package:one_key/utils/misc.dart';
  24 +
  25 +// import 'package:one_key/utils/screen_util.dart';
  26 +// import 'package:one_key/utils/utils.dart';
  27 +
  28 +// import 'package:one_key/widgets/system_app_bar.dart';
  29 +// import 'package:permission_handler/permission_handler.dart';
  30 +
  31 +// // import '../../utils/common_utils.dart';
  32 +// // import 'package:demo/resources/custom_text_style.dart';
  33 +// // import 'package:demo/utils/misc.dart';
  34 +
  35 +// // import 'package:demo/widgets/network_state/page_loading.dart';
  36 +
  37 +// class MapChoicePointPage extends StatefulWidget {
  38 +// final String? long;
  39 +// final String? lat;
  40 +// MapChoicePointPage({Key? key, this.long, this.lat}) : super(key: key);
  41 +
  42 +// @override
  43 +// _MapChoicePointPageState createState() => _MapChoicePointPageState();
  44 +// }
  45 +
  46 +// class _MapChoicePointPageState extends State<MapChoicePointPage> {
  47 +// late AMapController _mapController;
  48 +// final double _minZoom = 3;
  49 +// final double _maxZoom = 20;
  50 +// String? _currentZoom;
  51 +// // List<Poi>? poiList;
  52 +// static List<PoiModel?> list = [];
  53 +// static List<PoiModel> searchlist = [];
  54 +// PoiModel? poiModel;
  55 +// String keyword = "";
  56 +// String? address = "";
  57 +// bool isloading = true;
  58 +
  59 +// double latitude = 39.684670899;
  60 +// double longitude = 118.17630045;
  61 +
  62 +// double latitudeLocation = 39.684670899;
  63 +// double longitudeLocation = 118.17630045;
  64 +
  65 +// List<MapInputsModel> inputTipDatas = [];
  66 +// int page = 1;
  67 +// EasyRefreshController refreshController = EasyRefreshController();
  68 +// bool flag = true;
  69 +
  70 +// /// 存储定位结果
  71 +// Map<String, Object>? _locationResult;
  72 +
  73 +// /// 定位结果监听器
  74 +// StreamSubscription<Map<String, Object>>? _locationListener;
  75 +
  76 +// /// 地理位置解析结果监听器
  77 +// StreamSubscription<Map<String, Object>>? _geocodeSearchListener;
  78 +
  79 +// /// 高德定位插件实例
  80 +// final AMapFlutterLocation _locationPlugin = new AMapFlutterLocation();
  81 +
  82 +// @override
  83 +// void initState() {
  84 +// super.initState();
  85 +
  86 +// if (widget.long != null && widget.long != '' && widget.long != 'null') {
  87 +// longitude = double.parse(widget.long!);
  88 +// }
  89 +// if (widget.lat != null && widget.lat != '' && widget.lat != 'null') {
  90 +// latitude = double.parse(widget.lat!);
  91 +// }
  92 +
  93 +// WidgetsBinding.instance.addPostFrameCallback((_) async {
  94 +// AMapInitializer.init(context, apiKey: ConstConfig.amapApiKeys);
  95 +// AMapInitializer.updatePrivacyAgree(ConstConfig.amapPrivacyStatement);
  96 +
  97 +// AMapFlutterLocation.setApiKey("1dbf56e2e8a4d0e4cdc2df9efd36bc71",
  98 +// "dfb64c0463cb53927914364b5c09aba0",
  99 +// ohosKey: "7c2081e92ec65bfffa2df0a5464f0c7b");
  100 +
  101 +// /// 设置是否已经包含高德隐私政策并弹窗展示显示用户查看,如果未包含或者没有弹窗展示,高德定位SDK将不会工作
  102 +// ///
  103 +// /// 高德SDK合规使用方案请参考官网地址:https://lbs.amap.com/news/sdkhgsy
  104 +// /// <b>必须保证在调用定位功能之前调用, 建议首次启动App时弹出《隐私政策》并取得用户同意</b>
  105 +// ///
  106 +// /// 高德SDK合规使用方案请参考官网地址:https://lbs.amap.com/news/sdkhgsy
  107 +// ///
  108 +// /// [hasContains] 隐私声明中是否包含高德隐私政策说明
  109 +// ///
  110 +// /// [hasShow] 隐私权政策是否弹窗展示告知用户
  111 +// AMapFlutterLocation.updatePrivacyShow(true, true);
  112 +
  113 +// /// 设置是否已经取得用户同意,如果未取得用户同意,高德定位SDK将不会工作
  114 +// ///
  115 +// /// 高德SDK合规使用方案请参考官网地址:https://lbs.amap.com/news/sdkhgsy
  116 +// ///
  117 +// /// <b>必须保证在调用定位功能之前调用, 建议首次启动App时弹出《隐私政策》并取得用户同意</b>
  118 +// ///
  119 +// /// [hasAgree] 隐私权政策是否已经取得用户同意
  120 +// AMapFlutterLocation.updatePrivacyAgree(true);
  121 +// _requestLocationPermission();
  122 +
  123 +// // ama
  124 +// // let marker = new AMap.Marker({//添加标记点
  125 +// // position: this.position,
  126 +// // map: map
  127 +// });
  128 +
  129 +// _geocodeSearchListener = _locationPlugin
  130 +// .onGeocodeSearchChange()
  131 +// .listen((Map<String, Object> result) {
  132 +// // setState(() {
  133 +
  134 +// if (result.containsKey('errorCode')) {
  135 +// Utils.showToast(result['errorInfo'].toString());
  136 +// } else {
  137 +// _locationResult = result;
  138 +
  139 +// print(_locationResult);
  140 +// }
  141 +// });
  142 +
  143 +// /// 注册定位结果监听
  144 +// /// 通过监听器接收定位结果并更新UI
  145 +// _locationListener = _locationPlugin
  146 +// .onLocationChanged()
  147 +// .listen((Map<String, Object> result) {
  148 +// // setState(() {
  149 +
  150 +// if (result.containsKey('errorCode')) {
  151 +// Utils.showToast(result['errorInfo'].toString());
  152 +// } else {
  153 +// _locationResult = result;
  154 +
  155 +// print(_locationResult);
  156 +
  157 +// if (result['latitude'] == null || result['latitude'] == '') //网络不好,定位失败
  158 +// {
  159 +// // App.sp.setString("lat", "39.684670899");
  160 +// // App.sp.setString("lng", "118.17630045");
  161 +// } else {
  162 +// if (widget.long == null ||
  163 +// widget.long == '' ||
  164 +// widget.long == 'null') {
  165 +// latitude = double.parse(result['latitude'].toString());
  166 +// longitude = double.parse(result['longitude'].toString());
  167 +// // if (_mapController != null) {
  168 +// _mapController.moveCamera(
  169 +// CameraUpdate.newLatLng(LatLng(latitude, longitude)));
  170 +
  171 +// // }
  172 +// page = 1;
  173 +
  174 +// // _loadData(LatLng(latitude, longitude));
  175 +
  176 +// // setState(() {});
  177 +// }
  178 +// latitudeLocation = latitude;
  179 +// longitudeLocation = longitude;
  180 +// _mapController.moveCamera(
  181 +// CameraUpdate.newLatLng(LatLng(latitudeLocation, longitudeLocation)),
  182 +// animated: true,
  183 +// );
  184 +// _loadData(LatLng(latitude, longitude));
  185 +// }
  186 +// }
  187 +// });
  188 +// }
  189 +
  190 +// @override
  191 +// void dispose() {
  192 +// super.dispose();
  193 +
  194 +// /// 移除定位监听
  195 +// /// 防止内存泄漏
  196 +// if (null != _locationListener) {
  197 +// _locationListener?.cancel();
  198 +// }
  199 +
  200 +// if (null != _geocodeSearchListener) {
  201 +// _geocodeSearchListener?.cancel();
  202 +// }
  203 +
  204 +// /// 销毁定位
  205 +// /// 释放定位资源
  206 +// _locationPlugin.destroy();
  207 +// }
  208 +
  209 +// // Future<bool> checkLocationPermission() async {
  210 +// // PermissionStatus permissionStatus = await Permission.location.status;
  211 +// // if (permissionStatus == PermissionStatus.granted) {
  212 +// // return true;
  213 +// // } else {
  214 +// // return false;
  215 +// // }
  216 +// // }
  217 +
  218 +// /// 检查权限并定
  219 +// // _getLocationPermission() async {
  220 +// // if (!(await checkPermission(Permission.location))) {
  221 +// // //没有定位权限
  222 +
  223 +// // //申请定位权限
  224 +// // _requestLocationPermission();
  225 +// // } else {
  226 +// // //去定位
  227 +// // _requestLocationPermission();
  228 +// // }
  229 +// // }
  230 +
  231 +// /// 设置定位参数
  232 +// /// 配置定位选项,如精度、频率等
  233 +// void _setLocationOption() {
  234 +// AMapLocationOption locationOption = new AMapLocationOption();
  235 +
  236 +// /// 是否单次定位
  237 +// /// false表示连续定位
  238 +// locationOption.onceLocation = true;
  239 +
  240 +// /// 是否需要返回逆地理信息
  241 +// /// true表示需要返回地址信息
  242 +// locationOption.needAddress = true;
  243 +
  244 +// /// 是否需要返回逆地理编码信息
  245 +// locationOption.locatingWithReGeocode = true;
  246 +
  247 +// /// 逆地理信息的语言类型
  248 +// /// 默认为自动适配当前系统语言
  249 +// locationOption.geoLanguage = GeoLanguage.DEFAULT;
  250 +
  251 +// /// iOS 14定位精度权限设置
  252 +// /// 设置为模糊定位精度
  253 +// locationOption.desiredLocationAccuracyAuthorizationMode =
  254 +// AMapLocationAccuracyAuthorizationMode.ReduceAccuracy;
  255 +
  256 +// /// iOS 14精确定位目的key
  257 +// /// 需要与info.plist中配置一致
  258 +// locationOption.fullAccuracyPurposeKey = "AMapLocationScene";
  259 +
  260 +// /// 设置Android端连续定位的定位间隔
  261 +// /// 单位:毫秒
  262 +// locationOption.locationInterval = 2000;
  263 +
  264 +// /// 设置Android端的定位模式
  265 +// /// 可选值:
  266 +// /// [AMapLocationMode.Battery_Saving] 低功耗模式
  267 +// /// [AMapLocationMode.Device_Sensors] 仅设备模式
  268 +// /// [AMapLocationMode.Hight_Accuracy] 高精度模式
  269 +// locationOption.locationMode = AMapLocationMode.Hight_Accuracy;
  270 +
  271 +// /// 设置iOS端的定位最小更新距离
  272 +// /// -1表示不限制距离
  273 +// locationOption.distanceFilter = -1;
  274 +
  275 +// /// 设置iOS端期望的定位精度
  276 +// /// 可选值:
  277 +// /// [DesiredAccuracy.Best] 最高精度
  278 +// /// [DesiredAccuracy.BestForNavigation] 适用于导航场景的高精度
  279 +// /// [DesiredAccuracy.NearestTenMeters] 10米
  280 +// /// [DesiredAccuracy.Kilometer] 1000米
  281 +// /// [DesiredAccuracy.ThreeKilometers] 3000米
  282 +// locationOption.desiredAccuracy = DesiredAccuracy.Best;
  283 +
  284 +// /// 设置iOS端是否允许系统暂停定位
  285 +// /// false表示不允许系统暂停定位
  286 +// locationOption.pausesLocationUpdatesAutomatically = false;
  287 +
  288 +// /// 将定位参数设置给定位插件
  289 +// _locationPlugin.setLocationOption(locationOption);
  290 +// }
  291 +
  292 +// /// 获取定位权限
  293 +// _requestLocationPermission() async {
  294 +// /// [hasShow] 隐私权政策是否弹窗展示告知用户
  295 +// AMapFlutterLocation.updatePrivacyShow(true, true);
  296 +
  297 +// /// [hasAgree] 隐私权政策是否已经取得用户同意
  298 +// AMapFlutterLocation.updatePrivacyAgree(true);
  299 +// // await AMapFlutterLocation.instance.updatePrivacyShow(true);
  300 +// // await AmapLocation.instance.updatePrivacyAgree(true);
  301 +// bool canLocation = false;
  302 +
  303 +// if (!(await checkPermission(Permission.location))) {
  304 +// //没有定位权限
  305 +
  306 +// //申请定位权限
  307 +// canLocation = await requestPermission(Permission.location);
  308 +// } else {
  309 +// canLocation = true;
  310 +// }
  311 +// // bool canLocation = await requestPermission(Permission.location);
  312 +// // 单次定位
  313 +// if (canLocation) {
  314 +// Future.delayed(Duration(milliseconds: 200), () async {
  315 +// /// [hasShow] 隐私权政策是否弹窗展示告知用户
  316 +// AMapFlutterLocation.updatePrivacyShow(true, true);
  317 +
  318 +// /// [hasAgree] 隐私权政策是否已经取得用户同意
  319 +// AMapFlutterLocation.updatePrivacyAgree(true);
  320 +// _startLocation();
  321 +// // final location = await AmapLocation.instance.fetchLocation(
  322 +// // // needAddress: true,
  323 +// // // mode: LocationAccuracy.High,
  324 +// // // timeout: Duration(seconds: 10)
  325 +// // );
  326 +
  327 +// // if (location.city == null || location.city == '') //网络不好,定位失败
  328 +// // {
  329 +// // // App.sp.setString("lat", "39.684670899");
  330 +// // // App.sp.setString("lng", "118.17630045");
  331 +// // } else {
  332 +// // if (widget.long == null ||
  333 +// // widget.long == '' ||
  334 +// // widget.long == 'null') {
  335 +// // latitude = location.latLng!.latitude;
  336 +// // longitude = location.latLng!.longitude;
  337 +// // if (_controller != null) {
  338 +// // _controller!.setCenterCoordinate(LatLng(
  339 +// // location.latLng!.latitude, location.latLng!.longitude));
  340 +// // }
  341 +
  342 +// // page = 1;
  343 +
  344 +// // _loadData(
  345 +// // LatLng(location.latLng!.latitude, location.latLng!.longitude));
  346 +
  347 +// // setState(() {});
  348 +// // }
  349 +// // latitudeLocation = location.latLng!.latitude;
  350 +// // longitudeLocation = location.latLng!.longitude;
  351 +// // }
  352 +// });
  353 +// } else {
  354 +// //无权限
  355 +// }
  356 +// }
  357 +
  358 +// // 开始定位
  359 +// /// 设置定位参数并启动定位
  360 +// void _startLocation() {
  361 +// /// 开始定位之前设置定位参数
  362 +// _setLocationOption();
  363 +// _locationPlugin.startLocation();
  364 +// }
  365 +
  366 +// /// 停止定位
  367 +// /// 停止定位服务
  368 +// void _stopLocation() {
  369 +// _locationPlugin.stopLocation();
  370 +// }
  371 +
  372 +// void onMapCreated(AMapController controller) {
  373 +// // setState(() {
  374 +// _mapController = controller;
  375 +// // _mapController.moveCamera(
  376 +// // CameraUpdate.newLatLng(LatLng(latitudeLocation, longitudeLocation)),
  377 +// // animated: true,
  378 +// // );
  379 +// // getApprovalNumber();
  380 +// // });
  381 +// }
  382 +
  383 +// /// 获取审图号
  384 +// // void getApprovalNumber() async {
  385 +// // //普通地图审图号
  386 +// // String mapContentApprovalNumber =
  387 +// // (await _mapController.getMapContentApprovalNumber());
  388 +// // //卫星地图审图号
  389 +// // String satelliteImageApprovalNumber =
  390 +// // (await _mapController.getSatelliteImageApprovalNumber());
  391 +
  392 +// // print('地图审图号(普通地图): $mapContentApprovalNumber');
  393 +// // print('地图审图号(卫星地图): $satelliteImageApprovalNumber');
  394 +// // }
  395 +
  396 +// //移动视野
  397 +// // void _onCameraMove(CameraPosition cameraPosition) {
  398 +// // latitude = cameraPosition.target.latitude;
  399 +// // longitude = cameraPosition.target.longitude;
  400 +// // page = 1;
  401 +// // _loadData(cameraPosition.target);
  402 +// // }
  403 +
  404 +// //移动地图结束
  405 +// void _onCameraMoveEnd(CameraPosition cameraPosition) {
  406 +// setState(() {
  407 +// _currentZoom = '当前缩放级别:${cameraPosition.zoom}';
  408 +// });
  409 +
  410 +// _mapController.moveCamera(
  411 +// CameraUpdate.zoomTo(cameraPosition.zoom),
  412 +// animated: true,
  413 +// );
  414 +// latitude = cameraPosition.target.latitude;
  415 +// longitude = cameraPosition.target.longitude;
  416 +// page = 1;
  417 +// _loadData(cameraPosition.target);
  418 +// }
  419 +
  420 +// @override
  421 +// Widget build(BuildContext context) {
  422 +// final AMapWidget amap = AMapWidget(
  423 +// initialCameraPosition:
  424 +// CameraPosition(target: LatLng(latitude, longitude), zoom: 16),
  425 +// onMapCreated: onMapCreated,
  426 +// // onCameraMove: _onCameraMove,
  427 +// onCameraMoveEnd: _onCameraMoveEnd,
  428 +// minMaxZoomPreference: MinMaxZoomPreference(_minZoom, _maxZoom),
  429 +// scaleEnabled: true,
  430 +// );
  431 +
  432 +// return Scaffold(
  433 +// resizeToAvoidBottomInset: false, //防止底部布局被顶起
  434 +// appBar: SystemAppBar(
  435 +// '选择位置信息',
  436 +// onTap: () {
  437 +// if (Navigator.canPop(context)) {
  438 +// Navigator.pop(context);
  439 +// }
  440 +// },
  441 +// ),
  442 +
  443 +// body: Column(
  444 +// children: <Widget>[
  445 +// // Theme(
  446 +// // data: new
  447 +// // ThemeData(
  448 +// // // primaryColor: MyColours.color_438E93,
  449 +// // // hintColor: MyColours.color_438E93),
  450 +// // child:
  451 +// // Container(
  452 +// // color: MyColours.color_438E93,
  453 +// // decoration: BoxDecoration(
  454 +// // color: MyColours.color_438E93,
  455 +// // boxShadow: [
  456 +// // BoxShadow(color: Colors.white, spreadRadius: 1),
  457 +// // ],
  458 +// // ),
  459 +
  460 +// // padding: EdgeInsets.all(5),
  461 +// // child:
  462 +
  463 +// // ),
  464 +// // ),
  465 +// // ListView.builder(
  466 +// // shrinkWrap: true,
  467 +// // itemCount: inputTipDatas.length,
  468 +// // itemBuilder: (context, index) {
  469 +// // InputTip inputTip = inputTipDatas[index];
  470 +// // return InkWell(
  471 +// // onTap: () {
  472 +// // // searchAroundAddress(inputTip.name ?? '');
  473 +// // // searchPoiId(inputTip.poiId ?? '');
  474 +// // // _loadData(inputTip.coordinate ??
  475 +// // // LatLng(latitude, longitude));
  476 +// // },
  477 +// // child: Container(
  478 +// // child: Row(
  479 +// // children: [
  480 +// // Text(
  481 +// // inputTip.name ?? '',
  482 +// // style: TextStyle(
  483 +// // fontSize: font(15),
  484 +// // color: MyColours.color_515151),
  485 +// // ),
  486 +// // HEmptyView(10),
  487 +// // Expanded(
  488 +// // child: Text(
  489 +// // (inputTip.district ?? '') +
  490 +// // (inputTip.address ?? ''),
  491 +// // style: TextStyle(
  492 +// // fontSize: font(13),
  493 +// // color: MyColours.color_999999),
  494 +// // ),
  495 +// // ),
  496 +// // ],
  497 +// // )));
  498 +// // })
  499 +// // ],
  500 +// // ),
  501 +
  502 +// Stack(
  503 +// children: [
  504 +// Container(
  505 +// height: w(300),
  506 +// child: Stack(
  507 +// children: <Widget>[
  508 +// amap,
  509 +// // AmapView(
  510 +// // showZoomControl: false,
  511 +
  512 +// // /// 是否显示指南针控件
  513 +// // showCompass: true,
  514 +
  515 +// // /// 是否显示比例尺控件
  516 +// // showScaleControl: true,
  517 +
  518 +// // /// 是否使能缩放手势
  519 +// // zoomGesturesEnabled: true,
  520 +
  521 +// // /// 是否使能滚动手势
  522 +// // scrollGesturesEnabled: true,
  523 +
  524 +// // /// 是否使能旋转手势
  525 +// // rotateGestureEnabled: false,
  526 +// // centerCoordinate: LatLng(latitude, longitude),
  527 +// // maskDelay: Duration(milliseconds: 500),
  528 +// // zoomLevel: 19,
  529 +// // onMapCreated: (controller) async {
  530 +// // _controller = controller;
  531 +// // _controller!
  532 +// // .setCenterCoordinate(LatLng(latitude, longitude));
  533 +// // // if (await requestPermission(PermissionGroup.location)) {
  534 +// // // await controller.showMyLocation(true);
  535 +// // // await controller?.showLocateControl(true);
  536 +// // // final latLng = await _controller?.getLocation(
  537 +// // // delay: Duration(seconds: 2));
  538 +// // // await enableFluttifyLog(false); // 关闭log
  539 +// // // _loadData(latLng);
  540 +// // // } else {
  541 +// // // //无权限
  542 +// // // _showLocPemWidget();
  543 +// // // }
  544 +// // },
  545 +// // // markers: [],
  546 +// // onMapMoveEnd: (MapMove move) async {
  547 +// // latitude = move.coordinate!.latitude;
  548 +// // longitude = move.coordinate!.longitude;
  549 +// // page = 1;
  550 +// // _loadData(move.coordinate!);
  551 +// // },
  552 +// // ),
  553 +// Center(
  554 +// child: Icon(
  555 +// Icons.place,
  556 +// size: w(32),
  557 +// color: Color(0xFFFF0000),
  558 +// ),
  559 +// ),
  560 +// Positioned(
  561 +// right: w(10),
  562 +// bottom: w(10),
  563 +// child: InkWell(
  564 +// onTap: () {
  565 +// _mapController.moveCamera(
  566 +// CameraUpdate.newLatLng(
  567 +// LatLng(latitudeLocation, longitudeLocation)),
  568 +// animated: true,
  569 +// );
  570 +// },
  571 +// child: Container(
  572 +// decoration: BoxDecoration(
  573 +// color: MyColours.color_ffffff,
  574 +// borderRadius: BorderRadius.circular(r(5))),
  575 +// padding: EdgeInsets.all(w(5)),
  576 +// child: Image.asset(
  577 +// Utils.getImgPath('location_map'),
  578 +// width: w(25),
  579 +// ),
  580 +// )),
  581 +// )
  582 +// ],
  583 +// ),
  584 +// ),
  585 +// Positioned(
  586 +// top: w(10),
  587 +// left: w(20),
  588 +// right: w(20),
  589 +// child: Container(
  590 +// // height: w(45),
  591 +// padding: EdgeInsets.symmetric(vertical: w(10)),
  592 +// decoration: BoxDecoration(
  593 +// color: Colors.white,
  594 +// borderRadius: BorderRadius.circular(r(10))),
  595 +// child: TextField(
  596 +// textAlignVertical: TextAlignVertical.center,
  597 +// style: TextStyle(
  598 +// color: MyColours.color_515151,
  599 +// fontSize: font(15),
  600 +// ),
  601 +// controller:
  602 +// TextEditingController.fromValue(TextEditingValue(
  603 +// // 设置内容
  604 +// text: keyword,
  605 +// selection: TextSelection.fromPosition(TextPosition(
  606 +// affinity: TextAffinity.downstream,
  607 +// offset: keyword.length)),
  608 +// // 保持光标在最后
  609 +// )),
  610 +// decoration: InputDecoration(
  611 +// // border: b,
  612 +// // border: OutlineInputBorder(
  613 +// // borderRadius: BorderRadius.all(Radius.circular(40)),
  614 +// // ),
  615 +// border: OutlineInputBorder(borderSide: BorderSide.none),
  616 +// hintText: '输入关键字',
  617 +// isCollapsed: true,
  618 +
  619 +// hintStyle: TextStyle(
  620 +// color: MyColours.color_999999, fontSize: font(15)),
  621 +// // contentPadding: const EdgeInsets.symmetric(
  622 +// // vertical: 8, horizontal: 1),
  623 +// prefixIconConstraints: BoxConstraints(maxWidth: w(40)),
  624 +// prefixIcon: Padding(
  625 +// padding: EdgeInsets.only(left: w(10), right: w(10)),
  626 +// child: SizedBox(
  627 +// width: w(30),
  628 +// child: Image.asset(
  629 +// Utils.getImgPath('search_black'),
  630 +// ))),
  631 +// suffixIconConstraints: BoxConstraints(maxWidth: w(32)),
  632 +// suffixIcon: InkWell(
  633 +// child: Padding(
  634 +// padding: EdgeInsets.only(left: w(10), right: w(10)),
  635 +// child: SizedBox(
  636 +// width: w(22),
  637 +// child: Image.asset(
  638 +// Utils.getImgPath('delete_black'),
  639 +// ))),
  640 +// onTap: () {
  641 +// keyword = "";
  642 +// setState(() {});
  643 +// },
  644 +// ),
  645 +// fillColor: Colors.white,
  646 +// filled: true,
  647 +// ),
  648 +
  649 +// inputFormatters: [],
  650 +// //内容改变的回调
  651 +// onChanged: (text) {
  652 +// print('change $text');
  653 +// keyword = text;
  654 +
  655 +// //搜索
  656 +
  657 +// if (text != null && text.trim().length > 0) {
  658 +// JhCommonUtils.debounce(
  659 +// () => _fetchInputTips(text.toString()));
  660 +// }
  661 +// },
  662 +// //内容提交(按回车)的回调
  663 +// onSubmitted: (text) {
  664 +// print('submit $text');
  665 +// // 触发关闭弹出来的键盘。
  666 +// keyword = text;
  667 +// FocusScope.of(context).requestFocus(FocusNode());
  668 +// setState(() {
  669 +// // isloading = true;
  670 +// });
  671 +
  672 +// // _fetchInputTips(text.toString());
  673 +
  674 +// // searchAroundAddress(text.toString());
  675 +// },
  676 +// //按回车时调用
  677 +// onEditingComplete: () {
  678 +// print('onEditingComplete');
  679 +// },
  680 +// ),
  681 +// ),
  682 +// )
  683 +// ],
  684 +// ),
  685 +
  686 +// Expanded(
  687 +// flex: 1,
  688 +// child: Visibility(
  689 +// visible: !isloading,
  690 +// maintainSize: false,
  691 +// maintainSemantics: false,
  692 +// maintainInteractivity: false,
  693 +// replacement: Center(
  694 +// child: CupertinoActivityIndicator(),
  695 +// ),
  696 +// child: EasyRefresh.custom(
  697 +// controller: refreshController,
  698 +// slivers: [
  699 +// SliverList(
  700 +// delegate: SliverChildBuilderDelegate(
  701 +// (BuildContext context, int position) {
  702 +// print("itemBuilder" + list.length.toString());
  703 +// PoiModel item = list[position]!;
  704 +// return InkWell(
  705 +// child: Column(
  706 +// children: <Widget>[
  707 +// Container(
  708 +// margin: EdgeInsets.only(
  709 +// top: 8, bottom: 5, left: 10),
  710 +// child: Row(
  711 +// children: <Widget>[
  712 +// Icon(
  713 +// Icons.place,
  714 +// size: 20.0,
  715 +// color: position == 0
  716 +// ? Colors.green
  717 +// : Colors.grey,
  718 +// ),
  719 +// Expanded(
  720 +// child: Text(item.title,
  721 +// style: TextStyle(
  722 +// fontSize: 16,
  723 +// color: position == 0
  724 +// ? Colors.green
  725 +// : Color(0xFF787878))))
  726 +// ],
  727 +// ),
  728 +// ),
  729 +// Container(
  730 +// margin: EdgeInsets.only(
  731 +// top: 5, bottom: 5, left: 18),
  732 +// alignment: Alignment.centerLeft,
  733 +// child: Text(
  734 +// item.address!,
  735 +// style: TextStyle(
  736 +// fontSize: 14,
  737 +// color: Color(0xFF646464),
  738 +// ),
  739 +// ),
  740 +// ),
  741 +// Divider(
  742 +// height: 1,
  743 +// )
  744 +// ],
  745 +// ),
  746 +// onTap: () async {
  747 +// // await _controller.setCenterCoordinate(
  748 +// // LatLng(item.latLng.latitude, item.latLng.longitude),
  749 +// // zoomLevel: 16);
  750 +// if (Navigator.canPop(context)) {
  751 +// Navigator.pop(context, {
  752 +// 'address': item.address,
  753 +// 'lat': item.latLng!.latitude.toString(),
  754 +// 'lng': item.latLng!.longitude.toString()
  755 +// });
  756 +// }
  757 +// },
  758 +// );
  759 +// },
  760 +// childCount: list.length,
  761 +// ),
  762 +// )
  763 +// ],
  764 +// onRefresh: () async {
  765 +// if (flag) {
  766 +// page = 1;
  767 +// _loadData(LatLng(latitude, longitude));
  768 +// }
  769 +// },
  770 +// onLoad: () async {
  771 +// if (flag) {
  772 +// page++;
  773 +// _loadData(LatLng(latitude, longitude),
  774 +// showloading: false);
  775 +// }
  776 +// },
  777 +// )),
  778 +// ),
  779 +// ],
  780 +// ),
  781 +// );
  782 +// }
  783 +
  784 +// _fetchInputTips(String text) async {
  785 +// flag = false;
  786 +// page = 1;
  787 +// // setState(() {
  788 +// // isloading = true;
  789 +// // });
  790 +
  791 +// /// 逆地理编码(坐标转地址)
  792 +// ///
  793 +// ///
  794 +// // await AmapLocation.instance.updatePrivacyShow(true);
  795 +// // await AmapLocation.instance.updatePrivacyAgree(true);
  796 +
  797 +// LatLng latLng = LatLng(latitude, longitude);
  798 +
  799 +// address = await _locationPlugin
  800 +// .onGeocodeSearch(true, [latLng.longitude, latLng.latitude]);
  801 +
  802 +// // await AmapLocation.instance.updatePrivacyShow(true);
  803 +// // await AmapLocation.instance.updatePrivacyAgree(true);
  804 +
  805 +// List<dynamic> temp = await _locationPlugin.doInputtipsRequest(
  806 +// text,
  807 +// city: "",
  808 +// );
  809 +
  810 +// inputTipDatas = [];
  811 +
  812 +// temp.forEach((element) {
  813 +// inputTipDatas.add(MapInputsModel.fromJson(element));
  814 +// });
  815 +
  816 +// print(inputTipDatas);
  817 +// poiModel = new PoiModel("当前位置", address, latLng);
  818 +// list.clear();
  819 +// list.add(poiModel);
  820 +// for (var inputTip in inputTipDatas) {
  821 +// String? title = await inputTip.name ?? '';
  822 +// String? cityStr = (inputTip.district ?? '') + (inputTip.city ?? '');
  823 +
  824 +// // LatLng? latLng = await inputTip.point;
  825 +
  826 +// list.add(new PoiModel(title.toString(), cityStr, latLng));
  827 +// }
  828 +
  829 +// print(list);
  830 +
  831 +// setState(() {
  832 +// // isloading = false;
  833 +// });
  834 +// }
  835 +
  836 +// void _loadData(LatLng latLng, {showloading = true}) async {
  837 +// flag = true;
  838 +// setState(() {
  839 +// if (showloading) {
  840 +// isloading = true;
  841 +// }
  842 +// });
  843 +
  844 +// /// 逆地理编码(坐标转地址)
  845 +// ///
  846 +// ///
  847 +// ///
  848 +
  849 +// // await AmapLocation.instance.updatePrivacyShow(true);
  850 +// // await AmapLocation.instance.updatePrivacyAgree(true);
  851 +// if (page == 1) {
  852 +// address = await _locationPlugin
  853 +// .onGeocodeSearch(true, [latLng.longitude, latLng.latitude]);
  854 +// poiModel = new PoiModel("当前位置", address, latLng);
  855 +// list.clear();
  856 +// list.add(poiModel);
  857 +// }
  858 +// // final poiList
  859 +// List<dynamic> temp = await _locationPlugin.poiSearchAround(
  860 +// keyword, latLng.longitude, latLng.latitude);
  861 +
  862 +// List<MapRoundSearchModel> searchData = [];
  863 +
  864 +// temp.forEach((element) {
  865 +// searchData.add(MapRoundSearchModel.fromJson(element));
  866 +// });
  867 +
  868 +// print(searchData);
  869 +
  870 +// for (var poi in searchData) {
  871 +// String? title = await poi.title;
  872 +// String? cityName = await poi.cityName;
  873 +// String? provinceName = await poi.provinceName;
  874 +// String? snippet = await poi.snippet;
  875 +// String? adName = await poi.adName;
  876 +// LatLng? latLng = LatLng(poi.latitude ?? 0, poi.longitude ?? 0);
  877 +// String? bussniss = poi.businessArea;
  878 +
  879 +// list.add(new PoiModel(
  880 +// title.toString(),
  881 +// provinceName.toString() +
  882 +// cityName.toString() +
  883 +// adName.toString() +
  884 +// // address.toString() +
  885 +// bussniss.toString() +
  886 +// snippet.toString(),
  887 +// latLng));
  888 +// }
  889 +
  890 +// setState(() {
  891 +// if (showloading) {
  892 +// isloading = false;
  893 +// }
  894 +// });
  895 +// }
  896 +
  897 +// // void searchPoiId(String text) async {
  898 +// // await AmapLocation.instance.updatePrivacyShow(true);
  899 +// // await AmapLocation.instance.updatePrivacyAgree(true);
  900 +// // Poi? poi = await AmapSearch.instance.searchPoiId(
  901 +// // text,
  902 +// // );
  903 +// // print(poi);
  904 +// // }
  905 +
  906 +// // void searchAroundAddress(String text) async {
  907 +// // await AmapLocation.instance.updatePrivacyShow(true);
  908 +// // await AmapLocation.instance.updatePrivacyAgree(true);
  909 +// // final poiList = await AmapSearch.instance.searchKeyword(
  910 +// // text,
  911 +// // city: "",
  912 +// // );
  913 +// // // final poiList = await AmapSearch.instance.searchAround(
  914 +// // // LatLng(latitude, longitude),
  915 +// // // city: "",
  916 +// // // radius: 100000000000000
  917 +
  918 +// // // );
  919 +
  920 +// // list.clear();
  921 +// // list.add(poiModel);
  922 +// // for (var poi in poiList) {
  923 +// // String? title = await poi.title;
  924 +// // LatLng? latLng = await poi.latLng;
  925 +// // String? cityName = await poi.cityName;
  926 +// // String? provinceName = await poi.provinceName;
  927 +// // String? address = await poi.address;
  928 +// // list.add(new PoiModel(
  929 +// // title.toString(),
  930 +// // provinceName.toString() + cityName.toString() + address.toString(),
  931 +// // latLng));
  932 +// // }
  933 +// // setState(() {
  934 +// // isloading = false;
  935 +// // FocusScope.of(context).requestFocus(FocusNode());
  936 +// // });
  937 +// // }
  938 +// }
  939 +
  940 +// class PoiModel {
  941 +// LatLng? latLng;
  942 +// String title;
  943 +// String? address;
  944 +
  945 +// PoiModel(this.title, this.address, this.latLng);
  946 +// }
@@ -198,73 +198,84 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { @@ -198,73 +198,84 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> {
198 // pickType: type, 198 // pickType: type,
199 // photoPathList: pathList, 199 // photoPathList: pathList,
200 // ); 200 // );
201 - List<MediaDN>? imgList = []; 201 + List<MediaDN>? imgList = [];
202 if (Platform.isAndroid || Platform.isIOS) { 202 if (Platform.isAndroid || Platform.isIOS) {
203 - List<AssetEntity>? imagListTemp = await AssetPicker.pickAssets(context,  
204 - pickerConfig: AssetPickerConfig(  
205 - maxAssets: widget.maxImageNumber -  
206 - widget.model!.imageListDenvironment.length,  
207 - // selectedAssets: assets,  
208 - requestType: type,  
209 - themeColor: MyColours.color_199095));  
210 - imagListTemp?.forEach((elenemt) async {  
211 - MediaDN mediaDN = MediaDN();  
212 - mediaDN.file = await elenemt.file;  
213 - imgList.add(mediaDN);  
214 - });  
215 -  
216 - }else if(Platform.isOhos){  
217 - List<XFile> imagListTemp = await ImageSelectOhosUtil.onImageButtonPressed(  
218 - ImageSource.gallery,  
219 - context: context,  
220 - isMultiImage: true,  
221 - isVideo: false,  
222 - limit: widget.maxImageNumber -  
223 - widget.model!.imageListDenvironment.length,);  
224 -  
225 - imagListTemp.forEach((elenemt) async {  
226 - MediaDN mediaDN = MediaDN();  
227 - mediaDN.file = File(elenemt.path);  
228 - imgList.add(mediaDN);  
229 - });  
230 -  
231 - }  
232 - if (imgList.length == 0 || imgList.isEmpty) {  
233 - print("No pick item.");  
234 - return;  
235 - }else {  
236 - for (int i = 0; i < imgList.length; i++) {  
237 - var file = ( imgList[i].file)!;  
238 - setState(() {  
239 - UploadImgModel imgModel = UploadImgModel();  
240 - imgModel.file = File(file.absolute.path);  
241 - imgModel.process = 0.01;  
242 - imgModel.fileType = FileType.image;  
243 - widget.model!.imageListDenvironment.add(imgModel);  
244 - }); 203 + List<AssetEntity>? imagListTemp = await AssetPicker.pickAssets(context,
  204 + pickerConfig: AssetPickerConfig(
  205 + maxAssets: widget.maxImageNumber -
  206 + widget.model!.imageListDenvironment.length,
  207 + // selectedAssets: assets,
  208 + requestType: type,
  209 + themeColor: MyColours.color_199095));
245 210
246 - bool need = await Utils.sizeNeed(file); 211 + int? countAll = imagListTemp?.length;
  212 + if (countAll != null && countAll > 0) {
  213 + for (int i = 0; i < imagListTemp!.length; i++) {
  214 + AssetEntity element = imagListTemp[i];
  215 + MediaDN mediaDN = MediaDN();
  216 + mediaDN.file = await element.file;
  217 + imgList.add(mediaDN);
  218 + }
  219 + if (imgList.length == countAll) {
  220 + for (int i = 0; i < imgList.length; i++) {
  221 + _upload(imgList[i]);
  222 + }
  223 + }
  224 + }
  225 + } else if (Platform.isOhos) {
  226 + List<XFile> imagListTemp = await ImageSelectOhosUtil.onImageButtonPressed(
  227 + ImageSource.gallery,
  228 + context: context,
  229 + isMultiImage: true,
  230 + isVideo: false,
  231 + limit:
  232 + widget.maxImageNumber - widget.model!.imageListDenvironment.length,
  233 + );
247 234
248 - if (need) {  
249 - File compressedFile = await FlutterNativeImage.compressImage(  
250 - file.path,  
251 - quality: 50,  
252 - percentage: 50);  
253 - file = File(compressedFile.absolute.path); 235 + if (imagListTemp != null && imagListTemp.length > 0) {
  236 + int countAll = imagListTemp.length;
  237 + if (countAll > 0) {
  238 + for (int i = 0; i < imagListTemp.length; i++) {
  239 + XFile element = imagListTemp[i];
  240 + MediaDN mediaDN = MediaDN();
  241 + mediaDN.file = File(element.path);
  242 + imgList.add(mediaDN);
  243 + }
  244 + if (imgList.length == countAll) {
  245 + for (int i = 0; i < imgList.length; i++) {
  246 + _upload(imgList[i]);
  247 + }
  248 + }
254 } 249 }
255 - UploadImageUtil().startUpload(  
256 - context,  
257 - file,  
258 - widget.model!.imageListDenvironment.length - 1,  
259 - false,  
260 - widget.model!,  
261 - UploadType.EnvironmentUploadType);  
262 - // startUpload(File(file.absolute.path),  
263 - // _uploadImageProvider.imageListDenvironment.length - 1, false);  
264 } 250 }
265 } 251 }
266 } 252 }
267 253
  254 + _upload(MediaDN mediaDN) async {
  255 + var file = (mediaDN.file)!;
  256 + bool need = await Utils.sizeNeed(file);
  257 + if (need) {
  258 + File compressedFile = await FlutterNativeImage.compressImage(file.path,
  259 + quality: 50, percentage: 50);
  260 + file = File(compressedFile.absolute.path);
  261 + }
  262 + setState(() {
  263 + UploadImgModel imgModel = UploadImgModel();
  264 + imgModel.file = File(file.absolute.path);
  265 + imgModel.process = 0.01;
  266 + imgModel.fileType = FileType.image;
  267 + widget.model!.imageListDenvironment.add(imgModel);
  268 + });
  269 +
  270 + UploadImageUtil().startUpload(
  271 + context,
  272 + file,
  273 + widget.model!.imageListDenvironment.length - 1,
  274 + false,
  275 + widget.model!,
  276 + UploadType.EnvironmentUploadType);
  277 + }
  278 +
268 ///添加图片UI弹出 279 ///添加图片UI弹出
269 Future _openModalBottomSheet(context, FileType fileType) async { 280 Future _openModalBottomSheet(context, FileType fileType) async {
270 await showModalBottomSheet( 281 await showModalBottomSheet(
@@ -818,7 +818,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -818,7 +818,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
818 // } 818 // }
819 LogUtil.v(param.toString()); 819 LogUtil.v(param.toString());
820 Map? notifyParam = param; 820 Map? notifyParam = param;
821 - if (Platform.isIOS && param != null) { 821 + if (Platform.isAndroid) {
  822 + } else if (Platform.isIOS && param != null) {
822 notifyParam = json.decode(param['custom'].toString()); 823 notifyParam = json.decode(param['custom'].toString());
823 } else if (Platform.isOhos && param != null) { 824 } else if (Platform.isOhos && param != null) {
824 Uri u = Uri.parse(param['content']['harmony_message']['uri']); 825 Uri u = Uri.parse(param['content']['harmony_message']['uri']);
@@ -161,8 +161,8 @@ class _WebPageState extends State<WebPage> { @@ -161,8 +161,8 @@ class _WebPageState extends State<WebPage> {
161 key: webViewKey, 161 key: webViewKey,
162 // contextMenu: contextMenu, 162 // contextMenu: contextMenu,
163 initialUrlRequest: URLRequest( 163 initialUrlRequest: URLRequest(
164 - // url: Uri.parse("http://colorcun.com/privacy1.html")),  
165 - url: WebUri("http://colorcun.com/privacy2.html")), 164 + url: Uri.parse("http://colorcun.com/privacy1.html")),
  165 + // url: WebUri("http://colorcun.com/privacy2.html")),
166 //华为下载功能闪退,去掉下载功能*********http://colorcun.com/privacy2.html 166 //华为下载功能闪退,去掉下载功能*********http://colorcun.com/privacy2.html
167 // initialFile: "assets/index.html", 167 // initialFile: "assets/index.html",
168 initialUserScripts: UnmodifiableListView<UserScript>([]), 168 initialUserScripts: UnmodifiableListView<UserScript>([]),
  1 +
  2 +// // import 'package:device_info/device_info.dart';
  3 +// // import 'package:device_info_plus/device_info_plus.dart';
  4 +// import 'package:flutter/material.dart';
  5 +// import 'package:flutter_inappwebview/flutter_inappwebview.dart';
  6 +// import 'package:one_key/net/dio_util.dart';
  7 +// import 'package:one_key/res/colors.dart';
  8 +// import 'package:one_key/utils/utils.dart';
  9 +// import 'package:one_key/widgets/system_app_bar.dart';
  10 +// import 'package:path_provider/path_provider.dart';
  11 +// // import 'package:permission_handler/permission_handler.dart';
  12 +// // import 'package:webview_flutter/webview_flutter.dart';
  13 +
  14 +// import 'dart:io';
  15 +
  16 +// // import 'package:webview_flutter/webview_flutter.dart';
  17 +
  18 +// // import 'package:flutter_inappwebview/flutter_inappwebview.dart';
  19 +// import 'package:url_launcher/url_launcher.dart';
  20 +// import 'dart:collection';
  21 +// // import 'package:open_file/open_file.dart';
  22 +// // import 'package:flutter_downloader/flutter_downloader.dart';
  23 +
  24 +// /**
  25 +// * 我的-----帮助与反馈页面 ----- 目前已经功能已经屏蔽
  26 +// */
  27 +
  28 +// class WebPage extends StatefulWidget {
  29 +// final String? title;
  30 +// final String? url;
  31 +// final bool need;
  32 +
  33 +// const WebPage({Key? key, this.title, this.url, this.need = false})
  34 +// : super(key: key);
  35 +// @override
  36 +// _WebPageState createState() => _WebPageState();
  37 +// }
  38 +
  39 +// class _WebPageState extends State<WebPage> {
  40 +// final GlobalKey webViewKey = GlobalKey();
  41 +
  42 +// InAppWebViewController? webViewController;
  43 +// InAppWebViewGroupOptions options = InAppWebViewGroupOptions(
  44 +// crossPlatform: InAppWebViewOptions(
  45 +// useShouldOverrideUrlLoading: true,
  46 +// useOnDownloadStart: true,
  47 +// mediaPlaybackRequiresUserGesture: false,
  48 +// ),
  49 +// android: AndroidInAppWebViewOptions(
  50 +// useHybridComposition: true,
  51 +// ),
  52 +// ios: IOSInAppWebViewOptions(
  53 +// allowsInlineMediaPlayback: true,
  54 +// ));
  55 +
  56 +// PullToRefreshController? pullToRefreshController;
  57 +// ContextMenu? contextMenu;
  58 +// String url = "";
  59 +// double progress = 0;
  60 +// final urlController = TextEditingController();
  61 +// // Future<void> openFile(filePath) async {
  62 +// // final _result = await OpenFile.open(filePath);
  63 +// // print(_result.message);
  64 +
  65 +// // // setState(() {
  66 +// // // _openResult = "type=${_result.type} message=${_result.message}";
  67 +// // // });
  68 +// // }
  69 +
  70 +// @override
  71 +// void initState() {
  72 +// super.initState();
  73 +
  74 +// // Enable hybrid composition.
  75 +// _init();
  76 +// }
  77 +
  78 +// @override
  79 +// void dispose() {
  80 +// if (widget.need) {
  81 +// Utils.changeStatusColor(color: MyColours.color_199095);
  82 +// }
  83 +
  84 +// super.dispose();
  85 +// }
  86 +
  87 +// // Future<bool> _checkPermission() async {
  88 +// // DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
  89 +// // AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
  90 +// // if (Platform.isAndroid && androidInfo.version.sdkInt <= 28) {
  91 +// // final status = await Permission.storage.status;
  92 +// // if (status != PermissionStatus.granted) {
  93 +// // final result = await Permission.storage.request();
  94 +// // if (result == PermissionStatus.granted) {
  95 +// // return true;
  96 +// // }
  97 +// // } else {
  98 +// // return true;
  99 +// // }
  100 +// // } else {
  101 +// // return true;
  102 +// // }
  103 +// // return false;
  104 +// // }
  105 +
  106 +// // Future<bool> checkPermissionStorage() async {
  107 +// // var status = await Permission.storage.status;
  108 +// // if (!status.isGranted) {
  109 +// // status = await Permission.storage.request();
  110 +// // if (status.isGranted) {
  111 +// // return true;
  112 +// // }
  113 +// // } else {
  114 +// // return true;
  115 +// // }
  116 +// // return false;
  117 +// // }
  118 +
  119 +// _init() async {
  120 +// // WidgetsFlutterBinding.ensureInitialized();
  121 +// // await FlutterDownloader.initialize(debug: true);
  122 +// if (Platform.isAndroid) {
  123 +// await AndroidInAppWebViewController.setWebContentsDebuggingEnabled(true);
  124 +
  125 +// var swAvailable = await AndroidWebViewFeature.isFeatureSupported(
  126 +// AndroidWebViewFeature.SERVICE_WORKER_BASIC_USAGE);
  127 +// var swInterceptAvailable = await AndroidWebViewFeature.isFeatureSupported(
  128 +// AndroidWebViewFeature.SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST);
  129 +
  130 +// if (swAvailable && swInterceptAvailable) {
  131 +// AndroidServiceWorkerController serviceWorkerController =
  132 +// AndroidServiceWorkerController.instance();
  133 +
  134 +// serviceWorkerController.serviceWorkerClient =
  135 +// AndroidServiceWorkerClient(
  136 +// shouldInterceptRequest: (request) async {
  137 +// print(request);
  138 +// return null;
  139 +// },
  140 +// );
  141 +// }
  142 +// }
  143 +// // await FlutterDownloader.initialize(
  144 +// // debug: true // optional: set false to disable printing logs to console
  145 +// // );
  146 +// // await Permission.storage.request();
  147 +// }
  148 +
  149 +// @override
  150 +// Widget build(BuildContext context) {
  151 +// return Scaffold(
  152 +// // We're using a Builder here so we have a context that is below the Scaffold
  153 +// // to allow calling Scaffold.of(context) so we can show a snackbar.
  154 +// appBar: SystemAppBar(
  155 +// widget.title,
  156 +// ),
  157 +// body: Column(
  158 +// children: [
  159 +// Expanded(
  160 +// child: InAppWebView(
  161 +// key: webViewKey,
  162 +// // contextMenu: contextMenu,
  163 +// initialUrlRequest: URLRequest(
  164 +// // url: Uri.parse("http://colorcun.com/privacy1.html")),
  165 +// url: WebUri("http://colorcun.com/privacy2.html")),
  166 +// //华为下载功能闪退,去掉下载功能*********http://colorcun.com/privacy2.html
  167 +// // initialFile: "assets/index.html",
  168 +// initialUserScripts: UnmodifiableListView<UserScript>([]),
  169 +// initialOptions: options,
  170 +// pullToRefreshController: pullToRefreshController,
  171 +// onWebViewCreated: (controller) {
  172 +// webViewController = controller;
  173 +// },
  174 +// onLoadStart: (controller, url) {
  175 +// setState(() {
  176 +// this.url = url.toString();
  177 +// urlController.text = this.url;
  178 +// });
  179 +// },
  180 +// androidOnPermissionRequest:
  181 +// (controller, origin, resources) async {
  182 +// return PermissionRequestResponse(
  183 +// resources: resources,
  184 +// action: PermissionRequestResponseAction.GRANT);
  185 +// },
  186 +// shouldOverrideUrlLoading: (controller, navigationAction) async {
  187 +// var uri = navigationAction.request.url!;
  188 +
  189 +// if (![
  190 +// "http",
  191 +// "https",
  192 +// "file",
  193 +// "chrome",
  194 +// "data",
  195 +// "javascript",
  196 +// "about"
  197 +// ].contains(uri.scheme)) {
  198 +// if (await canLaunch(url)) {
  199 +// // Launch the App
  200 +// await launch(
  201 +// url,
  202 +// );
  203 +// // and cancel the request
  204 +// return NavigationActionPolicy.CANCEL;
  205 +// }
  206 +// }
  207 +
  208 +// return NavigationActionPolicy.ALLOW;
  209 +// },
  210 +// onLoadStop: (controller, url) async {
  211 +// pullToRefreshController!.endRefreshing();
  212 +// setState(() {
  213 +// this.url = url.toString();
  214 +// urlController.text = this.url;
  215 +// });
  216 +// },
  217 +// onLoadError: (controller, url, code, message) {
  218 +// pullToRefreshController!.endRefreshing();
  219 +// },
  220 +// onProgressChanged: (controller, progress) {
  221 +// if (progress == 100) {
  222 +// pullToRefreshController!.endRefreshing();
  223 +// }
  224 +// setState(() {
  225 +// this.progress = progress / 100;
  226 +// urlController.text = this.url;
  227 +// });
  228 +// },
  229 +// onUpdateVisitedHistory: (controller, url, androidIsReload) {
  230 +// setState(() {
  231 +// this.url = url.toString();
  232 +// urlController.text = this.url;
  233 +// });
  234 +// },
  235 +// onConsoleMessage: (controller, consoleMessage) {
  236 +// print(consoleMessage);
  237 +// },
  238 +// onDownloadStart: (controller, url) async {
  239 +// print("onDownloadStart $url");
  240 +// Utils.showToast('开始下载...');
  241 +// // final taskId = await FlutterDownloader.enqueue(
  242 +// // url: url.toString(),
  243 +// // savedDir: (await getExternalStorageDirectory()).path,
  244 +// // showNotification:
  245 +// // true, // show download progress in status bar (for Android)
  246 +// // openFileFromNotification:
  247 +// // true, // click on notification to open downloaded file (for Android)
  248 +// // );
  249 +// final dir = (await getExternalStorageDirectory())!;
  250 +// String savePath = dir.path + "/one_key";
  251 +
  252 +// Directory directory = new Directory(savePath);
  253 +// if (directory.existsSync()) {
  254 +// //删除历史apk
  255 +// final List<FileSystemEntity> files = directory.listSync();
  256 +// for (FileSystemEntity file in files) {
  257 +// file.deleteSync();
  258 +// }
  259 +// }
  260 +// DioUtil().download(url.toString(), savePath,
  261 +// onProgress: (received, total) {
  262 +// // if (_progress != 100) {
  263 +// // int progress = ((received / total) * 100).round();
  264 +// // _progress = progress;
  265 +// // _setState(() {});
  266 +// // }
  267 +// if (received == total) {
  268 +// print('object');
  269 +// Utils.showToast('文件已保存在${savePath}');
  270 +// // openFile(savePath);
  271 +// //下载完成
  272 +// // InstallPlugin.installApk(savePath, "com.naji.one_key");
  273 +// }
  274 +// });
  275 +// // },
  276 +// // DioUtil().download(url.toString(),
  277 +// // (await getExternalStorageDirectory()).path,
  278 +// // onProgress: (received, total) {
  279 +// // // if (_progress != 100) {
  280 +// // // int progress = ((received / total) * 100).round();
  281 +// // // _progress = progress;
  282 +// // // _setState(() {});
  283 +// // // }
  284 +// // if (received == total) {
  285 +// // //下载完成
  286 +// // // InstallPlugin.installApk(savePath, "com.naji.one_key");
  287 +// // }
  288 +// // });
  289 +// },
  290 +// ))
  291 +// ],
  292 +// )
  293 +// // Builder(builder: (BuildContext context) {
  294 +// // return WebView(
  295 +// // initialUrl: "http://colorcun.com/privacy1.html",
  296 +// // javascriptMode: JavascriptMode.unrestricted,
  297 +// // onWebViewCreated: (WebViewController webViewController) {
  298 +// // _controller.complete(webViewController);
  299 +// // },
  300 +// // // TODO(iskakaushik): Remove this when collection literals makes it to stable.
  301 +// // // ignore: prefer_collection_literals
  302 +// // javascriptChannels: <JavascriptChannel>[
  303 +// // _toasterJavascriptChannel(context),
  304 +// // ].toSet(),
  305 +// // navigationDelegate: (NavigationRequest request) {
  306 +// // if (request.url.startsWith('https://www.youtube.com/')) {
  307 +// // print('blocking navigation to $request}');
  308 +// // return NavigationDecision.prevent;
  309 +// // }
  310 +// // print('allowing navigation to $request');
  311 +// // return NavigationDecision.navigate;
  312 +// // },
  313 +// // onPageStarted: (String url) {
  314 +// // print('Page started loading: $url');
  315 +// // },
  316 +// // onPageFinished: (String url) async {
  317 +// // print('Page finished loading: $url');
  318 +// // // showDownloadProgress(context);
  319 +// // final dir = await getExternalStorageDirectory();
  320 +// // String savePath = dir.path + "/one_key";
  321 +// // DioUtil().download(url, savePath,
  322 +// // onProgress: (received, total) {
  323 +// // // if (_progress != 100) {
  324 +// // // int progress = ((received / total) * 100).round();
  325 +// // // _progress = progress;
  326 +// // // _setState(() {});
  327 +// // // }
  328 +// // if (received == total) {
  329 +// // print('object');
  330 +// // //下载完成
  331 +// // // InstallPlugin.installApk(savePath, "com.naji.one_key");
  332 +// // }
  333 +// // });
  334 +// // },
  335 +// // gestureNavigationEnabled: true,
  336 +// // );
  337 +// // }),
  338 +// );
  339 +// }
  340 +
  341 +// // JavascriptChannel _toasterJavascriptChannel(BuildContext context) {
  342 +// // return JavascriptChannel(
  343 +// // name: 'Toaster',
  344 +// // onMessageReceived: (JavascriptMessage message) {
  345 +// // Scaffold.of(context).showSnackBar(
  346 +// // SnackBar(content: Text(message.message)),
  347 +// // );
  348 +// // });
  349 +// // }
  350 +// }
  351 +
  352 +// // class WebPage extends StatelessWidget {
  353 +// // final String title;
  354 +// // final String url;
  355 +// // final bool need;
  356 +
  357 +// // const WebPage({Key key, this.title, this.url, this.need = false})
  358 +// // : super(key: key);
  359 +// // @override
  360 +// // Widget build(BuildContext context) {
  361 +// // final Completer<WebViewController> _controller =
  362 +// // Completer<WebViewController>();
  363 +// // return Scaffold(
  364 +// // appBar: SystemAppBar(title, onTap: () {
  365 +// // if (need) {
  366 +// // Utils.changeStatusColor(color: MyColours.color_199095);
  367 +// // }
  368 +// // Navigator.of(context).pop();
  369 +// // }),
  370 +// // body: WillPopScope(
  371 +// // onWillPop: () async {
  372 +// // if (need) {
  373 +// // Utils.changeStatusColor(color: MyColours.color_199095);
  374 +// // }
  375 +// // return true;
  376 +// // },
  377 +// // child: WebView(
  378 +// // initialUrl: "http://colorcun.com/privacy1.html",
  379 +// // javascriptMode: JavascriptMode.unrestricted,
  380 +// // onWebViewCreated: (WebViewController webViewController) {
  381 +// // // Loading.showLoading(context);
  382 +// // _controller.complete(webViewController);
  383 +// // },
  384 +// // javascriptChannels: <JavascriptChannel>[
  385 +// // _toasterJavascriptChannel(context),
  386 +// // ].toSet(),
  387 +// // navigationDelegate: (NavigationRequest request) {
  388 +// // if (request.url.startsWith('https://www.youtube.com/')) {
  389 +// // return NavigationDecision.prevent;
  390 +// // }
  391 +// // return NavigationDecision.navigate;
  392 +// // },
  393 +// // onPageStarted: (String url) {},
  394 +// // onPageFinished: (String url) {
  395 +// // // Loading.hideLoading(context);
  396 +// // },
  397 +// // gestureNavigationEnabled: true,
  398 +// // )),
  399 +// // );
  400 +// // }
  401 +
  402 +// // JavascriptChannel _toasterJavascriptChannel(BuildContext context) {
  403 +// // return JavascriptChannel(
  404 +// // name: 'Toaster',
  405 +// // onMessageReceived: (JavascriptMessage message) {
  406 +// // Scaffold.of(context).showSnackBar(
  407 +// // SnackBar(content: Text(message.message)),
  408 +// // );
  409 +// // });
  410 +// // }
  411 +// // }
1 import 'dart:convert'; 1 import 'dart:convert';
2 2
3 import 'dart:io'; 3 import 'dart:io';
4 -import 'dart:async'; 4 +import 'dart:async'; // 需要导入这个库来使用 compute
  5 +import 'package:flutter/foundation.dart' show compute; // 从 Flutter 的包中导入 co
5 6
6 import 'package:cached_network_image/cached_network_image.dart'; 7 import 'package:cached_network_image/cached_network_image.dart';
7 import 'package:flutter/material.dart'; 8 import 'package:flutter/material.dart';
@@ -37,9 +38,6 @@ import './dispose.dart'; @@ -37,9 +38,6 @@ import './dispose.dart';
37 import 'package:flutter_native_image/flutter_native_image.dart'; 38 import 'package:flutter_native_image/flutter_native_image.dart';
38 // import 'package:flutter_image_compress/flutter_image_compress.dart'; 39 // import 'package:flutter_image_compress/flutter_image_compress.dart';
39 40
40 -  
41 -  
42 -  
43 typedef void OnPickImageCallback( 41 typedef void OnPickImageCallback(
44 double maxWidth, double maxHeight, int quality); 42 double maxWidth, double maxHeight, int quality);
45 typedef void DeleteCallback(int index); 43 typedef void DeleteCallback(int index);
@@ -90,7 +88,6 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { @@ -90,7 +88,6 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> {
90 // 控制器,可以用于取消任务、获取上述的状态,进度等信息 88 // 控制器,可以用于取消任务、获取上述的状态,进度等信息
91 // PutController putController = PutController(); 89 // PutController putController = PutController();
92 90
93 -  
94 // 当前的任务状态 91 // 当前的任务状态
95 92
96 @override 93 @override
@@ -248,9 +245,9 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { @@ -248,9 +245,9 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> {
248 // }); 245 // });
249 // } 246 // }
250 247
251 -  
252 -  
253 - 248 + Future<void> _heavy(AssetEntity assetEntity) async {
  249 + await assetEntity.file;
  250 + }
254 251
255 ///多图片选择 252 ///多图片选择
256 void pickAsset(RequestType type, {List<AssetPathEntity>? pathList}) async { 253 void pickAsset(RequestType type, {List<AssetPathEntity>? pathList}) async {
@@ -271,6 +268,8 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { @@ -271,6 +268,8 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> {
271 temp = widget.imageList; 268 temp = widget.imageList;
272 } 269 }
273 270
  271 + print(temp);
  272 +
274 List<MediaDN>? imgList = []; 273 List<MediaDN>? imgList = [];
275 if (Platform.isAndroid || Platform.isIOS) { 274 if (Platform.isAndroid || Platform.isIOS) {
276 List<AssetEntity>? imagListTemp = await AssetPicker.pickAssets(context, 275 List<AssetEntity>? imagListTemp = await AssetPicker.pickAssets(context,
@@ -279,11 +278,21 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { @@ -279,11 +278,21 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> {
279 // selectedAssets: assets, 278 // selectedAssets: assets,
280 requestType: type, 279 requestType: type,
281 themeColor: MyColours.color_199095)); 280 themeColor: MyColours.color_199095));
282 - imagListTemp?.forEach((elenemt) async {  
283 - MediaDN mediaDN = MediaDN();  
284 - mediaDN.file = await elenemt.file;  
285 - imgList.add(mediaDN);  
286 - }); 281 +
  282 + int? countAll = imagListTemp?.length;
  283 + if (countAll != null && countAll > 0) {
  284 + for (int i = 0; i < imagListTemp!.length; i++) {
  285 + AssetEntity element = imagListTemp[i];
  286 + MediaDN mediaDN = MediaDN();
  287 + mediaDN.file = await element.file;
  288 + imgList.add(mediaDN);
  289 + }
  290 + if (imgList.length == countAll) {
  291 + for (int i = 0; i < imgList.length; i++) {
  292 + _upload(imgList[i], temp, countAll);
  293 + }
  294 + }
  295 + }
287 } else if (Platform.isOhos) { 296 } else if (Platform.isOhos) {
288 List<XFile> imagListTemp = await ImageSelectOhosUtil.onImageButtonPressed( 297 List<XFile> imagListTemp = await ImageSelectOhosUtil.onImageButtonPressed(
289 ImageSource.gallery, 298 ImageSource.gallery,
@@ -292,62 +301,71 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { @@ -292,62 +301,71 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> {
292 isVideo: false, 301 isVideo: false,
293 limit: widget.maxImageNumber - temp!.length); 302 limit: widget.maxImageNumber - temp!.length);
294 303
295 - imagListTemp.forEach((elenemt) async {  
296 - MediaDN mediaDN = MediaDN();  
297 - mediaDN.file = File(elenemt.path);  
298 - imgList.add(mediaDN);  
299 - }); 304 + if (imagListTemp != null && imagListTemp.length > 0) {
  305 + int countAll = imagListTemp.length;
  306 + if (countAll > 0) {
  307 + for (int i = 0; i < imagListTemp.length; i++) {
  308 + XFile element = imagListTemp[i];
  309 + MediaDN mediaDN = MediaDN();
  310 + mediaDN.file = File(element.path);
  311 + imgList.add(mediaDN);
  312 + }
  313 + if (imgList.length == countAll) {
  314 + for (int i = 0; i < imgList.length; i++) {
  315 + _upload(imgList[i], temp, countAll);
  316 + }
  317 + }
  318 + }
  319 + }
300 } 320 }
  321 + }
301 322
302 - if (imgList.length == 0 || imgList.isEmpty) {  
303 - print("No pick item.");  
304 - return;  
305 - } else {  
306 - for (int i = 0; i < imgList.length; i++) {  
307 - var file = (imgList[i].file)!;  
308 - //从相册选取照片后进行裁剪压缩  
309 - File yourFile = file;  
310 - Uint8List afterImg = await yourFile.readAsBytes();  
311 - Uint8List? newImg = await Utils.testFromFileComporessList(  
312 - context, afterImg,  
313 - needResize:  
314 - widget.uploadType == UploadType.CouponDishType ? true : false);  
315 - String? path = await Utils.saveImage(newImg);  
316 - // File compressedFile;  
317 - if (path == null) {  
318 - // File compressedFile = await FlutterNativeImage.compressImage(  
319 - // file.path,  
320 - // quality: 50,  
321 - // percentage: 50);  
322 - File compressedFile =  
323 - (await Utils.compressImageToFile(file.path, quality: 70))!;  
324 - path = compressedFile.path;  
325 - }  
326 - // File compressedFile = await FlutterNativeImage.compressImage(  
327 - // file.absolute.path,  
328 - // quality: 50,  
329 - // percentage: 50);  
330 - setState(() {  
331 - UploadImgModel imgModel = UploadImgModel();  
332 - imgModel.file = File(path!);  
333 - imgModel.process = 0.01;  
334 -  
335 - temp!.add(imgModel);  
336 - });  
337 - bool need = await Utils.sizeNeed(file); 323 + _upload(MediaDN mediaDN, List<UploadImgModel>? temp, int countAll) async {
  324 + var file = (mediaDN.file)!;
  325 + //从相册选取照片后进行裁剪压缩
  326 + File yourFile = file;
  327 + Uint8List afterImg = await yourFile.readAsBytes();
  328 + Uint8List? newImg = await Utils.testFromFileComporessList(context, afterImg,
  329 + needResize:
  330 + widget.uploadType == UploadType.CouponDishType ? true : false);
  331 + String? path = await Utils.saveImage(newImg);
  332 + // File compressedFile;
  333 + if (path == null) {
  334 + // File compressedFile = await FlutterNativeImage.compressImage(
  335 + // file.path,
  336 + // quality: 50,
  337 + // percentage: 50);
  338 + File compressedFile =
  339 + (await Utils.compressImageToFile(file.path, quality: 70))!;
  340 + path = compressedFile.path;
  341 + }
  342 + // File compressedFile = await FlutterNativeImage.compressImage(
  343 + // file.absolute.path,
  344 + // quality: 50,
  345 + // percentage: 50);
  346 + bool need = await Utils.sizeNeed(file);
338 347
339 - if (need) {  
340 - file = File(path);  
341 - }  
342 - UploadImageUtil().startUpload(context, File(path), temp!.length - 1,  
343 - false, widget.model!, widget.uploadType,  
344 - countAll: imgList.length,  
345 - callback: widget.callback,  
346 - imageList: widget.imageList);  
347 - // startUpload(File(file.absolute.path),  
348 - // _uploadImageProvider.imageList.length - 1, false);  
349 - } 348 + if (need) {
  349 + File compressedFile =
  350 + (await Utils.compressImageToFile(file.path, quality: 70))!;
  351 + path = compressedFile.path;
  352 + // file = File(path);
350 } 353 }
  354 + setState(() {
  355 + UploadImgModel imgModel = UploadImgModel();
  356 + imgModel.file = File(path!);
  357 + imgModel.process = 0.01;
  358 +
  359 + temp!.add(imgModel);
  360 + });
  361 +
  362 + UploadImageUtil().startUpload(context, File(path), temp!.length - 1, false,
  363 + widget.model!, widget.uploadType,
  364 + countAll: countAll,
  365 + callback: widget.callback,
  366 + imageList: widget.imageList);
  367 + // startUpload(File(file.absolute.path),
  368 + // _uploadImageProvider.imageList.length - 1, false);
351 } 369 }
352 370
353 // ///上传到七牛云 371 // ///上传到七牛云
@@ -33,7 +33,7 @@ import 'package:qiniu_flutter_sdk/qiniu_flutter_sdk.dart'; @@ -33,7 +33,7 @@ import 'package:qiniu_flutter_sdk/qiniu_flutter_sdk.dart';
33 import 'package:wechat_assets_picker/wechat_assets_picker.dart'; 33 import 'package:wechat_assets_picker/wechat_assets_picker.dart';
34 import '../../utils/screen_util.dart'; 34 import '../../utils/screen_util.dart';
35 import './dispose.dart'; 35 import './dispose.dart';
36 -import 'package:photo_manager/photo_manager.dart'; 36 +// import 'package:photo_manager/photo_manager.dart';
37 import 'package:flutter_native_image/flutter_native_image.dart'; 37 import 'package:flutter_native_image/flutter_native_image.dart';
38 38
39 typedef void OnPickImageCallback( 39 typedef void OnPickImageCallback(
@@ -180,6 +180,34 @@ class _ImgPickerFWidgetState extends DisposableState<ImgPickerFWidget> { @@ -180,6 +180,34 @@ class _ImgPickerFWidgetState extends DisposableState<ImgPickerFWidget> {
180 } 180 }
181 } 181 }
182 182
  183 + _upload(MediaDN mediaDN, List<UploadImgModel>? temp, int countAll) async {
  184 + var file = (mediaDN.file)!;
  185 + // File compressedFile = await FlutterNativeImage.compressImage(
  186 + // file.absolute.path,
  187 + // quality: 50,
  188 + // percentage: 50);
  189 + File? compressedFile = File(file.absolute.path);
  190 + bool need = await Utils.sizeNeed(file);
  191 + if (need) {
  192 + compressedFile =
  193 + await Utils.compressImageToFile(file.absolute.path, quality: 70);
  194 + // file = File(compressedFile!.absolute.path);
  195 + }
  196 + setState(() {
  197 + UploadImgModel imgModel = UploadImgModel();
  198 + imgModel.file = compressedFile;
  199 + imgModel.process = 0.01;
  200 +
  201 + temp!.add(imgModel);
  202 + });
  203 +
  204 + UploadImageUtil().startUpload(context, file, temp!.length - 1, false,
  205 + widget.model!, widget.uploadType,
  206 + countAll: countAll,
  207 + callback: widget.callback,
  208 + feastRemarkXtImageList: temp);
  209 + }
  210 +
183 ///多图片选择 211 ///多图片选择
184 void pickAsset(RequestType type, {List<AssetPathEntity>? pathList}) async { 212 void pickAsset(RequestType type, {List<AssetPathEntity>? pathList}) async {
185 List<UploadImgModel>? temp = []; 213 List<UploadImgModel>? temp = [];
@@ -210,11 +238,20 @@ class _ImgPickerFWidgetState extends DisposableState<ImgPickerFWidget> { @@ -210,11 +238,20 @@ class _ImgPickerFWidgetState extends DisposableState<ImgPickerFWidget> {
210 // selectedAssets: assets, 238 // selectedAssets: assets,
211 requestType: type, 239 requestType: type,
212 themeColor: MyColours.color_199095)); 240 themeColor: MyColours.color_199095));
213 - imagListTemp?.forEach((elenemt) async {  
214 - MediaDN mediaDN = MediaDN();  
215 - mediaDN.file = await elenemt.file;  
216 - imgList.add(mediaDN);  
217 - }); 241 + int? countAll = imagListTemp?.length;
  242 + if (countAll != null && countAll > 0) {
  243 + for (int i = 0; i < imagListTemp!.length; i++) {
  244 + AssetEntity element = imagListTemp[i];
  245 + MediaDN mediaDN = MediaDN();
  246 + mediaDN.file = await element.file;
  247 + imgList.add(mediaDN);
  248 + }
  249 + if (imgList.length == countAll) {
  250 + for (int i = 0; i < imgList.length; i++) {
  251 + _upload(imgList[i], temp, countAll);
  252 + }
  253 + }
  254 + }
218 } else if (Platform.isOhos) { 255 } else if (Platform.isOhos) {
219 List<XFile> imagListTemp = await ImageSelectOhosUtil.onImageButtonPressed( 256 List<XFile> imagListTemp = await ImageSelectOhosUtil.onImageButtonPressed(
220 ImageSource.gallery, 257 ImageSource.gallery,
@@ -222,43 +259,21 @@ class _ImgPickerFWidgetState extends DisposableState<ImgPickerFWidget> { @@ -222,43 +259,21 @@ class _ImgPickerFWidgetState extends DisposableState<ImgPickerFWidget> {
222 isMultiImage: true, 259 isMultiImage: true,
223 isVideo: false, 260 isVideo: false,
224 limit: widget.maxImageNumber - temp!.length); 261 limit: widget.maxImageNumber - temp!.length);
225 -  
226 - imagListTemp.forEach((elenemt) async {  
227 - MediaDN mediaDN = MediaDN();  
228 - mediaDN.file = File(elenemt.path);  
229 - imgList.add(mediaDN);  
230 - });  
231 - }  
232 - if (imgList.length == 0 || imgList.isEmpty) {  
233 - print("No pick item.");  
234 - return;  
235 - } else {  
236 - for (int i = 0; i < imgList.length; i++) {  
237 - var file = ( imgList[i].file)!;  
238 - // File compressedFile = await FlutterNativeImage.compressImage(  
239 - // file.absolute.path,  
240 - // quality: 50,  
241 - // percentage: 50);  
242 - File? compressedFile =  
243 - await Utils.compressImageToFile(file.absolute.path, quality: 70);  
244 - setState(() {  
245 - UploadImgModel imgModel = UploadImgModel();  
246 - imgModel.file = compressedFile;  
247 - imgModel.process = 0.01;  
248 -  
249 - temp!.add(imgModel);  
250 - });  
251 - bool need = await Utils.sizeNeed(file);  
252 - if (need) {  
253 - file = File(compressedFile!.absolute.path); 262 + if (imagListTemp != null && imagListTemp.length > 0) {
  263 + int countAll = imagListTemp.length;
  264 + if (countAll > 0) {
  265 + for (int i = 0; i < imagListTemp.length; i++) {
  266 + XFile element = imagListTemp[i];
  267 + MediaDN mediaDN = MediaDN();
  268 + mediaDN.file = File(element.path);
  269 + imgList.add(mediaDN);
  270 + }
  271 + if (imgList.length == countAll) {
  272 + for (int i = 0; i < imgList.length; i++) {
  273 + _upload(imgList[i], temp, countAll);
  274 + }
  275 + }
254 } 276 }
255 - UploadImageUtil().startUpload(context, file, temp!.length - 1, false,  
256 - widget.model!, widget.uploadType,  
257 - countAll: imgList.length,  
258 - callback: widget.callback,  
259 - feastRemarkXtImageList: temp);  
260 - // startUpload(File(file.absolute.path),  
261 - // _uploadImageProvider.imageList.length - 1, false);  
262 } 277 }
263 } 278 }
264 } 279 }
1 1
  2 +
  3 +import 'dart:async';
  4 +import 'dart:convert';
  5 +import 'dart:io';
  6 +
2 import 'package:flutter/material.dart'; 7 import 'package:flutter/material.dart';
3 import 'package:one_key/utils/event_bus.dart'; 8 import 'package:one_key/utils/event_bus.dart';
  9 +import 'package:one_key/widgets/app_bar.dart';
4 import 'package:one_key/widgets/system_app_bar.dart'; 10 import 'package:one_key/widgets/system_app_bar.dart';
5 -  
6 -// import 'package:path_provider/path_provider.dart';  
7 import 'package:webview_flutter/webview_flutter.dart'; 11 import 'package:webview_flutter/webview_flutter.dart';
8 -// #docregion platform_imports  
9 -// Import for Android features.  
10 -import 'package:webview_flutter_android/webview_flutter_android.dart';  
11 -// Import for iOS features.  
12 -import 'package:webview_flutter_wkwebview/webview_flutter_wkwebview.dart';  
13 -  
14 -  
15 -/**  
16 - *  
17 - * 帮助与反馈页面 功能暂时已经弃用  
18 - */  
19 12
20 class WebViewPage extends StatefulWidget { 13 class WebViewPage extends StatefulWidget {
21 @override 14 @override
@@ -23,86 +16,14 @@ class WebViewPage extends StatefulWidget { @@ -23,86 +16,14 @@ class WebViewPage extends StatefulWidget {
23 } 16 }
24 17
25 class _WebViewPageState extends State<WebViewPage> { 18 class _WebViewPageState extends State<WebViewPage> {
26 - late WebViewController _controller = WebViewController();  
27 -// late final WebViewController _controller; 19 + final Completer<WebViewController> _controller =
  20 + Completer<WebViewController>();
  21 +
28 @override 22 @override
29 void initState() { 23 void initState() {
30 super.initState(); 24 super.initState();
31 // Enable hybrid composition. 25 // Enable hybrid composition.
32 - // if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView();  
33 - // #docregion platform_features  
34 - late final PlatformWebViewControllerCreationParams params;  
35 - if (WebViewPlatform.instance is WebKitWebViewPlatform) {  
36 - params = WebKitWebViewControllerCreationParams(  
37 - allowsInlineMediaPlayback: true,  
38 - mediaTypesRequiringUserAction: const <PlaybackMediaTypes>{},  
39 - );  
40 - } else {  
41 - params = const PlatformWebViewControllerCreationParams();  
42 - }  
43 -  
44 - final WebViewController controller =  
45 - WebViewController.fromPlatformCreationParams(params);  
46 - // #enddocregion platform_features  
47 -  
48 - controller  
49 - ..setJavaScriptMode(JavaScriptMode.unrestricted)  
50 - ..setBackgroundColor(const Color(0x00000000))  
51 - ..setNavigationDelegate(  
52 - NavigationDelegate(  
53 - onProgress: (int progress) {  
54 - debugPrint('WebView is loading (progress : $progress%)');  
55 - },  
56 - onPageStarted: (String url) {  
57 - debugPrint('Page started loading: $url');  
58 - },  
59 - onPageFinished: (String url) {  
60 - debugPrint('Page finished loading: $url');  
61 - },  
62 - onWebResourceError: (WebResourceError error) {  
63 - debugPrint('''  
64 -Page resource error:  
65 - code: ${error.errorCode}  
66 - description: ${error.description}  
67 - errorType: ${error.errorType}  
68 - isForMainFrame: ${error.isForMainFrame}  
69 - ''');  
70 - },  
71 - onNavigationRequest: (NavigationRequest request) {  
72 - if (request.url.startsWith('https://www.youtube.com/')) {  
73 - debugPrint('blocking navigation to ${request.url}');  
74 - return NavigationDecision.prevent;  
75 - }  
76 - debugPrint('allowing navigation to ${request.url}');  
77 - return NavigationDecision.navigate;  
78 - },  
79 - onUrlChange: (UrlChange change) {  
80 - debugPrint('url change to ${change.url}');  
81 - },  
82 - onHttpAuthRequest: (HttpAuthRequest request) {  
83 - // openDialog(request);  
84 - },  
85 - ),  
86 - )  
87 - ..addJavaScriptChannel(  
88 - 'Toaster',  
89 - onMessageReceived: (JavaScriptMessage message) {  
90 - ScaffoldMessenger.of(context).showSnackBar(  
91 - SnackBar(content: Text(message.message)),  
92 - );  
93 - },  
94 - )  
95 - ..loadRequest(Uri.parse("https://support.qq.com/product/152856"));  
96 -  
97 - // #docregion platform_features  
98 - if (controller.platform is AndroidWebViewController) {  
99 - AndroidWebViewController.enableDebugging(true);  
100 - (controller.platform as AndroidWebViewController)  
101 - .setMediaPlaybackRequiresUserGesture(false);  
102 - }  
103 - // #enddocregion platform_features  
104 -  
105 - _controller = controller; 26 + if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView();
106 } 27 }
107 28
108 @override 29 @override
@@ -121,44 +42,45 @@ Page resource error: @@ -121,44 +42,45 @@ Page resource error:
121 '周到安排商家', 42 '周到安排商家',
122 ), 43 ),
123 body: Builder(builder: (BuildContext context) { 44 body: Builder(builder: (BuildContext context) {
124 - return WebViewWidget(controller: _controller);  
125 - // initialUrl: "https://support.qq.com/product/152856",  
126 - // javascriptMode: JavascriptMode.unrestricted,  
127 - // onWebViewCreated: (WebViewController webViewController) {  
128 - // _controller.complete(webViewController);  
129 - // },  
130 - // // TODO(iskakaushik): Remove this when collection literals makes it to stable.  
131 - // // ignore: prefer_collection_literals  
132 - // javascriptChannels: <JavascriptChannel>[  
133 - // _toasterJavascriptChannel(context),  
134 - // ].toSet(),  
135 - // navigationDelegate: (NavigationRequest request) {  
136 - // if (request.url.startsWith('https://www.youtube.com/')) {  
137 - // print('blocking navigation to $request}');  
138 - // return NavigationDecision.prevent;  
139 - // }  
140 - // print('allowing navigation to $request');  
141 - // return NavigationDecision.navigate;  
142 - // },  
143 - // onPageStarted: (String url) {  
144 - // print('Page started loading: $url');  
145 - // },  
146 - // onPageFinished: (String url) {  
147 - // print('Page finished loading: $url');  
148 - // },  
149 - // gestureNavigationEnabled: true,  
150 - // ); 45 + return WebView(
  46 + initialUrl: "https://support.qq.com/product/152856",
  47 + javascriptMode: JavascriptMode.unrestricted,
  48 + onWebViewCreated: (WebViewController webViewController) {
  49 + _controller.complete(webViewController);
  50 + },
  51 + // TODO(iskakaushik): Remove this when collection literals makes it to stable.
  52 + // ignore: prefer_collection_literals
  53 + javascriptChannels: <JavascriptChannel>[
  54 + _toasterJavascriptChannel(context),
  55 + ].toSet(),
  56 + navigationDelegate: (NavigationRequest request) {
  57 + if (request.url.startsWith('https://www.youtube.com/')) {
  58 + print('blocking navigation to $request}');
  59 + return NavigationDecision.prevent;
  60 + }
  61 + print('allowing navigation to $request');
  62 + return NavigationDecision.navigate;
  63 + },
  64 + onPageStarted: (String url) {
  65 + print('Page started loading: $url');
  66 + },
  67 + onPageFinished: (String url) {
  68 + print('Page finished loading: $url');
  69 + },
  70 + gestureNavigationEnabled: true,
  71 + );
151 }), 72 }),
152 ); 73 );
153 } 74 }
154 75
155 - // JavascriptChannel _toasterJavascriptChannel(BuildContext context) {  
156 - // return JavascriptChannel(  
157 - // name: 'Toaster',  
158 - // onMessageReceived: (JavascriptMessage message) {  
159 - // ScaffoldMessenger.of(context).showSnackBar(  
160 - // SnackBar(content: Text(message.message)),  
161 - // );  
162 - // });  
163 - // } 76 + JavascriptChannel _toasterJavascriptChannel(BuildContext context) {
  77 + return JavascriptChannel(
  78 + name: 'Toaster',
  79 + onMessageReceived: (JavascriptMessage message) {
  80 + ScaffoldMessenger.of(context).showSnackBar(
  81 + SnackBar(content: Text(message.message)),
  82 + );
  83 + });
  84 + }
164 } 85 }
  86 +
1 -  
2 -  
3 -// import 'dart:async';  
4 -// import 'dart:convert';  
5 -// import 'dart:io';  
6 -  
7 -// import 'package:flutter/material.dart';  
8 -// import 'package:one_key/utils/event_bus.dart';  
9 -// import 'package:one_key/widgets/app_bar.dart';  
10 -// import 'package:one_key/widgets/system_app_bar.dart';  
11 -// import 'package:webview_flutter/webview_flutter.dart';  
12 -  
13 -// class WebViewPage extends StatefulWidget {  
14 -// @override  
15 -// _WebViewPageState createState() => _WebViewPageState();  
16 -// }  
17 -  
18 -// class _WebViewPageState extends State<WebViewPage> {  
19 -// final Completer<WebViewController> _controller =  
20 -// Completer<WebViewController>();  
21 -  
22 -// @override  
23 -// void initState() {  
24 -// super.initState();  
25 -// // Enable hybrid composition.  
26 -// if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView();  
27 -// }  
28 -  
29 -// @override  
30 -// void dispose() {  
31 -// // TODO: implement dispose  
32 -// EventBus().emit('changeStatusColor');  
33 -// super.dispose();  
34 -// }  
35 -  
36 -// @override  
37 -// Widget build(BuildContext context) {  
38 -// return Scaffold(  
39 -// // We're using a Builder here so we have a context that is below the Scaffold  
40 -// // to allow calling Scaffold.of(context) so we can show a snackbar.  
41 -// appBar: SystemAppBar(  
42 -// '周到安排商家',  
43 -// ),  
44 -// body: Builder(builder: (BuildContext context) {  
45 -// return WebView(  
46 -// initialUrl: "https://support.qq.com/product/152856",  
47 -// javascriptMode: JavascriptMode.unrestricted,  
48 -// onWebViewCreated: (WebViewController webViewController) {  
49 -// _controller.complete(webViewController);  
50 -// },  
51 -// // TODO(iskakaushik): Remove this when collection literals makes it to stable.  
52 -// // ignore: prefer_collection_literals  
53 -// javascriptChannels: <JavascriptChannel>[  
54 -// _toasterJavascriptChannel(context),  
55 -// ].toSet(),  
56 -// navigationDelegate: (NavigationRequest request) {  
57 -// if (request.url.startsWith('https://www.youtube.com/')) {  
58 -// print('blocking navigation to $request}');  
59 -// return NavigationDecision.prevent;  
60 -// }  
61 -// print('allowing navigation to $request');  
62 -// return NavigationDecision.navigate;  
63 -// },  
64 -// onPageStarted: (String url) {  
65 -// print('Page started loading: $url');  
66 -// },  
67 -// onPageFinished: (String url) {  
68 -// print('Page finished loading: $url');  
69 -// },  
70 -// gestureNavigationEnabled: true,  
71 -// );  
72 -// }),  
73 -// );  
74 -// }  
75 -  
76 -// JavascriptChannel _toasterJavascriptChannel(BuildContext context) {  
77 -// return JavascriptChannel(  
78 -// name: 'Toaster',  
79 -// onMessageReceived: (JavascriptMessage message) {  
80 -// ScaffoldMessenger.of(context).showSnackBar(  
81 -// SnackBar(content: Text(message.message)),  
82 -// );  
83 -// });  
84 -// }  
85 -// }  
86 -  
  1 +
  2 +// import 'package:flutter/material.dart';
  3 +// import 'package:one_key/utils/event_bus.dart';
  4 +// import 'package:one_key/widgets/system_app_bar.dart';
  5 +
  6 +// // import 'package:path_provider/path_provider.dart';
  7 +// import 'package:webview_flutter/webview_flutter.dart';
  8 +// // #docregion platform_imports
  9 +// // Import for Android features.
  10 +// import 'package:webview_flutter_android/webview_flutter_android.dart';
  11 +// // Import for iOS features.
  12 +// import 'package:webview_flutter_wkwebview/webview_flutter_wkwebview.dart';
  13 +
  14 +
  15 +// /**
  16 +// *
  17 +// * 帮助与反馈页面 功能暂时已经弃用
  18 +// */
  19 +
  20 +// class WebViewPage extends StatefulWidget {
  21 +// @override
  22 +// _WebViewPageState createState() => _WebViewPageState();
  23 +// }
  24 +
  25 +// class _WebViewPageState extends State<WebViewPage> {
  26 +// late WebViewController _controller = WebViewController();
  27 +// // late final WebViewController _controller;
  28 +// @override
  29 +// void initState() {
  30 +// super.initState();
  31 +// // Enable hybrid composition.
  32 +// // if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView();
  33 +// // #docregion platform_features
  34 +// late final PlatformWebViewControllerCreationParams params;
  35 +// if (WebViewPlatform.instance is WebKitWebViewPlatform) {
  36 +// params = WebKitWebViewControllerCreationParams(
  37 +// allowsInlineMediaPlayback: true,
  38 +// mediaTypesRequiringUserAction: const <PlaybackMediaTypes>{},
  39 +// );
  40 +// } else {
  41 +// params = const PlatformWebViewControllerCreationParams();
  42 +// }
  43 +
  44 +// final WebViewController controller =
  45 +// WebViewController.fromPlatformCreationParams(params);
  46 +// // #enddocregion platform_features
  47 +
  48 +// controller
  49 +// ..setJavaScriptMode(JavaScriptMode.unrestricted)
  50 +// ..setBackgroundColor(const Color(0x00000000))
  51 +// ..setNavigationDelegate(
  52 +// NavigationDelegate(
  53 +// onProgress: (int progress) {
  54 +// debugPrint('WebView is loading (progress : $progress%)');
  55 +// },
  56 +// onPageStarted: (String url) {
  57 +// debugPrint('Page started loading: $url');
  58 +// },
  59 +// onPageFinished: (String url) {
  60 +// debugPrint('Page finished loading: $url');
  61 +// },
  62 +// onWebResourceError: (WebResourceError error) {
  63 +// debugPrint('''
  64 +// Page resource error:
  65 +// code: ${error.errorCode}
  66 +// description: ${error.description}
  67 +// errorType: ${error.errorType}
  68 +// isForMainFrame: ${error.isForMainFrame}
  69 +// ''');
  70 +// },
  71 +// onNavigationRequest: (NavigationRequest request) {
  72 +// if (request.url.startsWith('https://www.youtube.com/')) {
  73 +// debugPrint('blocking navigation to ${request.url}');
  74 +// return NavigationDecision.prevent;
  75 +// }
  76 +// debugPrint('allowing navigation to ${request.url}');
  77 +// return NavigationDecision.navigate;
  78 +// },
  79 +// onUrlChange: (UrlChange change) {
  80 +// debugPrint('url change to ${change.url}');
  81 +// },
  82 +// onHttpAuthRequest: (HttpAuthRequest request) {
  83 +// // openDialog(request);
  84 +// },
  85 +// ),
  86 +// )
  87 +// ..addJavaScriptChannel(
  88 +// 'Toaster',
  89 +// onMessageReceived: (JavaScriptMessage message) {
  90 +// ScaffoldMessenger.of(context).showSnackBar(
  91 +// SnackBar(content: Text(message.message)),
  92 +// );
  93 +// },
  94 +// )
  95 +// ..loadRequest(Uri.parse("https://support.qq.com/product/152856"));
  96 +
  97 +// // #docregion platform_features
  98 +// if (controller.platform is AndroidWebViewController) {
  99 +// AndroidWebViewController.enableDebugging(true);
  100 +// (controller.platform as AndroidWebViewController)
  101 +// .setMediaPlaybackRequiresUserGesture(false);
  102 +// }
  103 +// // #enddocregion platform_features
  104 +
  105 +// _controller = controller;
  106 +// }
  107 +
  108 +// @override
  109 +// void dispose() {
  110 +// // TODO: implement dispose
  111 +// EventBus().emit('changeStatusColor');
  112 +// super.dispose();
  113 +// }
  114 +
  115 +// @override
  116 +// Widget build(BuildContext context) {
  117 +// return Scaffold(
  118 +// // We're using a Builder here so we have a context that is below the Scaffold
  119 +// // to allow calling Scaffold.of(context) so we can show a snackbar.
  120 +// appBar: SystemAppBar(
  121 +// '周到安排商家',
  122 +// ),
  123 +// body: Builder(builder: (BuildContext context) {
  124 +// return WebViewWidget(controller: _controller);
  125 +// // initialUrl: "https://support.qq.com/product/152856",
  126 +// // javascriptMode: JavascriptMode.unrestricted,
  127 +// // onWebViewCreated: (WebViewController webViewController) {
  128 +// // _controller.complete(webViewController);
  129 +// // },
  130 +// // // TODO(iskakaushik): Remove this when collection literals makes it to stable.
  131 +// // // ignore: prefer_collection_literals
  132 +// // javascriptChannels: <JavascriptChannel>[
  133 +// // _toasterJavascriptChannel(context),
  134 +// // ].toSet(),
  135 +// // navigationDelegate: (NavigationRequest request) {
  136 +// // if (request.url.startsWith('https://www.youtube.com/')) {
  137 +// // print('blocking navigation to $request}');
  138 +// // return NavigationDecision.prevent;
  139 +// // }
  140 +// // print('allowing navigation to $request');
  141 +// // return NavigationDecision.navigate;
  142 +// // },
  143 +// // onPageStarted: (String url) {
  144 +// // print('Page started loading: $url');
  145 +// // },
  146 +// // onPageFinished: (String url) {
  147 +// // print('Page finished loading: $url');
  148 +// // },
  149 +// // gestureNavigationEnabled: true,
  150 +// // );
  151 +// }),
  152 +// );
  153 +// }
  154 +
  155 +// // JavascriptChannel _toasterJavascriptChannel(BuildContext context) {
  156 +// // return JavascriptChannel(
  157 +// // name: 'Toaster',
  158 +// // onMessageReceived: (JavascriptMessage message) {
  159 +// // ScaffoldMessenger.of(context).showSnackBar(
  160 +// // SnackBar(content: Text(message.message)),
  161 +// // );
  162 +// // });
  163 +// // }
  164 +// }
@@ -120,7 +120,9 @@ class UpdateModelMy { @@ -120,7 +120,9 @@ class UpdateModelMy {
120 versionCode = info.buildNumber; //1 120 versionCode = info.buildNumber; //1
121 } 121 }
122 String make = "3"; 122 String make = "3";
123 - if (Platform.isIOS) { 123 + if (Platform.isAndroid) {
  124 + make = "3";
  125 + } else if (Platform.isIOS) {
124 make = "4"; 126 make = "4";
125 } else if (Platform.isOhos) { 127 } else if (Platform.isOhos) {
126 make = "5"; 128 make = "5";
@@ -132,7 +132,7 @@ import 'package:one_key/pages/sms/sms_page.dart'; @@ -132,7 +132,7 @@ import 'package:one_key/pages/sms/sms_page.dart';
132 import 'package:one_key/pages/table/select_table_page.dart'; 132 import 'package:one_key/pages/table/select_table_page.dart';
133 import 'package:one_key/pages/my/photo_type/table_photo_manager_page.dart'; 133 import 'package:one_key/pages/my/photo_type/table_photo_manager_page.dart';
134 import 'package:one_key/pages/table/table_manager_page.dart'; 134 import 'package:one_key/pages/table/table_manager_page.dart';
135 -import 'package:one_key/pages/webview/webview_page.dart'; 135 +import 'package:one_key/pages/webview/webview_page_ohos.dart';
136 import 'package:one_key/pages_sim/my/customer_type/store_customer/customer_list_page.dart'; 136 import 'package:one_key/pages_sim/my/customer_type/store_customer/customer_list_page.dart';
137 import 'package:one_key/pages_sim/my/marketing_center/customer_notice_setting_page.dart'; 137 import 'package:one_key/pages_sim/my/marketing_center/customer_notice_setting_page.dart';
138 import 'package:one_key/pages_sim/my/store_base_info_page.dart'; 138 import 'package:one_key/pages_sim/my/store_base_info_page.dart';
@@ -296,7 +296,7 @@ import '../pages/order_advance/order_create_temporary_page.dart'; @@ -296,7 +296,7 @@ import '../pages/order_advance/order_create_temporary_page.dart';
296 import '../pages/order_advance/order_edit_list_show_page.dart'; 296 import '../pages/order_advance/order_edit_list_show_page.dart';
297 import '../pages/order_advance/order_preview_page.dart'; 297 import '../pages/order_advance/order_preview_page.dart';
298 import '../pages/order_advance/order_share_page.dart'; 298 import '../pages/order_advance/order_share_page.dart';
299 -import '../pages/webview/webview_page_anzhuo.dart'; 299 +import '../pages/webview/webview_page.dart';
300 import '../pages_sim/detail/handle_online_page.dart'; 300 import '../pages_sim/detail/handle_online_page.dart';
301 import '../pages_sim/detail/notebook_detail_page.dart'; 301 import '../pages_sim/detail/notebook_detail_page.dart';
302 import '../pages_sim/home/home_page.dart'; 302 import '../pages_sim/home/home_page.dart';
@@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
4 "requires": true, 4 "requires": true,
5 "packages": { 5 "packages": {
6 "../../../../../../fvm/versions/custom_3.27.4-ohos-dev/packages/flutter_tools/hvigor": { 6 "../../../../../../fvm/versions/custom_3.27.4-ohos-dev/packages/flutter_tools/hvigor": {
  7 + "name": "flutter-hvigor-plugin",
7 "version": "1.0.0", 8 "version": "1.0.0",
8 "license": "ISC", 9 "license": "ISC",
9 "devDependencies": { 10 "devDependencies": {
@@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
9 } 9 }
10 }, 10 },
11 "../../../../../../fvm/versions/custom_3.27.4-ohos-dev/packages/flutter_tools/hvigor": { 11 "../../../../../../fvm/versions/custom_3.27.4-ohos-dev/packages/flutter_tools/hvigor": {
  12 + "name": "flutter-hvigor-plugin",
12 "version": "1.0.0", 13 "version": "1.0.0",
13 "license": "ISC", 14 "license": "ISC",
14 "devDependencies": { 15 "devDependencies": {
@@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
4 "requires": true, 4 "requires": true,
5 "packages": { 5 "packages": {
6 "../../../../../../fvm/versions/custom_3.27.4-ohos-dev/packages/flutter_tools/hvigor": { 6 "../../../../../../fvm/versions/custom_3.27.4-ohos-dev/packages/flutter_tools/hvigor": {
  7 + "name": "flutter-hvigor-plugin",
7 "version": "1.0.0", 8 "version": "1.0.0",
8 "license": "ISC", 9 "license": "ISC",
9 "devDependencies": { 10 "devDependencies": {
@@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
9 } 9 }
10 }, 10 },
11 "../../../../../../fvm/versions/custom_3.27.4-ohos-dev/packages/flutter_tools/hvigor": { 11 "../../../../../../fvm/versions/custom_3.27.4-ohos-dev/packages/flutter_tools/hvigor": {
  12 + "name": "flutter-hvigor-plugin",
12 "version": "1.0.0", 13 "version": "1.0.0",
13 "license": "ISC", 14 "license": "ISC",
14 "devDependencies": { 15 "devDependencies": {
@@ -7,12 +7,9 @@ import Foundation @@ -7,12 +7,9 @@ import Foundation
7 7
8 import audioplayers_darwin 8 import audioplayers_darwin
9 import connectivity_plus 9 import connectivity_plus
10 -import device_info_plus  
11 import file_selector_macos 10 import file_selector_macos
12 import flutter_app_badger 11 import flutter_app_badger
13 -import flutter_app_icon_badge  
14 import flutter_image_compress_macos 12 import flutter_image_compress_macos
15 -import flutter_inappwebview_macos  
16 import flutter_udid 13 import flutter_udid
17 import package_info 14 import package_info
18 import package_info_plus 15 import package_info_plus
@@ -28,12 +25,9 @@ import video_player_avfoundation @@ -28,12 +25,9 @@ import video_player_avfoundation
28 func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 25 func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
29 AudioplayersDarwinPlugin.register(with: registry.registrar(forPlugin: "AudioplayersDarwinPlugin")) 26 AudioplayersDarwinPlugin.register(with: registry.registrar(forPlugin: "AudioplayersDarwinPlugin"))
30 ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin")) 27 ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin"))
31 - DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))  
32 FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) 28 FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
33 FlutterAppBadgerPlugin.register(with: registry.registrar(forPlugin: "FlutterAppBadgerPlugin")) 29 FlutterAppBadgerPlugin.register(with: registry.registrar(forPlugin: "FlutterAppBadgerPlugin"))
34 - FlutterAppIconBadgePlugin.register(with: registry.registrar(forPlugin: "FlutterAppIconBadgePlugin"))  
35 FlutterImageCompressMacosPlugin.register(with: registry.registrar(forPlugin: "FlutterImageCompressMacosPlugin")) 30 FlutterImageCompressMacosPlugin.register(with: registry.registrar(forPlugin: "FlutterImageCompressMacosPlugin"))
36 - InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin"))  
37 FlutterUdidPlugin.register(with: registry.registrar(forPlugin: "FlutterUdidPlugin")) 31 FlutterUdidPlugin.register(with: registry.registrar(forPlugin: "FlutterUdidPlugin"))
38 FLTPackageInfoPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlugin")) 32 FLTPackageInfoPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlugin"))
39 FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) 33 FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
1 -import type common from "@ohos:app.ability.common";  
2 -import fs from "@ohos:file.fs";  
3 -import util from "@ohos:util";  
4 -import Log from "@normalized:N&&&@ohos/flutter_ohos/src/main/ets/util/Log&1.0.0-2317265cd5";  
5 -const TAG = "FileUtils";  
6 -export default class FileUtils {  
7 - static getPathFromUri(context: common.Context | null, uri: string, defExtension?: string) {  
8 - Log.i(TAG, "getPathFromUri : " + uri);  
9 - let inputFile: fs.File;  
10 - try {  
11 - inputFile = fs.openSync(uri);  
12 - }  
13 - catch (err) {  
14 - Log.e(TAG, "open uri file failed err:" + err);  
15 - return null;  
16 - }  
17 - if (inputFile == null) {  
18 - return null;  
19 - }  
20 - const uuid = util.generateRandomUUID();  
21 - if (!context) {  
22 - return;  
23 - }  
24 - {  
25 - const targetDirectoryPath = context.cacheDir + "/" + uuid;  
26 - try {  
27 - fs.mkdirSync(targetDirectoryPath);  
28 - let targetDir = fs.openSync(targetDirectoryPath);  
29 - Log.i(TAG, "mkdirSync success targetDirectoryPath:" + targetDirectoryPath + " fd: " + targetDir.fd);  
30 - fs.closeSync(targetDir);  
31 - }  
32 - catch (err) {  
33 - Log.e(TAG, "mkdirSync failed err:" + err);  
34 - return null;  
35 - }  
36 - const inputFilePath = uri.substring(uri.lastIndexOf("/") + 1);  
37 - const inputFilePathSplits = inputFilePath.split(".");  
38 - Log.i(TAG, "getPathFromUri inputFilePath: " + inputFilePath);  
39 - const outputFileName = inputFilePathSplits[0];  
40 - let extension: string;  
41 - if (inputFilePathSplits.length == 2) {  
42 - extension = "." + inputFilePathSplits[1];  
43 - }  
44 - else {  
45 - if (defExtension) {  
46 - extension = defExtension;  
47 - }  
48 - else {  
49 - extension = ".jpg";  
50 - }  
51 - }  
52 - const outputFilePath = targetDirectoryPath + "/" + outputFileName + extension;  
53 - const outputFile = fs.openSync(outputFilePath, fs.OpenMode.CREATE);  
54 - try {  
55 - Log.i(TAG, "copyFileSync inputFile fd:" + inputFile.fd + " outputFile fd:" + outputFile.fd);  
56 - fs.copyFileSync(inputFile.fd, outputFilePath);  
57 - }  
58 - catch (err) {  
59 - Log.e(TAG, "copyFileSync failed err:" + err);  
60 - return null;  
61 - }  
62 - finally {  
63 - fs.closeSync(inputFile);  
64 - fs.closeSync(outputFile);  
65 - }  
66 - return outputFilePath;  
67 - }  
68 - }  
69 -}  
1 -{"@ohos/flutter_ohos":{"packageName":"@ohos/flutter_ohos","bundleName":"","moduleName":"","version":"1.0.0-2317265cd5","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"app_update_check_plugin":{"packageName":"app_update_check_plugin","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"audioplayers_ohos":{"packageName":"audioplayers_ohos","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"connectivity_plus":{"packageName":"connectivity_plus","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"contants_select":{"packageName":"contants_select","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"csp_amap_flutter_location":{"packageName":"csp_amap_flutter_location","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"csp_amap_flutter_map":{"packageName":"csp_amap_flutter_map","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"device_info_plus":{"packageName":"device_info_plus","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"flutter_app_icon_badge":{"packageName":"flutter_app_icon_badge","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"flutter_barcode_scanner_ohos":{"packageName":"flutter_barcode_scanner_ohos","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"flutter_bugly":{"packageName":"flutter_bugly","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"flutter_document_picker":{"packageName":"flutter_document_picker","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"Index.ets","isSO":false,"dependencyAlias":""},"flutter_downloader":{"packageName":"flutter_downloader","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"Index.ets","isSO":false,"dependencyAlias":""},"flutter_image_compress_ohos":{"packageName":"flutter_image_compress_ohos","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"flutter_inappwebview_ohos":{"packageName":"flutter_inappwebview_ohos","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"flutter_keyboard_visibility":{"packageName":"flutter_keyboard_visibility","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"flutter_native_contact_picker":{"packageName":"flutter_native_contact_picker","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"flutter_native_image":{"packageName":"flutter_native_image","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"flutter_sms":{"packageName":"flutter_sms","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"flutter_statusbarcolor_ns_ohos":{"packageName":"flutter_statusbarcolor_ns_ohos","bundleName":"","moduleName":"","version":"1.0.1","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"flutter_udid":{"packageName":"flutter_udid","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"Index.ets","isSO":false,"dependencyAlias":""},"fluttertoast":{"packageName":"fluttertoast","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"fluwx":{"packageName":"fluwx","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"image_cropper":{"packageName":"image_cropper","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"image_gallery_saver":{"packageName":"image_gallery_saver","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"image_picker_ohos":{"packageName":"image_picker_ohos","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"integration_test":{"packageName":"integration_test","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"Index.ets","isSO":false,"dependencyAlias":""},"open_filex":{"packageName":"open_filex","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"Index.ets","isSO":false,"dependencyAlias":""},"package_info_plus":{"packageName":"package_info_plus","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"path_provider_ohos":{"packageName":"path_provider_ohos","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"permission_handler_ohos":{"packageName":"permission_handler_ohos","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"photo_manager":{"packageName":"photo_manager","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"save_file":{"packageName":"save_file","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"shared_preferences_ohos":{"packageName":"shared_preferences_ohos","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"sign_in_with_apple":{"packageName":"sign_in_with_apple","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"Index.ets","isSO":false,"dependencyAlias":""},"sqflite":{"packageName":"sqflite","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"tpns_flutter_plugin":{"packageName":"tpns_flutter_plugin","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"url_launcher_ohos":{"packageName":"url_launcher_ohos","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"video_compress":{"packageName":"video_compress","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"video_player_ohos":{"packageName":"video_player_ohos","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"Index.ets","isSO":false,"dependencyAlias":""},"video_thumbnail":{"packageName":"video_thumbnail","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"index.ets","isSO":false,"dependencyAlias":""},"webview_flutter_ohos":{"packageName":"webview_flutter_ohos","bundleName":"","moduleName":"","version":"1.0.0","entryPath":"Index.ets","isSO":false,"dependencyAlias":""},"@amap/amap_lbs_common":{"packageName":"@amap/amap_lbs_common","bundleName":"","moduleName":"","version":"1.2.3","entryPath":"Index","isSO":false,"dependencyAlias":""},"@amap/amap_lbs_location":{"packageName":"@amap/amap_lbs_location","bundleName":"","moduleName":"","version":"1.2.3","entryPath":"Index","isSO":false,"dependencyAlias":""},"@amap/amap_lbs_search":{"packageName":"@amap/amap_lbs_search","bundleName":"","moduleName":"","version":"1.0.2","entryPath":"Index","isSO":false,"dependencyAlias":""},"@amap/amap_lbs_map3d":{"packageName":"@amap/amap_lbs_map3d","bundleName":"","moduleName":"","version":"2.2.5","entryPath":"Index","isSO":false,"dependencyAlias":""},"bugly":{"packageName":"bugly","bundleName":"","moduleName":"","version":"0.5.0","entryPath":"Index.js","isSO":false,"dependencyAlias":""},"@tencent/wechat_open_sdk":{"packageName":"@tencent/wechat_open_sdk","bundleName":"","moduleName":"","version":"1.0.15","entryPath":"Index.js","isSO":false,"dependencyAlias":""},"tpns":{"packageName":"tpns","bundleName":"","moduleName":"","version":"1.0.5","entryPath":"index.js","isSO":false,"dependencyAlias":""},"dayjs":{"packageName":"dayjs","bundleName":"","moduleName":"","version":"1.11.13","entryPath":"dayjs.min.js","isSO":false,"dependencyAlias":""},"libvideocompress.so":{"packageName":"libvideocompress.so","bundleName":"","moduleName":"","version":"","entryPath":"Index","isSO":true,"dependencyAlias":""},"@ohos/crypto-js":{"packageName":"@ohos/crypto-js","bundleName":"","moduleName":"","version":"2.0.5","entryPath":"index.ts","isSO":false,"dependencyAlias":""},"libAMapOpenLocation.so":{"packageName":"libAMapOpenLocation.so","bundleName":"","moduleName":"","version":"","entryPath":"index","isSO":true,"dependencyAlias":""},"libAMapOpenMap.so":{"packageName":"libAMapOpenMap.so","bundleName":"","moduleName":"","version":"","entryPath":"index","isSO":true,"dependencyAlias":""},"libbuglynative.so":{"packageName":"libbuglynative.so","bundleName":"","moduleName":"","version":"","entryPath":"index","isSO":true,"dependencyAlias":""},"libbuglyxlog.so":{"packageName":"libbuglyxlog.so","bundleName":"","moduleName":"","version":"","entryPath":"index","isSO":true,"dependencyAlias":""},"libbuglydiag.so":{"packageName":"libbuglydiag.so","bundleName":"","moduleName":"","version":"","entryPath":"index","isSO":true,"dependencyAlias":""},"pako":{"packageName":"pako","bundleName":"","moduleName":"","version":"2.1.0","entryPath":"index.js","isSO":false,"dependencyAlias":""},"@ohos/hypium":{"packageName":"@ohos/hypium","bundleName":"","moduleName":"","version":"1.0.6","entryPath":"index.js","isSO":false,"dependencyAlias":""},"entry":{"packageName":"entry","bundleName":"","moduleName":"","version":"","entryPath":"src/main/","isSO":false,"dependencyAlias":""},"libentry.so":{"packageName":"libentry.so","bundleName":"","moduleName":"","version":"","entryPath":"","isSO":true,"dependencyAlias":""},"libflutter.so":{"packageName":"libflutter.so","bundleName":"","moduleName":"","version":"","entryPath":"","isSO":true,"dependencyAlias":""},"libc++_shared.so":{"packageName":"libc++_shared.so","bundleName":"","moduleName":"","version":"","entryPath":"","isSO":true,"dependencyAlias":""},"libtpnsmqttasync.so":{"packageName":"libtpnsmqttasync.so","bundleName":"","moduleName":"","version":"","entryPath":"","isSO":true,"dependencyAlias":""},"libtpnscipher.so":{"packageName":"libtpnscipher.so","bundleName":"","moduleName":"","version":"","entryPath":"","isSO":true,"dependencyAlias":""}}  
1 -{  
2 - "layered-image": {  
3 - "background": "$media:150994946",  
4 - "foreground": "$media:150994947"  
5 - }  
6 -}  
1 -../../../oh_modules/.ohpm/@ohos+flutter_ohos@z+esrfzju6x1o3bcfuku8xtvaawms8gp1tiq996zf1o=/oh_modules/@ohos/flutter_ohos  
1 -../../../library/app_update_check_plugin/ohos  
1 -../../../../../.pub-cache/git/flutter_audioplayers-5b1f0f972b200b543b5ac27c46f8efba63662e12/packages/audioplayers_ohos/ohos  
1 -../../../../../.pub-cache/git/flutter_plus_plugins-8720286d1b4b664dbc1d87ba169125242d4f10fb/packages/connectivity_plus/connectivity_plus/ohos  
1 -../../../library/contants_select/ohos  
1 -../../../library/csp_amap_flutter_location-1.0.2/ohos  
1 -../../../library/csp_amap_flutter_map-10106fa7e336393b5af648e3441d9a19d0ad7bad_new/ohos  
1 -../../../../../.pub-cache/git/flutter_plus_plugins-9f92933f2ac78bb3d7ec534f22bc3183a257fbb9/packages/device_info_plus/device_info_plus/ohos  
1 -../../../../../.pub-cache/git/flutter_app_icon_badge-87a21b24a2d160623c74ff705c01ae5e29be7d25/ohos  
1 -../../../library/fluttertpc_flutter_barcode_scanner-af5d0e6d2bc53977f979c4f2b852f46274dc8405_new/ohos/ohos  
1 -../../../../../.pub-cache/hosted/pub.flutter-io.cn/flutter_bugly-1.1.0/ohos  
1 -../../../../../.pub-cache/git/fluttertpc_flutter_document_picker-ffd471d268656455a776e11d43ea86f8f500b9eb/ohos  
1 -../../../../../.pub-cache/git/fluttertpc_flutter_downloader-026ef4fcb90250e5f85dd3f2083e25512df6395a/ohos  
1 -../../../../../.pub-cache/hosted/pub.flutter-io.cn/flutter_image_compress_ohos-0.0.3/ohos  
1 -../../../../../.pub-cache/git/flutter_inappwebview-04b233befaeaa500d89e46b510ec072dd49dc5ee/flutter_inappwebview_ohos/ohos  
1 -../../../../../.pub-cache/git/flutter_keyboard_visibility-479318b7632199849ec43b44d89ecb81fa0f29bc/flutter_keyboard_visibility/ohos  
1 -../../../../../.pub-cache/git/flutter_native_contact_picker-b994d5f5b567a20513ba90ed60c3c311b661e7d7/ohos  
1 -../../../../../.pub-cache/git/flutter_native_image-c584b4a15afdef3f90b9a648a55809ec959a56b8/ohos  
1 -../../../../../.pub-cache/git/fluttertpc_flutter_sms-b91cabe9da18110ddf67e9114083b7699cdec588/ohos  
1 -../../../../../.pub-cache/git/fluttertpc_flutter_statusbarcolor_ns-785d70de3b6c9db5d5f477c734f515f40685f4ac/ohos/ohos  
1 -../../../../../.pub-cache/git/fluttertpc_flutter_udid-6b4b0306efd2b981b38baaf3ae0c8a38048fc244/ohos  
1 -../../../../../.pub-cache/git/flutter_fluttertoast-54a9ccaf32fbf0e53e0ce16ced890ebc49e04599/ohos  
1 -../../../../../.pub-cache/hosted/pub.flutter-io.cn/fluwx-5.7.5/ohos  
1 -../../../library/fluttertpc_image_cropper-65c2c99891882ea59732959a672f3d5993a837bb_new/image_cropper/ohos  
1 -../../../../../.pub-cache/git/flutter_image_gallery_saver-dd2f556450707bc9029ddfd475aa3142bb13aa98/ohos  
1 -../../../../../.pub-cache/git/flutter_packages-213ce425e799abcd6c8c4a1864adc7336add0145/packages/image_picker/image_picker_ohos/ohos  
1 -../../../../../fvm/versions/custom_3.27.4-ohos-dev/packages/integration_test/ohos  
1 -../../../../../.pub-cache/git/flutter_plus_plugins-0eb41c70f961f124a987b8de59c9a26ca919af17/packages/package_info_plus/package_info_plus/ohos  
1 -../../../../../.pub-cache/git/flutter_packages-759e65b17c9ddf365594b700b9ab7d13b87adbe9/packages/path_provider/path_provider_ohos/ohos  
1 -../../../../../.pub-cache/git/flutter_permission_handler-2b85757fa47bffca7b43fa224051cd979de106c2/permission_handler_ohos/ohos  
1 -../../../../../.pub-cache/git/flutter_photo_manager-5725d1e0c60e96e694fb9bfd163929da227b6dcb/ohos  
1 -../../../library/save_file/ohos  
1 -../../../../../.pub-cache/git/flutter_packages-759e65b17c9ddf365594b700b9ab7d13b87adbe9/packages/shared_preferences/shared_preferences_ohos/ohos  
1 -../../../../../.pub-cache/git/fluttertpc_dart_packages-fe6c48868bd3f3ce8ad599ce9a8c0508be4b41f7/packages/sign_in_with_apple/sign_in_with_apple/ohos  
1 -../../../../../.pub-cache/git/flutter_sqflite-a1f67c8d86367fbc35bd35052afae57192a575d2/sqflite/ohos  
1 -../../../library/TPNS-Flutter-Plugin-a5349371525462b1d1b6cfa4cf4d2a59503f1435_new/ohos