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 {
ndk {
//选择要添加的对应 cpu 类型的 .so 库。
abiFilters 'arm64-v8a', 'x86_64', 'mips64' //魅族64位,不支持32位
// abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'x86_64','x86', 'mips', 'mips64'
// abiFilters 'arm64-v8a', 'x86_64', 'mips64' //魅族64位,不支持32位
abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'x86_64','x86', 'mips', 'mips64'
}
lintOptions {
... ...
import 'package:csp_amap_flutter_base/csp_amap_flutter_base.dart';
// import 'package:csp_amap_flutter_base/csp_amap_flutter_base.dart';
class ConstConfig {
static const AMapApiKey amapApiKeys = AMapApiKey(
androidKey: '900f72eeee0f21e435cebb0ef155582a', //测试key
iosKey: '4dfdec97b7bf0b8c13e94777103015a9', //测试key
ohosKey: '7c2081e92ec65bfffa2df0a5464f0c7b'); //我的账户下面的ceshikey
static const AMapPrivacyStatement amapPrivacyStatement =
AMapPrivacyStatement(hasContains: true, hasShow: true, hasAgree: true);
}
// class ConstConfig {
// static const AMapApiKey amapApiKeys = AMapApiKey(
// androidKey: '900f72eeee0f21e435cebb0ef155582a', //测试key
// iosKey: '4dfdec97b7bf0b8c13e94777103015a9', //测试key
// ohosKey: '7c2081e92ec65bfffa2df0a5464f0c7b'); //我的账户下面的ceshikey
// static const AMapPrivacyStatement amapPrivacyStatement =
// AMapPrivacyStatement(hasContains: true, hasShow: true, hasAgree: true);
// }
... ...
// import 'dart:async';
// import 'package:amap_map_fluttify/amap_map_fluttify.dart';
// import 'package:flutter/cupertino.dart';
// import 'package:flutter/material.dart';
// import 'package:flutter_easyrefresh/easy_refresh.dart';
// import 'package:one_key/res/colors.dart';
// import 'package:one_key/utils/misc.dart';
// import 'package:one_key/utils/screen_util.dart';
// import 'package:one_key/utils/utils.dart';
// import 'package:one_key/widgets/system_app_bar.dart';
// import 'package:permission_handler/permission_handler.dart';
// import '../../utils/common_utils.dart';
// // import 'package:demo/resources/custom_text_style.dart';
// // import 'package:demo/utils/misc.dart';
// // import 'package:demo/widgets/network_state/page_loading.dart';
// class MapChoicePointPage extends StatefulWidget {
// final String? long;
// final String? lat;
// MapChoicePointPage({Key? key, this.long, this.lat}) : super(key: key);
// @override
// _MapChoicePointPageState createState() => _MapChoicePointPageState();
// }
// class _MapChoicePointPageState extends State<MapChoicePointPage> {
// AmapController? _controller;
// List<Poi>? poiList;
// static List<PoiModel?> list = [];
// static List<PoiModel> searchlist = [];
// PoiModel? poiModel;
// String keyword = "";
// String? address = "";
// bool isloading = true;
// double latitude = 39.684670899;
// double longitude = 118.17630045;
// double latitudeLocation = 39.684670899;
// double longitudeLocation = 118.17630045;
// List<InputTip> inputTipDatas = [];
// int page = 1;
// EasyRefreshController refreshController = EasyRefreshController();
// bool flag = true;
// @override
// void initState() {
// super.initState();
// if (widget.long != null && widget.long != '' && widget.long != 'null') {
// longitude = double.parse(widget.long!);
// }
// if (widget.lat != null && widget.lat != '' && widget.lat != 'null') {
// latitude = double.parse(widget.lat!);
// }
// WidgetsBinding.instance.addPostFrameCallback((_) async {
// _requestLocationPermission();
// // ama
// // let marker = new AMap.Marker({//添加标记点
// // position: this.position,
// // map: map
// });
// }
// // Future<bool> checkLocationPermission() async {
// // PermissionStatus permissionStatus = await Permission.location.status;
// // if (permissionStatus == PermissionStatus.granted) {
// // return true;
// // } else {
// // return false;
// // }
// // }
// /// 检查权限并定
// // _getLocationPermission() async {
// // if (!(await checkPermission(Permission.location))) {
// // //没有定位权限
// // //申请定位权限
// // _requestLocationPermission();
// // } else {
// // //去定位
// // _requestLocationPermission();
// // }
// // }
// /// 获取定位权限
// _requestLocationPermission() async {
// await AmapLocation.instance.updatePrivacyShow(true);
// await AmapLocation.instance.updatePrivacyAgree(true);
// bool canLocation = false;
// if (!(await checkPermission(Permission.location))) {
// //没有定位权限
// //申请定位权限
// canLocation = await requestPermission(Permission.location);
// } else {
// canLocation = true;
// }
// // bool canLocation = await requestPermission(Permission.location);
// // 单次定位
// if (canLocation) {
// Future.delayed(Duration(milliseconds: 200), () async {
// await AmapLocation.instance.updatePrivacyShow(true);
// await AmapLocation.instance.updatePrivacyAgree(true);
// final location = await AmapLocation.instance.fetchLocation(
// // needAddress: true,
// // mode: LocationAccuracy.High,
// // timeout: Duration(seconds: 10)
// );
// if (location.city == null || location.city == '') //网络不好,定位失败
// {
// // App.sp.setString("lat", "39.684670899");
// // App.sp.setString("lng", "118.17630045");
// } else {
// if (widget.long == null ||
// widget.long == '' ||
// widget.long == 'null') {
// latitude = location.latLng!.latitude;
// longitude = location.latLng!.longitude;
// if (_controller != null) {
// _controller!.setCenterCoordinate(LatLng(
// location.latLng!.latitude, location.latLng!.longitude));
// }
// page = 1;
// _loadData(
// LatLng(location.latLng!.latitude, location.latLng!.longitude));
// setState(() {});
// }
// latitudeLocation = location.latLng!.latitude;
// longitudeLocation = location.latLng!.longitude;
// }
// });
// } else {
// //无权限
// }
// }
// @override
// Widget build(BuildContext context) {
// return Scaffold(
// resizeToAvoidBottomInset: false, //防止底部布局被顶起
// appBar: SystemAppBar(
// '选择位置信息',
// onTap: () {
// if (Navigator.canPop(context)) {
// Navigator.pop(context);
// }
// },
// ),
// body: Column(
// children: <Widget>[
// // Theme(
// // data: new
// // ThemeData(
// // // primaryColor: MyColours.color_438E93,
// // // hintColor: MyColours.color_438E93),
// // child:
// // Container(
// // color: MyColours.color_438E93,
// // decoration: BoxDecoration(
// // color: MyColours.color_438E93,
// // boxShadow: [
// // BoxShadow(color: Colors.white, spreadRadius: 1),
// // ],
// // ),
// // padding: EdgeInsets.all(5),
// // child:
// // ),
// // ),
// // ListView.builder(
// // shrinkWrap: true,
// // itemCount: inputTipDatas.length,
// // itemBuilder: (context, index) {
// // InputTip inputTip = inputTipDatas[index];
// // return InkWell(
// // onTap: () {
// // // searchAroundAddress(inputTip.name ?? '');
// // // searchPoiId(inputTip.poiId ?? '');
// // // _loadData(inputTip.coordinate ??
// // // LatLng(latitude, longitude));
// // },
// // child: Container(
// // child: Row(
// // children: [
// // Text(
// // inputTip.name ?? '',
// // style: TextStyle(
// // fontSize: font(15),
// // color: MyColours.color_515151),
// // ),
// // HEmptyView(10),
// // Expanded(
// // child: Text(
// // (inputTip.district ?? '') +
// // (inputTip.address ?? ''),
// // style: TextStyle(
// // fontSize: font(13),
// // color: MyColours.color_999999),
// // ),
// // ),
// // ],
// // )));
// // })
// // ],
// // ),
// Stack(
// children: [
// Container(
// height: w(300),
// child: Stack(
// children: <Widget>[
// AmapView(
// showZoomControl: false,
// /// 是否显示指南针控件
// showCompass: true,
// /// 是否显示比例尺控件
// showScaleControl: true,
// /// 是否使能缩放手势
// zoomGesturesEnabled: true,
// /// 是否使能滚动手势
// scrollGesturesEnabled: true,
// /// 是否使能旋转手势
// rotateGestureEnabled: false,
// centerCoordinate: LatLng(latitude, longitude),
// maskDelay: Duration(milliseconds: 500),
// zoomLevel: 19,
// onMapCreated: (controller) async {
// _controller = controller;
// _controller!
// .setCenterCoordinate(LatLng(latitude, longitude));
// // if (await requestPermission(PermissionGroup.location)) {
// // await controller.showMyLocation(true);
// // await controller?.showLocateControl(true);
// // final latLng = await _controller?.getLocation(
// // delay: Duration(seconds: 2));
// // await enableFluttifyLog(false); // 关闭log
// // _loadData(latLng);
// // } else {
// // //无权限
// // _showLocPemWidget();
// // }
// },
// // markers: [],
// onMapMoveEnd: (MapMove move) async {
// latitude = move.coordinate!.latitude;
// longitude = move.coordinate!.longitude;
// page = 1;
// _loadData(move.coordinate!);
// },
// ),
// Center(
// child: Icon(
// Icons.place,
// size: w(32),
// color: Color(0xFFFF0000),
// ),
// ),
// Positioned(
// right: w(10),
// bottom: w(10),
// child: InkWell(
// onTap: () {
// _controller!.setCenterCoordinate(
// LatLng(latitudeLocation, longitudeLocation));
// },
// child: Container(
// decoration: BoxDecoration(
// color: MyColours.color_ffffff,
// borderRadius: BorderRadius.circular(r(5))),
// padding: EdgeInsets.all(w(5)),
// child: Image.asset(
// Utils.getImgPath('location_map'),
// width: w(25),
// ),
// )),
// )
// ],
// ),
// ),
// Positioned(
// top: w(10),
// left: w(20),
// right: w(20),
// child: Container(
// // height: w(45),
// padding: EdgeInsets.symmetric(vertical: w(10)),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(r(10))),
// child: TextField(
// textAlignVertical: TextAlignVertical.center,
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: font(15),
// ),
// controller:
// TextEditingController.fromValue(TextEditingValue(
// // 设置内容
// text: keyword,
// selection: TextSelection.fromPosition(TextPosition(
// affinity: TextAffinity.downstream,
// offset: keyword.length)),
// // 保持光标在最后
// )),
// decoration: InputDecoration(
// // border: b,
// // border: OutlineInputBorder(
// // borderRadius: BorderRadius.all(Radius.circular(40)),
// // ),
// border: OutlineInputBorder(borderSide: BorderSide.none),
// hintText: '输入关键字',
// isCollapsed: true,
// hintStyle: TextStyle(
// color: MyColours.color_999999, fontSize: font(15)),
// // contentPadding: const EdgeInsets.symmetric(
// // vertical: 8, horizontal: 1),
// prefixIconConstraints: BoxConstraints(maxWidth: w(40)),
// prefixIcon: Padding(
// padding: EdgeInsets.only(left: w(10), right: w(10)),
// child: SizedBox(
// width: w(30),
// child: Image.asset(
// Utils.getImgPath('search_black'),
// ))),
// suffixIconConstraints: BoxConstraints(maxWidth: w(32)),
// suffixIcon: InkWell(
// child: Padding(
// padding: EdgeInsets.only(left: w(10), right: w(10)),
// child: SizedBox(
// width: w(22),
// child: Image.asset(
// Utils.getImgPath('delete_black'),
// ))),
// onTap: () {
// keyword = "";
// setState(() {});
// },
// ),
// fillColor: Colors.white,
// filled: true,
// ),
// inputFormatters: [],
// //内容改变的回调
// onChanged: (text) {
// print('change $text');
// keyword = text;
// //搜索
// JhCommonUtils.debounce(
// () => _fetchInputTips(text.toString()));
// },
// //内容提交(按回车)的回调
// onSubmitted: (text) {
// print('submit $text');
// // 触发关闭弹出来的键盘。
// keyword = text;
// FocusScope.of(context).requestFocus(FocusNode());
// setState(() {
// // isloading = true;
// });
// // _fetchInputTips(text.toString());
// // searchAroundAddress(text.toString());
// },
// //按回车时调用
// onEditingComplete: () {
// print('onEditingComplete');
// },
// ),
// ),
// )
// ],
// ),
// Expanded(
// flex: 1,
// child: Visibility(
// visible: !isloading,
// maintainSize: false,
// maintainSemantics: false,
// maintainInteractivity: false,
// replacement: Center(
// child: CupertinoActivityIndicator(),
// ),
// child: EasyRefresh.custom(
// controller: refreshController,
// slivers: [
// SliverList(
// delegate: SliverChildBuilderDelegate(
// (BuildContext context, int position) {
// print("itemBuilder" + list.length.toString());
// PoiModel item = list[position]!;
// return InkWell(
// child: Column(
// children: <Widget>[
// Container(
// margin: EdgeInsets.only(
// top: 8, bottom: 5, left: 10),
// child: Row(
// children: <Widget>[
// Icon(
// Icons.place,
// size: 20.0,
// color: position == 0
// ? Colors.green
// : Colors.grey,
// ),
// Expanded(
// child: Text(item.title,
// style: TextStyle(
// fontSize: 16,
// color: position == 0
// ? Colors.green
// : Color(0xFF787878))))
// ],
// ),
// ),
// Container(
// margin: EdgeInsets.only(
// top: 5, bottom: 5, left: 18),
// alignment: Alignment.centerLeft,
// child: Text(
// item.address!,
// style: TextStyle(
// fontSize: 14,
// color: Color(0xFF646464),
// ),
// ),
// ),
// Divider(
// height: 1,
// )
// ],
// ),
// onTap: () async {
// // await _controller.setCenterCoordinate(
// // LatLng(item.latLng.latitude, item.latLng.longitude),
// // zoomLevel: 16);
// if (Navigator.canPop(context)) {
// Navigator.pop(context, {
// 'address': item.address,
// 'lat': item.latLng!.latitude.toString(),
// 'lng': item.latLng!.longitude.toString()
// });
// }
// },
// );
// },
// childCount: list.length,
// ),
// )
// ],
// onRefresh: () async {
// if (flag) {
// page = 1;
// _loadData(LatLng(latitude, longitude));
// }
// },
// onLoad: () async {
// if (flag) {
// page++;
// _loadData(LatLng(latitude, longitude),
// showloading: false);
// }
// },
// )),
// ),
// ],
// ),
// );
// }
// _fetchInputTips(String text) async {
// flag = false;
// page = 1;
// // setState(() {
// // isloading = true;
// // });
// /// 逆地理编码(坐标转地址)
// ///
// ///
// await AmapLocation.instance.updatePrivacyShow(true);
// await AmapLocation.instance.updatePrivacyAgree(true);
// LatLng latLng = LatLng(latitude, longitude);
// ReGeocode reGeocodeList = await AmapSearch.instance.searchReGeocode(latLng);
// // print(await reGeocodeList.toFutureString());
// address = reGeocodeList.formatAddress;
// await AmapLocation.instance.updatePrivacyShow(true);
// await AmapLocation.instance.updatePrivacyAgree(true);
// inputTipDatas = await AmapSearch.instance.fetchInputTips(
// text,
// city: "",
// );
// print(inputTipDatas);
// poiModel = new PoiModel("当前位置", address, latLng);
// list.clear();
// list.add(poiModel);
// for (var inputTip in inputTipDatas) {
// String? title = await inputTip.name ?? '';
// String? cityStr =
// await (inputTip.district ?? '') + (inputTip.address ?? '');
// LatLng? latLng = await inputTip.coordinate;
// list.add(new PoiModel(title.toString(), cityStr, latLng));
// }
// print(list);
// setState(() {
// // isloading = false;
// });
// }
// void _loadData(LatLng latLng, {showloading = true}) async {
// flag = true;
// setState(() {
// if (showloading) {
// isloading = true;
// }
// });
// /// 逆地理编码(坐标转地址)
// ///
// ///
// await AmapLocation.instance.updatePrivacyShow(true);
// await AmapLocation.instance.updatePrivacyAgree(true);
// if (page == 1) {
// ReGeocode reGeocodeList = await AmapSearch.instance.searchReGeocode(
// latLng,
// );
// // print(await reGeocodeList.toFutureString());
// address = reGeocodeList.formatAddress;
// poiModel = new PoiModel("当前位置", address, latLng);
// list.clear();
// list.add(poiModel);
// }
// final poiList =
// await AmapSearch.instance.searchAround(latLng, city: "", page: page);
// for (var poi in poiList) {
// String? title = await poi.title;
// String? cityName = await poi.cityName;
// String? provinceName = await poi.provinceName;
// String? address = await poi.address;
// LatLng? latLng = await poi.latLng;
// String? bussniss = poi.businessArea;
// list.add(new PoiModel(
// title.toString(),
// provinceName.toString() +
// cityName.toString() +
// address.toString() +
// bussniss.toString(),
// latLng));
// }
// setState(() {
// if (showloading) {
// isloading = false;
// }
// });
// }
// // void searchPoiId(String text) async {
// // await AmapLocation.instance.updatePrivacyShow(true);
// // await AmapLocation.instance.updatePrivacyAgree(true);
// // Poi? poi = await AmapSearch.instance.searchPoiId(
// // text,
// // );
// // print(poi);
// // }
// // void searchAroundAddress(String text) async {
// // await AmapLocation.instance.updatePrivacyShow(true);
// // await AmapLocation.instance.updatePrivacyAgree(true);
// // final poiList = await AmapSearch.instance.searchKeyword(
// // text,
// // city: "",
// // );
// // // final poiList = await AmapSearch.instance.searchAround(
// // // LatLng(latitude, longitude),
// // // city: "",
// // // radius: 100000000000000
// // // );
// // list.clear();
// // list.add(poiModel);
// // for (var poi in poiList) {
// // String? title = await poi.title;
// // LatLng? latLng = await poi.latLng;
// // String? cityName = await poi.cityName;
// // String? provinceName = await poi.provinceName;
// // String? address = await poi.address;
// // list.add(new PoiModel(
// // title.toString(),
// // provinceName.toString() + cityName.toString() + address.toString(),
// // latLng));
// // }
// // setState(() {
// // isloading = false;
// // FocusScope.of(context).requestFocus(FocusNode());
// // });
// // }
// }
// class PoiModel {
// LatLng? latLng;
// String title;
// String? address;
// PoiModel(this.title, this.address, this.latLng);
// }
import 'dart:async';
import 'package:amap_map_fluttify/amap_map_fluttify.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/misc.dart';
import 'package:one_key/utils/screen_util.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:permission_handler/permission_handler.dart';
import '../../utils/common_utils.dart';
// import 'package:demo/resources/custom_text_style.dart';
// import 'package:demo/utils/misc.dart';
// import 'package:demo/widgets/network_state/page_loading.dart';
class MapChoicePointPage extends StatefulWidget {
final String? long;
final String? lat;
MapChoicePointPage({Key? key, this.long, this.lat}) : super(key: key);
@override
_MapChoicePointPageState createState() => _MapChoicePointPageState();
}
class _MapChoicePointPageState extends State<MapChoicePointPage> {
AmapController? _controller;
List<Poi>? poiList;
static List<PoiModel?> list = [];
static List<PoiModel> searchlist = [];
PoiModel? poiModel;
String keyword = "";
String? address = "";
bool isloading = true;
double latitude = 39.684670899;
double longitude = 118.17630045;
double latitudeLocation = 39.684670899;
double longitudeLocation = 118.17630045;
List<InputTip> inputTipDatas = [];
int page = 1;
EasyRefreshController refreshController = EasyRefreshController();
bool flag = true;
@override
void initState() {
super.initState();
if (widget.long != null && widget.long != '' && widget.long != 'null') {
longitude = double.parse(widget.long!);
}
if (widget.lat != null && widget.lat != '' && widget.lat != 'null') {
latitude = double.parse(widget.lat!);
}
WidgetsBinding.instance.addPostFrameCallback((_) async {
_requestLocationPermission();
// ama
// let marker = new AMap.Marker({//添加标记点
// position: this.position,
// map: map
});
}
// Future<bool> checkLocationPermission() async {
// PermissionStatus permissionStatus = await Permission.location.status;
// if (permissionStatus == PermissionStatus.granted) {
// return true;
// } else {
// return false;
// }
// }
/// 检查权限并定
// _getLocationPermission() async {
// if (!(await checkPermission(Permission.location))) {
// //没有定位权限
// //申请定位权限
// _requestLocationPermission();
// } else {
// //去定位
// _requestLocationPermission();
// }
// }
/// 获取定位权限
_requestLocationPermission() async {
await AmapLocation.instance.updatePrivacyShow(true);
await AmapLocation.instance.updatePrivacyAgree(true);
bool canLocation = false;
if (!(await checkPermission(Permission.location))) {
//没有定位权限
//申请定位权限
canLocation = await requestPermission(Permission.location);
} else {
canLocation = true;
}
// bool canLocation = await requestPermission(Permission.location);
// 单次定位
if (canLocation) {
Future.delayed(Duration(milliseconds: 200), () async {
await AmapLocation.instance.updatePrivacyShow(true);
await AmapLocation.instance.updatePrivacyAgree(true);
final location = await AmapLocation.instance.fetchLocation(
// needAddress: true,
// mode: LocationAccuracy.High,
// timeout: Duration(seconds: 10)
);
if (location.city == null || location.city == '') //网络不好,定位失败
{
// App.sp.setString("lat", "39.684670899");
// App.sp.setString("lng", "118.17630045");
} else {
if (widget.long == null ||
widget.long == '' ||
widget.long == 'null') {
latitude = location.latLng!.latitude;
longitude = location.latLng!.longitude;
if (_controller != null) {
_controller!.setCenterCoordinate(LatLng(
location.latLng!.latitude, location.latLng!.longitude));
}
page = 1;
_loadData(
LatLng(location.latLng!.latitude, location.latLng!.longitude));
setState(() {});
}
latitudeLocation = location.latLng!.latitude;
longitudeLocation = location.latLng!.longitude;
}
});
} else {
//无权限
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: false, //防止底部布局被顶起
appBar: SystemAppBar(
'选择位置信息',
onTap: () {
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
},
),
body: Column(
children: <Widget>[
// Theme(
// data: new
// ThemeData(
// // primaryColor: MyColours.color_438E93,
// // hintColor: MyColours.color_438E93),
// child:
// Container(
// color: MyColours.color_438E93,
// decoration: BoxDecoration(
// color: MyColours.color_438E93,
// boxShadow: [
// BoxShadow(color: Colors.white, spreadRadius: 1),
// ],
// ),
// padding: EdgeInsets.all(5),
// child:
// ),
// ),
// ListView.builder(
// shrinkWrap: true,
// itemCount: inputTipDatas.length,
// itemBuilder: (context, index) {
// InputTip inputTip = inputTipDatas[index];
// return InkWell(
// onTap: () {
// // searchAroundAddress(inputTip.name ?? '');
// // searchPoiId(inputTip.poiId ?? '');
// // _loadData(inputTip.coordinate ??
// // LatLng(latitude, longitude));
// },
// child: Container(
// child: Row(
// children: [
// Text(
// inputTip.name ?? '',
// style: TextStyle(
// fontSize: font(15),
// color: MyColours.color_515151),
// ),
// HEmptyView(10),
// Expanded(
// child: Text(
// (inputTip.district ?? '') +
// (inputTip.address ?? ''),
// style: TextStyle(
// fontSize: font(13),
// color: MyColours.color_999999),
// ),
// ),
// ],
// )));
// })
// ],
// ),
Stack(
children: [
Container(
height: w(300),
child: Stack(
children: <Widget>[
AmapView(
showZoomControl: false,
/// 是否显示指南针控件
showCompass: true,
/// 是否显示比例尺控件
showScaleControl: true,
/// 是否使能缩放手势
zoomGesturesEnabled: true,
/// 是否使能滚动手势
scrollGesturesEnabled: true,
/// 是否使能旋转手势
rotateGestureEnabled: false,
centerCoordinate: LatLng(latitude, longitude),
maskDelay: Duration(milliseconds: 500),
zoomLevel: 19,
onMapCreated: (controller) async {
_controller = controller;
_controller!
.setCenterCoordinate(LatLng(latitude, longitude));
// if (await requestPermission(PermissionGroup.location)) {
// await controller.showMyLocation(true);
// await controller?.showLocateControl(true);
// final latLng = await _controller?.getLocation(
// delay: Duration(seconds: 2));
// await enableFluttifyLog(false); // 关闭log
// _loadData(latLng);
// } else {
// //无权限
// _showLocPemWidget();
// }
},
// markers: [],
onMapMoveEnd: (MapMove move) async {
latitude = move.coordinate!.latitude;
longitude = move.coordinate!.longitude;
page = 1;
_loadData(move.coordinate!);
},
),
Center(
child: Icon(
Icons.place,
size: w(32),
color: Color(0xFFFF0000),
),
),
Positioned(
right: w(10),
bottom: w(10),
child: InkWell(
onTap: () {
_controller!.setCenterCoordinate(
LatLng(latitudeLocation, longitudeLocation));
},
child: Container(
decoration: BoxDecoration(
color: MyColours.color_ffffff,
borderRadius: BorderRadius.circular(r(5))),
padding: EdgeInsets.all(w(5)),
child: Image.asset(
Utils.getImgPath('location_map'),
width: w(25),
),
)),
)
],
),
),
Positioned(
top: w(10),
left: w(20),
right: w(20),
child: Container(
// height: w(45),
padding: EdgeInsets.symmetric(vertical: w(10)),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(r(10))),
child: TextField(
textAlignVertical: TextAlignVertical.center,
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(15),
),
controller:
TextEditingController.fromValue(TextEditingValue(
// 设置内容
text: keyword,
selection: TextSelection.fromPosition(TextPosition(
affinity: TextAffinity.downstream,
offset: keyword.length)),
// 保持光标在最后
)),
decoration: InputDecoration(
// border: b,
// border: OutlineInputBorder(
// borderRadius: BorderRadius.all(Radius.circular(40)),
// ),
border: OutlineInputBorder(borderSide: BorderSide.none),
hintText: '输入关键字',
isCollapsed: true,
hintStyle: TextStyle(
color: MyColours.color_999999, fontSize: font(15)),
// contentPadding: const EdgeInsets.symmetric(
// vertical: 8, horizontal: 1),
prefixIconConstraints: BoxConstraints(maxWidth: w(40)),
prefixIcon: Padding(
padding: EdgeInsets.only(left: w(10), right: w(10)),
child: SizedBox(
width: w(30),
child: Image.asset(
Utils.getImgPath('search_black'),
))),
suffixIconConstraints: BoxConstraints(maxWidth: w(32)),
suffixIcon: InkWell(
child: Padding(
padding: EdgeInsets.only(left: w(10), right: w(10)),
child: SizedBox(
width: w(22),
child: Image.asset(
Utils.getImgPath('delete_black'),
))),
onTap: () {
keyword = "";
setState(() {});
},
),
fillColor: Colors.white,
filled: true,
),
inputFormatters: [],
//内容改变的回调
onChanged: (text) {
print('change $text');
keyword = text;
//搜索
JhCommonUtils.debounce(
() => _fetchInputTips(text.toString()));
},
//内容提交(按回车)的回调
onSubmitted: (text) {
print('submit $text');
// 触发关闭弹出来的键盘。
keyword = text;
FocusScope.of(context).requestFocus(FocusNode());
setState(() {
// isloading = true;
});
// _fetchInputTips(text.toString());
// searchAroundAddress(text.toString());
},
//按回车时调用
onEditingComplete: () {
print('onEditingComplete');
},
),
),
)
],
),
Expanded(
flex: 1,
child: Visibility(
visible: !isloading,
maintainSize: false,
maintainSemantics: false,
maintainInteractivity: false,
replacement: Center(
child: CupertinoActivityIndicator(),
),
child: EasyRefresh.custom(
controller: refreshController,
slivers: [
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int position) {
print("itemBuilder" + list.length.toString());
PoiModel item = list[position]!;
return InkWell(
child: Column(
children: <Widget>[
Container(
margin: EdgeInsets.only(
top: 8, bottom: 5, left: 10),
child: Row(
children: <Widget>[
Icon(
Icons.place,
size: 20.0,
color: position == 0
? Colors.green
: Colors.grey,
),
Expanded(
child: Text(item.title,
style: TextStyle(
fontSize: 16,
color: position == 0
? Colors.green
: Color(0xFF787878))))
],
),
),
Container(
margin: EdgeInsets.only(
top: 5, bottom: 5, left: 18),
alignment: Alignment.centerLeft,
child: Text(
item.address!,
style: TextStyle(
fontSize: 14,
color: Color(0xFF646464),
),
),
),
Divider(
height: 1,
)
],
),
onTap: () async {
// await _controller.setCenterCoordinate(
// LatLng(item.latLng.latitude, item.latLng.longitude),
// zoomLevel: 16);
if (Navigator.canPop(context)) {
Navigator.pop(context, {
'address': item.address,
'lat': item.latLng!.latitude.toString(),
'lng': item.latLng!.longitude.toString()
});
}
},
);
},
childCount: list.length,
),
)
],
onRefresh: () async {
if (flag) {
page = 1;
_loadData(LatLng(latitude, longitude));
}
},
onLoad: () async {
if (flag) {
page++;
_loadData(LatLng(latitude, longitude),
showloading: false);
}
},
)),
),
],
),
);
}
_fetchInputTips(String text) async {
flag = false;
page = 1;
// setState(() {
// isloading = true;
// });
/// 逆地理编码(坐标转地址)
///
///
await AmapLocation.instance.updatePrivacyShow(true);
await AmapLocation.instance.updatePrivacyAgree(true);
LatLng latLng = LatLng(latitude, longitude);
ReGeocode reGeocodeList = await AmapSearch.instance.searchReGeocode(latLng);
// print(await reGeocodeList.toFutureString());
address = reGeocodeList.formatAddress;
await AmapLocation.instance.updatePrivacyShow(true);
await AmapLocation.instance.updatePrivacyAgree(true);
inputTipDatas = await AmapSearch.instance.fetchInputTips(
text,
city: "",
);
print(inputTipDatas);
poiModel = new PoiModel("当前位置", address, latLng);
list.clear();
list.add(poiModel);
for (var inputTip in inputTipDatas) {
String? title = await inputTip.name ?? '';
String? cityStr =
await (inputTip.district ?? '') + (inputTip.address ?? '');
LatLng? latLng = await inputTip.coordinate;
list.add(new PoiModel(title.toString(), cityStr, latLng));
}
print(list);
setState(() {
// isloading = false;
});
}
void _loadData(LatLng latLng, {showloading = true}) async {
flag = true;
setState(() {
if (showloading) {
isloading = true;
}
});
/// 逆地理编码(坐标转地址)
///
///
await AmapLocation.instance.updatePrivacyShow(true);
await AmapLocation.instance.updatePrivacyAgree(true);
if (page == 1) {
ReGeocode reGeocodeList = await AmapSearch.instance.searchReGeocode(
latLng,
);
// print(await reGeocodeList.toFutureString());
address = reGeocodeList.formatAddress;
poiModel = new PoiModel("当前位置", address, latLng);
list.clear();
list.add(poiModel);
}
final poiList =
await AmapSearch.instance.searchAround(latLng, city: "", page: page);
for (var poi in poiList) {
String? title = await poi.title;
String? cityName = await poi.cityName;
String? provinceName = await poi.provinceName;
String? address = await poi.address;
LatLng? latLng = await poi.latLng;
String? bussniss = poi.businessArea;
list.add(new PoiModel(
title.toString(),
provinceName.toString() +
cityName.toString() +
address.toString() +
bussniss.toString(),
latLng));
}
setState(() {
if (showloading) {
isloading = false;
}
});
}
// void searchPoiId(String text) async {
// await AmapLocation.instance.updatePrivacyShow(true);
// await AmapLocation.instance.updatePrivacyAgree(true);
// Poi? poi = await AmapSearch.instance.searchPoiId(
// text,
// );
// print(poi);
// }
// void searchAroundAddress(String text) async {
// await AmapLocation.instance.updatePrivacyShow(true);
// await AmapLocation.instance.updatePrivacyAgree(true);
// final poiList = await AmapSearch.instance.searchKeyword(
// text,
// city: "",
// );
// // final poiList = await AmapSearch.instance.searchAround(
// // LatLng(latitude, longitude),
// // city: "",
// // radius: 100000000000000
// // );
// list.clear();
// list.add(poiModel);
// for (var poi in poiList) {
// String? title = await poi.title;
// LatLng? latLng = await poi.latLng;
// String? cityName = await poi.cityName;
// String? provinceName = await poi.provinceName;
// String? address = await poi.address;
// list.add(new PoiModel(
// title.toString(),
// provinceName.toString() + cityName.toString() + address.toString(),
// latLng));
// }
// setState(() {
// isloading = false;
// FocusScope.of(context).requestFocus(FocusNode());
// });
// }
}
class PoiModel {
LatLng? latLng;
String title;
String? address;
PoiModel(this.title, this.address, this.latLng);
}
... ...
import 'dart:async';
// import 'dart:js_interop';
// import 'dart:async';
// // import 'dart:js_interop';
import 'package:flutter/material.dart';
// import 'package:flutter/material.dart';
import 'package:csp_amap_flutter_map/csp_amap_flutter_map.dart';
import 'package:csp_amap_flutter_location/amap_flutter_location.dart';
import 'package:csp_amap_flutter_location/amap_location_option.dart';
import 'package:flutter/cupertino.dart';
// import 'package:csp_amap_flutter_map/csp_amap_flutter_map.dart';
// import 'package:csp_amap_flutter_location/amap_flutter_location.dart';
// import 'package:csp_amap_flutter_location/amap_location_option.dart';
// import 'package:flutter/cupertino.dart';
// import 'package:flutter/material.dart';
// // import 'package:flutter/material.dart';
import 'package:csp_amap_flutter_base/csp_amap_flutter_base.dart';
// import 'package:csp_amap_flutter_base/csp_amap_flutter_base.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:one_key/pages/create_store/const_config.dart';
import 'package:one_key/pages/create_store/map_inputs_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/common_utils.dart';
import 'package:one_key/utils/misc.dart';
import 'package:one_key/utils/screen_util.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:permission_handler/permission_handler.dart';
// import '../../utils/common_utils.dart';
// import 'package:demo/resources/custom_text_style.dart';
// import 'package:demo/utils/misc.dart';
// import 'package:demo/widgets/network_state/page_loading.dart';
class MapChoicePointPage extends StatefulWidget {
final String? long;
final String? lat;
MapChoicePointPage({Key? key, this.long, this.lat}) : super(key: key);
@override
_MapChoicePointPageState createState() => _MapChoicePointPageState();
}
class _MapChoicePointPageState extends State<MapChoicePointPage> {
late AMapController _mapController;
final double _minZoom = 3;
final double _maxZoom = 20;
String? _currentZoom;
// List<Poi>? poiList;
static List<PoiModel?> list = [];
static List<PoiModel> searchlist = [];
PoiModel? poiModel;
String keyword = "";
String? address = "";
bool isloading = true;
double latitude = 39.684670899;
double longitude = 118.17630045;
double latitudeLocation = 39.684670899;
double longitudeLocation = 118.17630045;
List<MapInputsModel> inputTipDatas = [];
int page = 1;
EasyRefreshController refreshController = EasyRefreshController();
bool flag = true;
/// 存储定位结果
Map<String, Object>? _locationResult;
/// 定位结果监听器
StreamSubscription<Map<String, Object>>? _locationListener;
/// 地理位置解析结果监听器
StreamSubscription<Map<String, Object>>? _geocodeSearchListener;
/// 高德定位插件实例
final AMapFlutterLocation _locationPlugin = new AMapFlutterLocation();
@override
void initState() {
super.initState();
if (widget.long != null && widget.long != '' && widget.long != 'null') {
longitude = double.parse(widget.long!);
}
if (widget.lat != null && widget.lat != '' && widget.lat != 'null') {
latitude = double.parse(widget.lat!);
}
WidgetsBinding.instance.addPostFrameCallback((_) async {
AMapInitializer.init(context, apiKey: ConstConfig.amapApiKeys);
AMapInitializer.updatePrivacyAgree(ConstConfig.amapPrivacyStatement);
AMapFlutterLocation.setApiKey("1dbf56e2e8a4d0e4cdc2df9efd36bc71",
"dfb64c0463cb53927914364b5c09aba0",
ohosKey: "7c2081e92ec65bfffa2df0a5464f0c7b");
/// 设置是否已经包含高德隐私政策并弹窗展示显示用户查看,如果未包含或者没有弹窗展示,高德定位SDK将不会工作
///
/// 高德SDK合规使用方案请参考官网地址:https://lbs.amap.com/news/sdkhgsy
/// <b>必须保证在调用定位功能之前调用, 建议首次启动App时弹出《隐私政策》并取得用户同意</b>
///
/// 高德SDK合规使用方案请参考官网地址:https://lbs.amap.com/news/sdkhgsy
///
/// [hasContains] 隐私声明中是否包含高德隐私政策说明
///
/// [hasShow] 隐私权政策是否弹窗展示告知用户
AMapFlutterLocation.updatePrivacyShow(true, true);
/// 设置是否已经取得用户同意,如果未取得用户同意,高德定位SDK将不会工作
///
/// 高德SDK合规使用方案请参考官网地址:https://lbs.amap.com/news/sdkhgsy
///
/// <b>必须保证在调用定位功能之前调用, 建议首次启动App时弹出《隐私政策》并取得用户同意</b>
///
/// [hasAgree] 隐私权政策是否已经取得用户同意
AMapFlutterLocation.updatePrivacyAgree(true);
_requestLocationPermission();
// ama
// let marker = new AMap.Marker({//添加标记点
// position: this.position,
// map: map
});
_geocodeSearchListener = _locationPlugin
.onGeocodeSearchChange()
.listen((Map<String, Object> result) {
// setState(() {
if (result.containsKey('errorCode')) {
Utils.showToast(result['errorInfo'].toString());
} else {
_locationResult = result;
print(_locationResult);
}
});
/// 注册定位结果监听
/// 通过监听器接收定位结果并更新UI
_locationListener = _locationPlugin
.onLocationChanged()
.listen((Map<String, Object> result) {
// setState(() {
if (result.containsKey('errorCode')) {
Utils.showToast(result['errorInfo'].toString());
} else {
_locationResult = result;
print(_locationResult);
if (result['latitude'] == null || result['latitude'] == '') //网络不好,定位失败
{
// App.sp.setString("lat", "39.684670899");
// App.sp.setString("lng", "118.17630045");
} else {
if (widget.long == null ||
widget.long == '' ||
widget.long == 'null') {
latitude = double.parse(result['latitude'].toString());
longitude = double.parse(result['longitude'].toString());
// if (_mapController != null) {
_mapController.moveCamera(
CameraUpdate.newLatLng(LatLng(latitude, longitude)));
// }
page = 1;
// _loadData(LatLng(latitude, longitude));
// setState(() {});
}
latitudeLocation = latitude;
longitudeLocation = longitude;
_mapController.moveCamera(
CameraUpdate.newLatLng(LatLng(latitudeLocation, longitudeLocation)),
animated: true,
);
_loadData(LatLng(latitude, longitude));
}
}
});
}
@override
void dispose() {
super.dispose();
/// 移除定位监听
/// 防止内存泄漏
if (null != _locationListener) {
_locationListener?.cancel();
}
if (null != _geocodeSearchListener) {
_geocodeSearchListener?.cancel();
}
/// 销毁定位
/// 释放定位资源
_locationPlugin.destroy();
}
// Future<bool> checkLocationPermission() async {
// PermissionStatus permissionStatus = await Permission.location.status;
// if (permissionStatus == PermissionStatus.granted) {
// return true;
// } else {
// return false;
// }
// }
/// 检查权限并定
// _getLocationPermission() async {
// if (!(await checkPermission(Permission.location))) {
// //没有定位权限
// //申请定位权限
// _requestLocationPermission();
// } else {
// //去定位
// _requestLocationPermission();
// }
// }
/// 设置定位参数
/// 配置定位选项,如精度、频率等
void _setLocationOption() {
AMapLocationOption locationOption = new AMapLocationOption();
/// 是否单次定位
/// false表示连续定位
locationOption.onceLocation = true;
/// 是否需要返回逆地理信息
/// true表示需要返回地址信息
locationOption.needAddress = true;
/// 是否需要返回逆地理编码信息
locationOption.locatingWithReGeocode = true;
/// 逆地理信息的语言类型
/// 默认为自动适配当前系统语言
locationOption.geoLanguage = GeoLanguage.DEFAULT;
/// iOS 14定位精度权限设置
/// 设置为模糊定位精度
locationOption.desiredLocationAccuracyAuthorizationMode =
AMapLocationAccuracyAuthorizationMode.ReduceAccuracy;
/// iOS 14精确定位目的key
/// 需要与info.plist中配置一致
locationOption.fullAccuracyPurposeKey = "AMapLocationScene";
/// 设置Android端连续定位的定位间隔
/// 单位:毫秒
locationOption.locationInterval = 2000;
/// 设置Android端的定位模式
/// 可选值:
/// [AMapLocationMode.Battery_Saving] 低功耗模式
/// [AMapLocationMode.Device_Sensors] 仅设备模式
/// [AMapLocationMode.Hight_Accuracy] 高精度模式
locationOption.locationMode = AMapLocationMode.Hight_Accuracy;
/// 设置iOS端的定位最小更新距离
/// -1表示不限制距离
locationOption.distanceFilter = -1;
/// 设置iOS端期望的定位精度
/// 可选值:
/// [DesiredAccuracy.Best] 最高精度
/// [DesiredAccuracy.BestForNavigation] 适用于导航场景的高精度
/// [DesiredAccuracy.NearestTenMeters] 10米
/// [DesiredAccuracy.Kilometer] 1000米
/// [DesiredAccuracy.ThreeKilometers] 3000米
locationOption.desiredAccuracy = DesiredAccuracy.Best;
/// 设置iOS端是否允许系统暂停定位
/// false表示不允许系统暂停定位
locationOption.pausesLocationUpdatesAutomatically = false;
/// 将定位参数设置给定位插件
_locationPlugin.setLocationOption(locationOption);
}
/// 获取定位权限
_requestLocationPermission() async {
/// [hasShow] 隐私权政策是否弹窗展示告知用户
AMapFlutterLocation.updatePrivacyShow(true, true);
/// [hasAgree] 隐私权政策是否已经取得用户同意
AMapFlutterLocation.updatePrivacyAgree(true);
// await AMapFlutterLocation.instance.updatePrivacyShow(true);
// await AmapLocation.instance.updatePrivacyAgree(true);
bool canLocation = false;
if (!(await checkPermission(Permission.location))) {
//没有定位权限
//申请定位权限
canLocation = await requestPermission(Permission.location);
} else {
canLocation = true;
}
// bool canLocation = await requestPermission(Permission.location);
// 单次定位
if (canLocation) {
Future.delayed(Duration(milliseconds: 200), () async {
/// [hasShow] 隐私权政策是否弹窗展示告知用户
AMapFlutterLocation.updatePrivacyShow(true, true);
/// [hasAgree] 隐私权政策是否已经取得用户同意
AMapFlutterLocation.updatePrivacyAgree(true);
_startLocation();
// final location = await AmapLocation.instance.fetchLocation(
// // needAddress: true,
// // mode: LocationAccuracy.High,
// // timeout: Duration(seconds: 10)
// );
// if (location.city == null || location.city == '') //网络不好,定位失败
// {
// // App.sp.setString("lat", "39.684670899");
// // App.sp.setString("lng", "118.17630045");
// } else {
// if (widget.long == null ||
// widget.long == '' ||
// widget.long == 'null') {
// latitude = location.latLng!.latitude;
// longitude = location.latLng!.longitude;
// if (_controller != null) {
// _controller!.setCenterCoordinate(LatLng(
// location.latLng!.latitude, location.latLng!.longitude));
// }
// page = 1;
// _loadData(
// LatLng(location.latLng!.latitude, location.latLng!.longitude));
// setState(() {});
// }
// latitudeLocation = location.latLng!.latitude;
// longitudeLocation = location.latLng!.longitude;
// }
});
} else {
//无权限
}
}
// 开始定位
/// 设置定位参数并启动定位
void _startLocation() {
/// 开始定位之前设置定位参数
_setLocationOption();
_locationPlugin.startLocation();
}
/// 停止定位
/// 停止定位服务
void _stopLocation() {
_locationPlugin.stopLocation();
}
void onMapCreated(AMapController controller) {
// setState(() {
_mapController = controller;
// _mapController.moveCamera(
// CameraUpdate.newLatLng(LatLng(latitudeLocation, longitudeLocation)),
// animated: true,
// );
// getApprovalNumber();
// });
}
/// 获取审图号
// void getApprovalNumber() async {
// //普通地图审图号
// String mapContentApprovalNumber =
// (await _mapController.getMapContentApprovalNumber());
// //卫星地图审图号
// String satelliteImageApprovalNumber =
// (await _mapController.getSatelliteImageApprovalNumber());
// print('地图审图号(普通地图): $mapContentApprovalNumber');
// print('地图审图号(卫星地图): $satelliteImageApprovalNumber');
// }
//移动视野
// void _onCameraMove(CameraPosition cameraPosition) {
// latitude = cameraPosition.target.latitude;
// longitude = cameraPosition.target.longitude;
// page = 1;
// _loadData(cameraPosition.target);
// }
//移动地图结束
void _onCameraMoveEnd(CameraPosition cameraPosition) {
setState(() {
_currentZoom = '当前缩放级别:${cameraPosition.zoom}';
});
_mapController.moveCamera(
CameraUpdate.zoomTo(cameraPosition.zoom),
animated: true,
);
latitude = cameraPosition.target.latitude;
longitude = cameraPosition.target.longitude;
page = 1;
_loadData(cameraPosition.target);
}
@override
Widget build(BuildContext context) {
final AMapWidget amap = AMapWidget(
initialCameraPosition:
CameraPosition(target: LatLng(latitude, longitude), zoom: 16),
onMapCreated: onMapCreated,
// onCameraMove: _onCameraMove,
onCameraMoveEnd: _onCameraMoveEnd,
minMaxZoomPreference: MinMaxZoomPreference(_minZoom, _maxZoom),
scaleEnabled: true,
);
return Scaffold(
resizeToAvoidBottomInset: false, //防止底部布局被顶起
appBar: SystemAppBar(
'选择位置信息',
onTap: () {
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
},
),
body: Column(
children: <Widget>[
// Theme(
// data: new
// ThemeData(
// // primaryColor: MyColours.color_438E93,
// // hintColor: MyColours.color_438E93),
// child:
// Container(
// color: MyColours.color_438E93,
// decoration: BoxDecoration(
// color: MyColours.color_438E93,
// boxShadow: [
// BoxShadow(color: Colors.white, spreadRadius: 1),
// ],
// ),
// padding: EdgeInsets.all(5),
// child:
// ),
// ),
// ListView.builder(
// shrinkWrap: true,
// itemCount: inputTipDatas.length,
// itemBuilder: (context, index) {
// InputTip inputTip = inputTipDatas[index];
// return InkWell(
// onTap: () {
// // searchAroundAddress(inputTip.name ?? '');
// // searchPoiId(inputTip.poiId ?? '');
// // _loadData(inputTip.coordinate ??
// // LatLng(latitude, longitude));
// },
// child: Container(
// child: Row(
// children: [
// Text(
// inputTip.name ?? '',
// style: TextStyle(
// fontSize: font(15),
// color: MyColours.color_515151),
// ),
// HEmptyView(10),
// Expanded(
// child: Text(
// (inputTip.district ?? '') +
// (inputTip.address ?? ''),
// style: TextStyle(
// fontSize: font(13),
// color: MyColours.color_999999),
// ),
// ),
// ],
// )));
// })
// ],
// ),
Stack(
children: [
Container(
height: w(300),
child: Stack(
children: <Widget>[
amap,
// AmapView(
// showZoomControl: false,
// /// 是否显示指南针控件
// showCompass: true,
// /// 是否显示比例尺控件
// showScaleControl: true,
// /// 是否使能缩放手势
// zoomGesturesEnabled: true,
// /// 是否使能滚动手势
// scrollGesturesEnabled: true,
// /// 是否使能旋转手势
// rotateGestureEnabled: false,
// centerCoordinate: LatLng(latitude, longitude),
// maskDelay: Duration(milliseconds: 500),
// zoomLevel: 19,
// onMapCreated: (controller) async {
// _controller = controller;
// _controller!
// .setCenterCoordinate(LatLng(latitude, longitude));
// // if (await requestPermission(PermissionGroup.location)) {
// // await controller.showMyLocation(true);
// // await controller?.showLocateControl(true);
// // final latLng = await _controller?.getLocation(
// // delay: Duration(seconds: 2));
// // await enableFluttifyLog(false); // 关闭log
// // _loadData(latLng);
// // } else {
// // //无权限
// // _showLocPemWidget();
// // }
// },
// // markers: [],
// onMapMoveEnd: (MapMove move) async {
// latitude = move.coordinate!.latitude;
// longitude = move.coordinate!.longitude;
// page = 1;
// _loadData(move.coordinate!);
// },
// ),
Center(
child: Icon(
Icons.place,
size: w(32),
color: Color(0xFFFF0000),
),
),
Positioned(
right: w(10),
bottom: w(10),
child: InkWell(
onTap: () {
_mapController.moveCamera(
CameraUpdate.newLatLng(
LatLng(latitudeLocation, longitudeLocation)),
animated: true,
);
},
child: Container(
decoration: BoxDecoration(
color: MyColours.color_ffffff,
borderRadius: BorderRadius.circular(r(5))),
padding: EdgeInsets.all(w(5)),
child: Image.asset(
Utils.getImgPath('location_map'),
width: w(25),
),
)),
)
],
),
),
Positioned(
top: w(10),
left: w(20),
right: w(20),
child: Container(
// height: w(45),
padding: EdgeInsets.symmetric(vertical: w(10)),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(r(10))),
child: TextField(
textAlignVertical: TextAlignVertical.center,
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(15),
),
controller:
TextEditingController.fromValue(TextEditingValue(
// 设置内容
text: keyword,
selection: TextSelection.fromPosition(TextPosition(
affinity: TextAffinity.downstream,
offset: keyword.length)),
// 保持光标在最后
)),
decoration: InputDecoration(
// border: b,
// border: OutlineInputBorder(
// borderRadius: BorderRadius.all(Radius.circular(40)),
// ),
border: OutlineInputBorder(borderSide: BorderSide.none),
hintText: '输入关键字',
isCollapsed: true,
hintStyle: TextStyle(
color: MyColours.color_999999, fontSize: font(15)),
// contentPadding: const EdgeInsets.symmetric(
// vertical: 8, horizontal: 1),
prefixIconConstraints: BoxConstraints(maxWidth: w(40)),
prefixIcon: Padding(
padding: EdgeInsets.only(left: w(10), right: w(10)),
child: SizedBox(
width: w(30),
child: Image.asset(
Utils.getImgPath('search_black'),
))),
suffixIconConstraints: BoxConstraints(maxWidth: w(32)),
suffixIcon: InkWell(
child: Padding(
padding: EdgeInsets.only(left: w(10), right: w(10)),
child: SizedBox(
width: w(22),
child: Image.asset(
Utils.getImgPath('delete_black'),
))),
onTap: () {
keyword = "";
setState(() {});
},
),
fillColor: Colors.white,
filled: true,
),
inputFormatters: [],
//内容改变的回调
onChanged: (text) {
print('change $text');
keyword = text;
//搜索
if (text != null && text.trim().length > 0) {
JhCommonUtils.debounce(
() => _fetchInputTips(text.toString()));
}
},
//内容提交(按回车)的回调
onSubmitted: (text) {
print('submit $text');
// 触发关闭弹出来的键盘。
keyword = text;
FocusScope.of(context).requestFocus(FocusNode());
setState(() {
// isloading = true;
});
// _fetchInputTips(text.toString());
// searchAroundAddress(text.toString());
},
//按回车时调用
onEditingComplete: () {
print('onEditingComplete');
},
),
),
)
],
),
Expanded(
flex: 1,
child: Visibility(
visible: !isloading,
maintainSize: false,
maintainSemantics: false,
maintainInteractivity: false,
replacement: Center(
child: CupertinoActivityIndicator(),
),
child: EasyRefresh.custom(
controller: refreshController,
slivers: [
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int position) {
print("itemBuilder" + list.length.toString());
PoiModel item = list[position]!;
return InkWell(
child: Column(
children: <Widget>[
Container(
margin: EdgeInsets.only(
top: 8, bottom: 5, left: 10),
child: Row(
children: <Widget>[
Icon(
Icons.place,
size: 20.0,
color: position == 0
? Colors.green
: Colors.grey,
),
Expanded(
child: Text(item.title,
style: TextStyle(
fontSize: 16,
color: position == 0
? Colors.green
: Color(0xFF787878))))
],
),
),
Container(
margin: EdgeInsets.only(
top: 5, bottom: 5, left: 18),
alignment: Alignment.centerLeft,
child: Text(
item.address!,
style: TextStyle(
fontSize: 14,
color: Color(0xFF646464),
),
),
),
Divider(
height: 1,
)
],
),
onTap: () async {
// await _controller.setCenterCoordinate(
// LatLng(item.latLng.latitude, item.latLng.longitude),
// zoomLevel: 16);
if (Navigator.canPop(context)) {
Navigator.pop(context, {
'address': item.address,
'lat': item.latLng!.latitude.toString(),
'lng': item.latLng!.longitude.toString()
});
}
},
);
},
childCount: list.length,
),
)
],
onRefresh: () async {
if (flag) {
page = 1;
_loadData(LatLng(latitude, longitude));
}
},
onLoad: () async {
if (flag) {
page++;
_loadData(LatLng(latitude, longitude),
showloading: false);
}
},
)),
),
],
),
);
}
_fetchInputTips(String text) async {
flag = false;
page = 1;
// setState(() {
// isloading = true;
// });
/// 逆地理编码(坐标转地址)
///
///
// await AmapLocation.instance.updatePrivacyShow(true);
// await AmapLocation.instance.updatePrivacyAgree(true);
LatLng latLng = LatLng(latitude, longitude);
address = await _locationPlugin
.onGeocodeSearch(true, [latLng.longitude, latLng.latitude]);
// await AmapLocation.instance.updatePrivacyShow(true);
// await AmapLocation.instance.updatePrivacyAgree(true);
List<dynamic> temp = await _locationPlugin.doInputtipsRequest(
text,
city: "",
);
inputTipDatas = [];
temp.forEach((element) {
inputTipDatas.add(MapInputsModel.fromJson(element));
});
print(inputTipDatas);
poiModel = new PoiModel("当前位置", address, latLng);
list.clear();
list.add(poiModel);
for (var inputTip in inputTipDatas) {
String? title = await inputTip.name ?? '';
String? cityStr = (inputTip.district ?? '') + (inputTip.city ?? '');
// LatLng? latLng = await inputTip.point;
list.add(new PoiModel(title.toString(), cityStr, latLng));
}
print(list);
setState(() {
// isloading = false;
});
}
void _loadData(LatLng latLng, {showloading = true}) async {
flag = true;
setState(() {
if (showloading) {
isloading = true;
}
});
/// 逆地理编码(坐标转地址)
///
///
///
// await AmapLocation.instance.updatePrivacyShow(true);
// await AmapLocation.instance.updatePrivacyAgree(true);
if (page == 1) {
address = await _locationPlugin
.onGeocodeSearch(true, [latLng.longitude, latLng.latitude]);
poiModel = new PoiModel("当前位置", address, latLng);
list.clear();
list.add(poiModel);
}
// final poiList
List<dynamic> temp = await _locationPlugin.poiSearchAround(
keyword, latLng.longitude, latLng.latitude);
List<MapRoundSearchModel> searchData = [];
temp.forEach((element) {
searchData.add(MapRoundSearchModel.fromJson(element));
});
print(searchData);
for (var poi in searchData) {
String? title = await poi.title;
String? cityName = await poi.cityName;
String? provinceName = await poi.provinceName;
String? snippet = await poi.snippet;
String? adName = await poi.adName;
LatLng? latLng = LatLng(poi.latitude ?? 0, poi.longitude ?? 0);
String? bussniss = poi.businessArea;
list.add(new PoiModel(
title.toString(),
provinceName.toString() +
cityName.toString() +
adName.toString() +
// address.toString() +
bussniss.toString() +
snippet.toString(),
latLng));
}
setState(() {
if (showloading) {
isloading = false;
}
});
}
// void searchPoiId(String text) async {
// await AmapLocation.instance.updatePrivacyShow(true);
// await AmapLocation.instance.updatePrivacyAgree(true);
// Poi? poi = await AmapSearch.instance.searchPoiId(
// text,
// );
// print(poi);
// }
// void searchAroundAddress(String text) async {
// await AmapLocation.instance.updatePrivacyShow(true);
// await AmapLocation.instance.updatePrivacyAgree(true);
// final poiList = await AmapSearch.instance.searchKeyword(
// text,
// city: "",
// );
// // final poiList = await AmapSearch.instance.searchAround(
// // LatLng(latitude, longitude),
// // city: "",
// // radius: 100000000000000
// // );
// list.clear();
// list.add(poiModel);
// for (var poi in poiList) {
// String? title = await poi.title;
// LatLng? latLng = await poi.latLng;
// String? cityName = await poi.cityName;
// String? provinceName = await poi.provinceName;
// String? address = await poi.address;
// list.add(new PoiModel(
// title.toString(),
// provinceName.toString() + cityName.toString() + address.toString(),
// latLng));
// }
// setState(() {
// isloading = false;
// FocusScope.of(context).requestFocus(FocusNode());
// });
// }
}
class PoiModel {
LatLng? latLng;
String title;
String? address;
PoiModel(this.title, this.address, this.latLng);
}
// import 'package:flutter_easyrefresh/easy_refresh.dart';
// import 'package:one_key/pages/create_store/const_config.dart';
// import 'package:one_key/pages/create_store/map_inputs_model.dart';
// import 'package:one_key/res/colors.dart';
// import 'package:one_key/utils/common_utils.dart';
// import 'package:one_key/utils/misc.dart';
// import 'package:one_key/utils/screen_util.dart';
// import 'package:one_key/utils/utils.dart';
// import 'package:one_key/widgets/system_app_bar.dart';
// import 'package:permission_handler/permission_handler.dart';
// // import '../../utils/common_utils.dart';
// // import 'package:demo/resources/custom_text_style.dart';
// // import 'package:demo/utils/misc.dart';
// // import 'package:demo/widgets/network_state/page_loading.dart';
// class MapChoicePointPage extends StatefulWidget {
// final String? long;
// final String? lat;
// MapChoicePointPage({Key? key, this.long, this.lat}) : super(key: key);
// @override
// _MapChoicePointPageState createState() => _MapChoicePointPageState();
// }
// class _MapChoicePointPageState extends State<MapChoicePointPage> {
// late AMapController _mapController;
// final double _minZoom = 3;
// final double _maxZoom = 20;
// String? _currentZoom;
// // List<Poi>? poiList;
// static List<PoiModel?> list = [];
// static List<PoiModel> searchlist = [];
// PoiModel? poiModel;
// String keyword = "";
// String? address = "";
// bool isloading = true;
// double latitude = 39.684670899;
// double longitude = 118.17630045;
// double latitudeLocation = 39.684670899;
// double longitudeLocation = 118.17630045;
// List<MapInputsModel> inputTipDatas = [];
// int page = 1;
// EasyRefreshController refreshController = EasyRefreshController();
// bool flag = true;
// /// 存储定位结果
// Map<String, Object>? _locationResult;
// /// 定位结果监听器
// StreamSubscription<Map<String, Object>>? _locationListener;
// /// 地理位置解析结果监听器
// StreamSubscription<Map<String, Object>>? _geocodeSearchListener;
// /// 高德定位插件实例
// final AMapFlutterLocation _locationPlugin = new AMapFlutterLocation();
// @override
// void initState() {
// super.initState();
// if (widget.long != null && widget.long != '' && widget.long != 'null') {
// longitude = double.parse(widget.long!);
// }
// if (widget.lat != null && widget.lat != '' && widget.lat != 'null') {
// latitude = double.parse(widget.lat!);
// }
// WidgetsBinding.instance.addPostFrameCallback((_) async {
// AMapInitializer.init(context, apiKey: ConstConfig.amapApiKeys);
// AMapInitializer.updatePrivacyAgree(ConstConfig.amapPrivacyStatement);
// AMapFlutterLocation.setApiKey("1dbf56e2e8a4d0e4cdc2df9efd36bc71",
// "dfb64c0463cb53927914364b5c09aba0",
// ohosKey: "7c2081e92ec65bfffa2df0a5464f0c7b");
// /// 设置是否已经包含高德隐私政策并弹窗展示显示用户查看,如果未包含或者没有弹窗展示,高德定位SDK将不会工作
// ///
// /// 高德SDK合规使用方案请参考官网地址:https://lbs.amap.com/news/sdkhgsy
// /// <b>必须保证在调用定位功能之前调用, 建议首次启动App时弹出《隐私政策》并取得用户同意</b>
// ///
// /// 高德SDK合规使用方案请参考官网地址:https://lbs.amap.com/news/sdkhgsy
// ///
// /// [hasContains] 隐私声明中是否包含高德隐私政策说明
// ///
// /// [hasShow] 隐私权政策是否弹窗展示告知用户
// AMapFlutterLocation.updatePrivacyShow(true, true);
// /// 设置是否已经取得用户同意,如果未取得用户同意,高德定位SDK将不会工作
// ///
// /// 高德SDK合规使用方案请参考官网地址:https://lbs.amap.com/news/sdkhgsy
// ///
// /// <b>必须保证在调用定位功能之前调用, 建议首次启动App时弹出《隐私政策》并取得用户同意</b>
// ///
// /// [hasAgree] 隐私权政策是否已经取得用户同意
// AMapFlutterLocation.updatePrivacyAgree(true);
// _requestLocationPermission();
// // ama
// // let marker = new AMap.Marker({//添加标记点
// // position: this.position,
// // map: map
// });
// _geocodeSearchListener = _locationPlugin
// .onGeocodeSearchChange()
// .listen((Map<String, Object> result) {
// // setState(() {
// if (result.containsKey('errorCode')) {
// Utils.showToast(result['errorInfo'].toString());
// } else {
// _locationResult = result;
// print(_locationResult);
// }
// });
// /// 注册定位结果监听
// /// 通过监听器接收定位结果并更新UI
// _locationListener = _locationPlugin
// .onLocationChanged()
// .listen((Map<String, Object> result) {
// // setState(() {
// if (result.containsKey('errorCode')) {
// Utils.showToast(result['errorInfo'].toString());
// } else {
// _locationResult = result;
// print(_locationResult);
// if (result['latitude'] == null || result['latitude'] == '') //网络不好,定位失败
// {
// // App.sp.setString("lat", "39.684670899");
// // App.sp.setString("lng", "118.17630045");
// } else {
// if (widget.long == null ||
// widget.long == '' ||
// widget.long == 'null') {
// latitude = double.parse(result['latitude'].toString());
// longitude = double.parse(result['longitude'].toString());
// // if (_mapController != null) {
// _mapController.moveCamera(
// CameraUpdate.newLatLng(LatLng(latitude, longitude)));
// // }
// page = 1;
// // _loadData(LatLng(latitude, longitude));
// // setState(() {});
// }
// latitudeLocation = latitude;
// longitudeLocation = longitude;
// _mapController.moveCamera(
// CameraUpdate.newLatLng(LatLng(latitudeLocation, longitudeLocation)),
// animated: true,
// );
// _loadData(LatLng(latitude, longitude));
// }
// }
// });
// }
// @override
// void dispose() {
// super.dispose();
// /// 移除定位监听
// /// 防止内存泄漏
// if (null != _locationListener) {
// _locationListener?.cancel();
// }
// if (null != _geocodeSearchListener) {
// _geocodeSearchListener?.cancel();
// }
// /// 销毁定位
// /// 释放定位资源
// _locationPlugin.destroy();
// }
// // Future<bool> checkLocationPermission() async {
// // PermissionStatus permissionStatus = await Permission.location.status;
// // if (permissionStatus == PermissionStatus.granted) {
// // return true;
// // } else {
// // return false;
// // }
// // }
// /// 检查权限并定
// // _getLocationPermission() async {
// // if (!(await checkPermission(Permission.location))) {
// // //没有定位权限
// // //申请定位权限
// // _requestLocationPermission();
// // } else {
// // //去定位
// // _requestLocationPermission();
// // }
// // }
// /// 设置定位参数
// /// 配置定位选项,如精度、频率等
// void _setLocationOption() {
// AMapLocationOption locationOption = new AMapLocationOption();
// /// 是否单次定位
// /// false表示连续定位
// locationOption.onceLocation = true;
// /// 是否需要返回逆地理信息
// /// true表示需要返回地址信息
// locationOption.needAddress = true;
// /// 是否需要返回逆地理编码信息
// locationOption.locatingWithReGeocode = true;
// /// 逆地理信息的语言类型
// /// 默认为自动适配当前系统语言
// locationOption.geoLanguage = GeoLanguage.DEFAULT;
// /// iOS 14定位精度权限设置
// /// 设置为模糊定位精度
// locationOption.desiredLocationAccuracyAuthorizationMode =
// AMapLocationAccuracyAuthorizationMode.ReduceAccuracy;
// /// iOS 14精确定位目的key
// /// 需要与info.plist中配置一致
// locationOption.fullAccuracyPurposeKey = "AMapLocationScene";
// /// 设置Android端连续定位的定位间隔
// /// 单位:毫秒
// locationOption.locationInterval = 2000;
// /// 设置Android端的定位模式
// /// 可选值:
// /// [AMapLocationMode.Battery_Saving] 低功耗模式
// /// [AMapLocationMode.Device_Sensors] 仅设备模式
// /// [AMapLocationMode.Hight_Accuracy] 高精度模式
// locationOption.locationMode = AMapLocationMode.Hight_Accuracy;
// /// 设置iOS端的定位最小更新距离
// /// -1表示不限制距离
// locationOption.distanceFilter = -1;
// /// 设置iOS端期望的定位精度
// /// 可选值:
// /// [DesiredAccuracy.Best] 最高精度
// /// [DesiredAccuracy.BestForNavigation] 适用于导航场景的高精度
// /// [DesiredAccuracy.NearestTenMeters] 10米
// /// [DesiredAccuracy.Kilometer] 1000米
// /// [DesiredAccuracy.ThreeKilometers] 3000米
// locationOption.desiredAccuracy = DesiredAccuracy.Best;
// /// 设置iOS端是否允许系统暂停定位
// /// false表示不允许系统暂停定位
// locationOption.pausesLocationUpdatesAutomatically = false;
// /// 将定位参数设置给定位插件
// _locationPlugin.setLocationOption(locationOption);
// }
// /// 获取定位权限
// _requestLocationPermission() async {
// /// [hasShow] 隐私权政策是否弹窗展示告知用户
// AMapFlutterLocation.updatePrivacyShow(true, true);
// /// [hasAgree] 隐私权政策是否已经取得用户同意
// AMapFlutterLocation.updatePrivacyAgree(true);
// // await AMapFlutterLocation.instance.updatePrivacyShow(true);
// // await AmapLocation.instance.updatePrivacyAgree(true);
// bool canLocation = false;
// if (!(await checkPermission(Permission.location))) {
// //没有定位权限
// //申请定位权限
// canLocation = await requestPermission(Permission.location);
// } else {
// canLocation = true;
// }
// // bool canLocation = await requestPermission(Permission.location);
// // 单次定位
// if (canLocation) {
// Future.delayed(Duration(milliseconds: 200), () async {
// /// [hasShow] 隐私权政策是否弹窗展示告知用户
// AMapFlutterLocation.updatePrivacyShow(true, true);
// /// [hasAgree] 隐私权政策是否已经取得用户同意
// AMapFlutterLocation.updatePrivacyAgree(true);
// _startLocation();
// // final location = await AmapLocation.instance.fetchLocation(
// // // needAddress: true,
// // // mode: LocationAccuracy.High,
// // // timeout: Duration(seconds: 10)
// // );
// // if (location.city == null || location.city == '') //网络不好,定位失败
// // {
// // // App.sp.setString("lat", "39.684670899");
// // // App.sp.setString("lng", "118.17630045");
// // } else {
// // if (widget.long == null ||
// // widget.long == '' ||
// // widget.long == 'null') {
// // latitude = location.latLng!.latitude;
// // longitude = location.latLng!.longitude;
// // if (_controller != null) {
// // _controller!.setCenterCoordinate(LatLng(
// // location.latLng!.latitude, location.latLng!.longitude));
// // }
// // page = 1;
// // _loadData(
// // LatLng(location.latLng!.latitude, location.latLng!.longitude));
// // setState(() {});
// // }
// // latitudeLocation = location.latLng!.latitude;
// // longitudeLocation = location.latLng!.longitude;
// // }
// });
// } else {
// //无权限
// }
// }
// // 开始定位
// /// 设置定位参数并启动定位
// void _startLocation() {
// /// 开始定位之前设置定位参数
// _setLocationOption();
// _locationPlugin.startLocation();
// }
// /// 停止定位
// /// 停止定位服务
// void _stopLocation() {
// _locationPlugin.stopLocation();
// }
// void onMapCreated(AMapController controller) {
// // setState(() {
// _mapController = controller;
// // _mapController.moveCamera(
// // CameraUpdate.newLatLng(LatLng(latitudeLocation, longitudeLocation)),
// // animated: true,
// // );
// // getApprovalNumber();
// // });
// }
// /// 获取审图号
// // void getApprovalNumber() async {
// // //普通地图审图号
// // String mapContentApprovalNumber =
// // (await _mapController.getMapContentApprovalNumber());
// // //卫星地图审图号
// // String satelliteImageApprovalNumber =
// // (await _mapController.getSatelliteImageApprovalNumber());
// // print('地图审图号(普通地图): $mapContentApprovalNumber');
// // print('地图审图号(卫星地图): $satelliteImageApprovalNumber');
// // }
// //移动视野
// // void _onCameraMove(CameraPosition cameraPosition) {
// // latitude = cameraPosition.target.latitude;
// // longitude = cameraPosition.target.longitude;
// // page = 1;
// // _loadData(cameraPosition.target);
// // }
// //移动地图结束
// void _onCameraMoveEnd(CameraPosition cameraPosition) {
// setState(() {
// _currentZoom = '当前缩放级别:${cameraPosition.zoom}';
// });
// _mapController.moveCamera(
// CameraUpdate.zoomTo(cameraPosition.zoom),
// animated: true,
// );
// latitude = cameraPosition.target.latitude;
// longitude = cameraPosition.target.longitude;
// page = 1;
// _loadData(cameraPosition.target);
// }
// @override
// Widget build(BuildContext context) {
// final AMapWidget amap = AMapWidget(
// initialCameraPosition:
// CameraPosition(target: LatLng(latitude, longitude), zoom: 16),
// onMapCreated: onMapCreated,
// // onCameraMove: _onCameraMove,
// onCameraMoveEnd: _onCameraMoveEnd,
// minMaxZoomPreference: MinMaxZoomPreference(_minZoom, _maxZoom),
// scaleEnabled: true,
// );
// return Scaffold(
// resizeToAvoidBottomInset: false, //防止底部布局被顶起
// appBar: SystemAppBar(
// '选择位置信息',
// onTap: () {
// if (Navigator.canPop(context)) {
// Navigator.pop(context);
// }
// },
// ),
// body: Column(
// children: <Widget>[
// // Theme(
// // data: new
// // ThemeData(
// // // primaryColor: MyColours.color_438E93,
// // // hintColor: MyColours.color_438E93),
// // child:
// // Container(
// // color: MyColours.color_438E93,
// // decoration: BoxDecoration(
// // color: MyColours.color_438E93,
// // boxShadow: [
// // BoxShadow(color: Colors.white, spreadRadius: 1),
// // ],
// // ),
// // padding: EdgeInsets.all(5),
// // child:
// // ),
// // ),
// // ListView.builder(
// // shrinkWrap: true,
// // itemCount: inputTipDatas.length,
// // itemBuilder: (context, index) {
// // InputTip inputTip = inputTipDatas[index];
// // return InkWell(
// // onTap: () {
// // // searchAroundAddress(inputTip.name ?? '');
// // // searchPoiId(inputTip.poiId ?? '');
// // // _loadData(inputTip.coordinate ??
// // // LatLng(latitude, longitude));
// // },
// // child: Container(
// // child: Row(
// // children: [
// // Text(
// // inputTip.name ?? '',
// // style: TextStyle(
// // fontSize: font(15),
// // color: MyColours.color_515151),
// // ),
// // HEmptyView(10),
// // Expanded(
// // child: Text(
// // (inputTip.district ?? '') +
// // (inputTip.address ?? ''),
// // style: TextStyle(
// // fontSize: font(13),
// // color: MyColours.color_999999),
// // ),
// // ),
// // ],
// // )));
// // })
// // ],
// // ),
// Stack(
// children: [
// Container(
// height: w(300),
// child: Stack(
// children: <Widget>[
// amap,
// // AmapView(
// // showZoomControl: false,
// // /// 是否显示指南针控件
// // showCompass: true,
// // /// 是否显示比例尺控件
// // showScaleControl: true,
// // /// 是否使能缩放手势
// // zoomGesturesEnabled: true,
// // /// 是否使能滚动手势
// // scrollGesturesEnabled: true,
// // /// 是否使能旋转手势
// // rotateGestureEnabled: false,
// // centerCoordinate: LatLng(latitude, longitude),
// // maskDelay: Duration(milliseconds: 500),
// // zoomLevel: 19,
// // onMapCreated: (controller) async {
// // _controller = controller;
// // _controller!
// // .setCenterCoordinate(LatLng(latitude, longitude));
// // // if (await requestPermission(PermissionGroup.location)) {
// // // await controller.showMyLocation(true);
// // // await controller?.showLocateControl(true);
// // // final latLng = await _controller?.getLocation(
// // // delay: Duration(seconds: 2));
// // // await enableFluttifyLog(false); // 关闭log
// // // _loadData(latLng);
// // // } else {
// // // //无权限
// // // _showLocPemWidget();
// // // }
// // },
// // // markers: [],
// // onMapMoveEnd: (MapMove move) async {
// // latitude = move.coordinate!.latitude;
// // longitude = move.coordinate!.longitude;
// // page = 1;
// // _loadData(move.coordinate!);
// // },
// // ),
// Center(
// child: Icon(
// Icons.place,
// size: w(32),
// color: Color(0xFFFF0000),
// ),
// ),
// Positioned(
// right: w(10),
// bottom: w(10),
// child: InkWell(
// onTap: () {
// _mapController.moveCamera(
// CameraUpdate.newLatLng(
// LatLng(latitudeLocation, longitudeLocation)),
// animated: true,
// );
// },
// child: Container(
// decoration: BoxDecoration(
// color: MyColours.color_ffffff,
// borderRadius: BorderRadius.circular(r(5))),
// padding: EdgeInsets.all(w(5)),
// child: Image.asset(
// Utils.getImgPath('location_map'),
// width: w(25),
// ),
// )),
// )
// ],
// ),
// ),
// Positioned(
// top: w(10),
// left: w(20),
// right: w(20),
// child: Container(
// // height: w(45),
// padding: EdgeInsets.symmetric(vertical: w(10)),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(r(10))),
// child: TextField(
// textAlignVertical: TextAlignVertical.center,
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: font(15),
// ),
// controller:
// TextEditingController.fromValue(TextEditingValue(
// // 设置内容
// text: keyword,
// selection: TextSelection.fromPosition(TextPosition(
// affinity: TextAffinity.downstream,
// offset: keyword.length)),
// // 保持光标在最后
// )),
// decoration: InputDecoration(
// // border: b,
// // border: OutlineInputBorder(
// // borderRadius: BorderRadius.all(Radius.circular(40)),
// // ),
// border: OutlineInputBorder(borderSide: BorderSide.none),
// hintText: '输入关键字',
// isCollapsed: true,
// hintStyle: TextStyle(
// color: MyColours.color_999999, fontSize: font(15)),
// // contentPadding: const EdgeInsets.symmetric(
// // vertical: 8, horizontal: 1),
// prefixIconConstraints: BoxConstraints(maxWidth: w(40)),
// prefixIcon: Padding(
// padding: EdgeInsets.only(left: w(10), right: w(10)),
// child: SizedBox(
// width: w(30),
// child: Image.asset(
// Utils.getImgPath('search_black'),
// ))),
// suffixIconConstraints: BoxConstraints(maxWidth: w(32)),
// suffixIcon: InkWell(
// child: Padding(
// padding: EdgeInsets.only(left: w(10), right: w(10)),
// child: SizedBox(
// width: w(22),
// child: Image.asset(
// Utils.getImgPath('delete_black'),
// ))),
// onTap: () {
// keyword = "";
// setState(() {});
// },
// ),
// fillColor: Colors.white,
// filled: true,
// ),
// inputFormatters: [],
// //内容改变的回调
// onChanged: (text) {
// print('change $text');
// keyword = text;
// //搜索
// if (text != null && text.trim().length > 0) {
// JhCommonUtils.debounce(
// () => _fetchInputTips(text.toString()));
// }
// },
// //内容提交(按回车)的回调
// onSubmitted: (text) {
// print('submit $text');
// // 触发关闭弹出来的键盘。
// keyword = text;
// FocusScope.of(context).requestFocus(FocusNode());
// setState(() {
// // isloading = true;
// });
// // _fetchInputTips(text.toString());
// // searchAroundAddress(text.toString());
// },
// //按回车时调用
// onEditingComplete: () {
// print('onEditingComplete');
// },
// ),
// ),
// )
// ],
// ),
// Expanded(
// flex: 1,
// child: Visibility(
// visible: !isloading,
// maintainSize: false,
// maintainSemantics: false,
// maintainInteractivity: false,
// replacement: Center(
// child: CupertinoActivityIndicator(),
// ),
// child: EasyRefresh.custom(
// controller: refreshController,
// slivers: [
// SliverList(
// delegate: SliverChildBuilderDelegate(
// (BuildContext context, int position) {
// print("itemBuilder" + list.length.toString());
// PoiModel item = list[position]!;
// return InkWell(
// child: Column(
// children: <Widget>[
// Container(
// margin: EdgeInsets.only(
// top: 8, bottom: 5, left: 10),
// child: Row(
// children: <Widget>[
// Icon(
// Icons.place,
// size: 20.0,
// color: position == 0
// ? Colors.green
// : Colors.grey,
// ),
// Expanded(
// child: Text(item.title,
// style: TextStyle(
// fontSize: 16,
// color: position == 0
// ? Colors.green
// : Color(0xFF787878))))
// ],
// ),
// ),
// Container(
// margin: EdgeInsets.only(
// top: 5, bottom: 5, left: 18),
// alignment: Alignment.centerLeft,
// child: Text(
// item.address!,
// style: TextStyle(
// fontSize: 14,
// color: Color(0xFF646464),
// ),
// ),
// ),
// Divider(
// height: 1,
// )
// ],
// ),
// onTap: () async {
// // await _controller.setCenterCoordinate(
// // LatLng(item.latLng.latitude, item.latLng.longitude),
// // zoomLevel: 16);
// if (Navigator.canPop(context)) {
// Navigator.pop(context, {
// 'address': item.address,
// 'lat': item.latLng!.latitude.toString(),
// 'lng': item.latLng!.longitude.toString()
// });
// }
// },
// );
// },
// childCount: list.length,
// ),
// )
// ],
// onRefresh: () async {
// if (flag) {
// page = 1;
// _loadData(LatLng(latitude, longitude));
// }
// },
// onLoad: () async {
// if (flag) {
// page++;
// _loadData(LatLng(latitude, longitude),
// showloading: false);
// }
// },
// )),
// ),
// ],
// ),
// );
// }
// _fetchInputTips(String text) async {
// flag = false;
// page = 1;
// // setState(() {
// // isloading = true;
// // });
// /// 逆地理编码(坐标转地址)
// ///
// ///
// // await AmapLocation.instance.updatePrivacyShow(true);
// // await AmapLocation.instance.updatePrivacyAgree(true);
// LatLng latLng = LatLng(latitude, longitude);
// address = await _locationPlugin
// .onGeocodeSearch(true, [latLng.longitude, latLng.latitude]);
// // await AmapLocation.instance.updatePrivacyShow(true);
// // await AmapLocation.instance.updatePrivacyAgree(true);
// List<dynamic> temp = await _locationPlugin.doInputtipsRequest(
// text,
// city: "",
// );
// inputTipDatas = [];
// temp.forEach((element) {
// inputTipDatas.add(MapInputsModel.fromJson(element));
// });
// print(inputTipDatas);
// poiModel = new PoiModel("当前位置", address, latLng);
// list.clear();
// list.add(poiModel);
// for (var inputTip in inputTipDatas) {
// String? title = await inputTip.name ?? '';
// String? cityStr = (inputTip.district ?? '') + (inputTip.city ?? '');
// // LatLng? latLng = await inputTip.point;
// list.add(new PoiModel(title.toString(), cityStr, latLng));
// }
// print(list);
// setState(() {
// // isloading = false;
// });
// }
// void _loadData(LatLng latLng, {showloading = true}) async {
// flag = true;
// setState(() {
// if (showloading) {
// isloading = true;
// }
// });
// /// 逆地理编码(坐标转地址)
// ///
// ///
// ///
// // await AmapLocation.instance.updatePrivacyShow(true);
// // await AmapLocation.instance.updatePrivacyAgree(true);
// if (page == 1) {
// address = await _locationPlugin
// .onGeocodeSearch(true, [latLng.longitude, latLng.latitude]);
// poiModel = new PoiModel("当前位置", address, latLng);
// list.clear();
// list.add(poiModel);
// }
// // final poiList
// List<dynamic> temp = await _locationPlugin.poiSearchAround(
// keyword, latLng.longitude, latLng.latitude);
// List<MapRoundSearchModel> searchData = [];
// temp.forEach((element) {
// searchData.add(MapRoundSearchModel.fromJson(element));
// });
// print(searchData);
// for (var poi in searchData) {
// String? title = await poi.title;
// String? cityName = await poi.cityName;
// String? provinceName = await poi.provinceName;
// String? snippet = await poi.snippet;
// String? adName = await poi.adName;
// LatLng? latLng = LatLng(poi.latitude ?? 0, poi.longitude ?? 0);
// String? bussniss = poi.businessArea;
// list.add(new PoiModel(
// title.toString(),
// provinceName.toString() +
// cityName.toString() +
// adName.toString() +
// // address.toString() +
// bussniss.toString() +
// snippet.toString(),
// latLng));
// }
// setState(() {
// if (showloading) {
// isloading = false;
// }
// });
// }
// // void searchPoiId(String text) async {
// // await AmapLocation.instance.updatePrivacyShow(true);
// // await AmapLocation.instance.updatePrivacyAgree(true);
// // Poi? poi = await AmapSearch.instance.searchPoiId(
// // text,
// // );
// // print(poi);
// // }
// // void searchAroundAddress(String text) async {
// // await AmapLocation.instance.updatePrivacyShow(true);
// // await AmapLocation.instance.updatePrivacyAgree(true);
// // final poiList = await AmapSearch.instance.searchKeyword(
// // text,
// // city: "",
// // );
// // // final poiList = await AmapSearch.instance.searchAround(
// // // LatLng(latitude, longitude),
// // // city: "",
// // // radius: 100000000000000
// // // );
// // list.clear();
// // list.add(poiModel);
// // for (var poi in poiList) {
// // String? title = await poi.title;
// // LatLng? latLng = await poi.latLng;
// // String? cityName = await poi.cityName;
// // String? provinceName = await poi.provinceName;
// // String? address = await poi.address;
// // list.add(new PoiModel(
// // title.toString(),
// // provinceName.toString() + cityName.toString() + address.toString(),
// // latLng));
// // }
// // setState(() {
// // isloading = false;
// // FocusScope.of(context).requestFocus(FocusNode());
// // });
// // }
// }
// class PoiModel {
// LatLng? latLng;
// String title;
// String? address;
// PoiModel(this.title, this.address, this.latLng);
// }
... ...
... ... @@ -198,73 +198,84 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> {
// pickType: type,
// photoPathList: pathList,
// );
List<MediaDN>? imgList = [];
List<MediaDN>? imgList = [];
if (Platform.isAndroid || Platform.isIOS) {
List<AssetEntity>? imagListTemp = await AssetPicker.pickAssets(context,
pickerConfig: AssetPickerConfig(
maxAssets: widget.maxImageNumber -
widget.model!.imageListDenvironment.length,
// selectedAssets: assets,
requestType: type,
themeColor: MyColours.color_199095));
imagListTemp?.forEach((elenemt) async {
MediaDN mediaDN = MediaDN();
mediaDN.file = await elenemt.file;
imgList.add(mediaDN);
});
}else if(Platform.isOhos){
List<XFile> imagListTemp = await ImageSelectOhosUtil.onImageButtonPressed(
ImageSource.gallery,
context: context,
isMultiImage: true,
isVideo: false,
limit: widget.maxImageNumber -
widget.model!.imageListDenvironment.length,);
imagListTemp.forEach((elenemt) async {
MediaDN mediaDN = MediaDN();
mediaDN.file = File(elenemt.path);
imgList.add(mediaDN);
});
}
if (imgList.length == 0 || imgList.isEmpty) {
print("No pick item.");
return;
}else {
for (int i = 0; i < imgList.length; i++) {
var file = ( imgList[i].file)!;
setState(() {
UploadImgModel imgModel = UploadImgModel();
imgModel.file = File(file.absolute.path);
imgModel.process = 0.01;
imgModel.fileType = FileType.image;
widget.model!.imageListDenvironment.add(imgModel);
});
List<AssetEntity>? imagListTemp = await AssetPicker.pickAssets(context,
pickerConfig: AssetPickerConfig(
maxAssets: widget.maxImageNumber -
widget.model!.imageListDenvironment.length,
// selectedAssets: assets,
requestType: type,
themeColor: MyColours.color_199095));
bool need = await Utils.sizeNeed(file);
int? countAll = imagListTemp?.length;
if (countAll != null && countAll > 0) {
for (int i = 0; i < imagListTemp!.length; i++) {
AssetEntity element = imagListTemp[i];
MediaDN mediaDN = MediaDN();
mediaDN.file = await element.file;
imgList.add(mediaDN);
}
if (imgList.length == countAll) {
for (int i = 0; i < imgList.length; i++) {
_upload(imgList[i]);
}
}
}
} else if (Platform.isOhos) {
List<XFile> imagListTemp = await ImageSelectOhosUtil.onImageButtonPressed(
ImageSource.gallery,
context: context,
isMultiImage: true,
isVideo: false,
limit:
widget.maxImageNumber - widget.model!.imageListDenvironment.length,
);
if (need) {
File compressedFile = await FlutterNativeImage.compressImage(
file.path,
quality: 50,
percentage: 50);
file = File(compressedFile.absolute.path);
if (imagListTemp != null && imagListTemp.length > 0) {
int countAll = imagListTemp.length;
if (countAll > 0) {
for (int i = 0; i < imagListTemp.length; i++) {
XFile element = imagListTemp[i];
MediaDN mediaDN = MediaDN();
mediaDN.file = File(element.path);
imgList.add(mediaDN);
}
if (imgList.length == countAll) {
for (int i = 0; i < imgList.length; i++) {
_upload(imgList[i]);
}
}
}
UploadImageUtil().startUpload(
context,
file,
widget.model!.imageListDenvironment.length - 1,
false,
widget.model!,
UploadType.EnvironmentUploadType);
// startUpload(File(file.absolute.path),
// _uploadImageProvider.imageListDenvironment.length - 1, false);
}
}
}
_upload(MediaDN mediaDN) async {
var file = (mediaDN.file)!;
bool need = await Utils.sizeNeed(file);
if (need) {
File compressedFile = await FlutterNativeImage.compressImage(file.path,
quality: 50, percentage: 50);
file = File(compressedFile.absolute.path);
}
setState(() {
UploadImgModel imgModel = UploadImgModel();
imgModel.file = File(file.absolute.path);
imgModel.process = 0.01;
imgModel.fileType = FileType.image;
widget.model!.imageListDenvironment.add(imgModel);
});
UploadImageUtil().startUpload(
context,
file,
widget.model!.imageListDenvironment.length - 1,
false,
widget.model!,
UploadType.EnvironmentUploadType);
}
///添加图片UI弹出
Future _openModalBottomSheet(context, FileType fileType) async {
await showModalBottomSheet(
... ...
... ... @@ -818,7 +818,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
// }
LogUtil.v(param.toString());
Map? notifyParam = param;
if (Platform.isIOS && param != null) {
if (Platform.isAndroid) {
} else if (Platform.isIOS && param != null) {
notifyParam = json.decode(param['custom'].toString());
} else if (Platform.isOhos && param != null) {
Uri u = Uri.parse(param['content']['harmony_message']['uri']);
... ...
... ... @@ -161,8 +161,8 @@ class _WebPageState extends State<WebPage> {
key: webViewKey,
// contextMenu: contextMenu,
initialUrlRequest: URLRequest(
// url: Uri.parse("http://colorcun.com/privacy1.html")),
url: WebUri("http://colorcun.com/privacy2.html")),
url: Uri.parse("http://colorcun.com/privacy1.html")),
// url: WebUri("http://colorcun.com/privacy2.html")),
//华为下载功能闪退,去掉下载功能*********http://colorcun.com/privacy2.html
// initialFile: "assets/index.html",
initialUserScripts: UnmodifiableListView<UserScript>([]),
... ...
// // import 'package:device_info/device_info.dart';
// // import 'package:device_info_plus/device_info_plus.dart';
// import 'package:flutter/material.dart';
// import 'package:flutter_inappwebview/flutter_inappwebview.dart';
// import 'package:one_key/net/dio_util.dart';
// import 'package:one_key/res/colors.dart';
// import 'package:one_key/utils/utils.dart';
// import 'package:one_key/widgets/system_app_bar.dart';
// import 'package:path_provider/path_provider.dart';
// // import 'package:permission_handler/permission_handler.dart';
// // import 'package:webview_flutter/webview_flutter.dart';
// import 'dart:io';
// // import 'package:webview_flutter/webview_flutter.dart';
// // import 'package:flutter_inappwebview/flutter_inappwebview.dart';
// import 'package:url_launcher/url_launcher.dart';
// import 'dart:collection';
// // import 'package:open_file/open_file.dart';
// // import 'package:flutter_downloader/flutter_downloader.dart';
// /**
// * 我的-----帮助与反馈页面 ----- 目前已经功能已经屏蔽
// */
// class WebPage extends StatefulWidget {
// final String? title;
// final String? url;
// final bool need;
// const WebPage({Key? key, this.title, this.url, this.need = false})
// : super(key: key);
// @override
// _WebPageState createState() => _WebPageState();
// }
// class _WebPageState extends State<WebPage> {
// final GlobalKey webViewKey = GlobalKey();
// InAppWebViewController? webViewController;
// InAppWebViewGroupOptions options = InAppWebViewGroupOptions(
// crossPlatform: InAppWebViewOptions(
// useShouldOverrideUrlLoading: true,
// useOnDownloadStart: true,
// mediaPlaybackRequiresUserGesture: false,
// ),
// android: AndroidInAppWebViewOptions(
// useHybridComposition: true,
// ),
// ios: IOSInAppWebViewOptions(
// allowsInlineMediaPlayback: true,
// ));
// PullToRefreshController? pullToRefreshController;
// ContextMenu? contextMenu;
// String url = "";
// double progress = 0;
// final urlController = TextEditingController();
// // Future<void> openFile(filePath) async {
// // final _result = await OpenFile.open(filePath);
// // print(_result.message);
// // // setState(() {
// // // _openResult = "type=${_result.type} message=${_result.message}";
// // // });
// // }
// @override
// void initState() {
// super.initState();
// // Enable hybrid composition.
// _init();
// }
// @override
// void dispose() {
// if (widget.need) {
// Utils.changeStatusColor(color: MyColours.color_199095);
// }
// super.dispose();
// }
// // Future<bool> _checkPermission() async {
// // DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
// // AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
// // if (Platform.isAndroid && androidInfo.version.sdkInt <= 28) {
// // final status = await Permission.storage.status;
// // if (status != PermissionStatus.granted) {
// // final result = await Permission.storage.request();
// // if (result == PermissionStatus.granted) {
// // return true;
// // }
// // } else {
// // return true;
// // }
// // } else {
// // return true;
// // }
// // return false;
// // }
// // Future<bool> checkPermissionStorage() async {
// // var status = await Permission.storage.status;
// // if (!status.isGranted) {
// // status = await Permission.storage.request();
// // if (status.isGranted) {
// // return true;
// // }
// // } else {
// // return true;
// // }
// // return false;
// // }
// _init() async {
// // WidgetsFlutterBinding.ensureInitialized();
// // await FlutterDownloader.initialize(debug: true);
// if (Platform.isAndroid) {
// await AndroidInAppWebViewController.setWebContentsDebuggingEnabled(true);
// var swAvailable = await AndroidWebViewFeature.isFeatureSupported(
// AndroidWebViewFeature.SERVICE_WORKER_BASIC_USAGE);
// var swInterceptAvailable = await AndroidWebViewFeature.isFeatureSupported(
// AndroidWebViewFeature.SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST);
// if (swAvailable && swInterceptAvailable) {
// AndroidServiceWorkerController serviceWorkerController =
// AndroidServiceWorkerController.instance();
// serviceWorkerController.serviceWorkerClient =
// AndroidServiceWorkerClient(
// shouldInterceptRequest: (request) async {
// print(request);
// return null;
// },
// );
// }
// }
// // await FlutterDownloader.initialize(
// // debug: true // optional: set false to disable printing logs to console
// // );
// // await Permission.storage.request();
// }
// @override
// Widget build(BuildContext context) {
// return Scaffold(
// // We're using a Builder here so we have a context that is below the Scaffold
// // to allow calling Scaffold.of(context) so we can show a snackbar.
// appBar: SystemAppBar(
// widget.title,
// ),
// body: Column(
// children: [
// Expanded(
// child: InAppWebView(
// key: webViewKey,
// // contextMenu: contextMenu,
// initialUrlRequest: URLRequest(
// // url: Uri.parse("http://colorcun.com/privacy1.html")),
// url: WebUri("http://colorcun.com/privacy2.html")),
// //华为下载功能闪退,去掉下载功能*********http://colorcun.com/privacy2.html
// // initialFile: "assets/index.html",
// initialUserScripts: UnmodifiableListView<UserScript>([]),
// initialOptions: options,
// pullToRefreshController: pullToRefreshController,
// onWebViewCreated: (controller) {
// webViewController = controller;
// },
// onLoadStart: (controller, url) {
// setState(() {
// this.url = url.toString();
// urlController.text = this.url;
// });
// },
// androidOnPermissionRequest:
// (controller, origin, resources) async {
// return PermissionRequestResponse(
// resources: resources,
// action: PermissionRequestResponseAction.GRANT);
// },
// shouldOverrideUrlLoading: (controller, navigationAction) async {
// var uri = navigationAction.request.url!;
// if (![
// "http",
// "https",
// "file",
// "chrome",
// "data",
// "javascript",
// "about"
// ].contains(uri.scheme)) {
// if (await canLaunch(url)) {
// // Launch the App
// await launch(
// url,
// );
// // and cancel the request
// return NavigationActionPolicy.CANCEL;
// }
// }
// return NavigationActionPolicy.ALLOW;
// },
// onLoadStop: (controller, url) async {
// pullToRefreshController!.endRefreshing();
// setState(() {
// this.url = url.toString();
// urlController.text = this.url;
// });
// },
// onLoadError: (controller, url, code, message) {
// pullToRefreshController!.endRefreshing();
// },
// onProgressChanged: (controller, progress) {
// if (progress == 100) {
// pullToRefreshController!.endRefreshing();
// }
// setState(() {
// this.progress = progress / 100;
// urlController.text = this.url;
// });
// },
// onUpdateVisitedHistory: (controller, url, androidIsReload) {
// setState(() {
// this.url = url.toString();
// urlController.text = this.url;
// });
// },
// onConsoleMessage: (controller, consoleMessage) {
// print(consoleMessage);
// },
// onDownloadStart: (controller, url) async {
// print("onDownloadStart $url");
// Utils.showToast('开始下载...');
// // final taskId = await FlutterDownloader.enqueue(
// // url: url.toString(),
// // savedDir: (await getExternalStorageDirectory()).path,
// // showNotification:
// // true, // show download progress in status bar (for Android)
// // openFileFromNotification:
// // true, // click on notification to open downloaded file (for Android)
// // );
// final dir = (await getExternalStorageDirectory())!;
// String savePath = dir.path + "/one_key";
// Directory directory = new Directory(savePath);
// if (directory.existsSync()) {
// //删除历史apk
// final List<FileSystemEntity> files = directory.listSync();
// for (FileSystemEntity file in files) {
// file.deleteSync();
// }
// }
// DioUtil().download(url.toString(), savePath,
// onProgress: (received, total) {
// // if (_progress != 100) {
// // int progress = ((received / total) * 100).round();
// // _progress = progress;
// // _setState(() {});
// // }
// if (received == total) {
// print('object');
// Utils.showToast('文件已保存在${savePath}');
// // openFile(savePath);
// //下载完成
// // InstallPlugin.installApk(savePath, "com.naji.one_key");
// }
// });
// // },
// // DioUtil().download(url.toString(),
// // (await getExternalStorageDirectory()).path,
// // onProgress: (received, total) {
// // // if (_progress != 100) {
// // // int progress = ((received / total) * 100).round();
// // // _progress = progress;
// // // _setState(() {});
// // // }
// // if (received == total) {
// // //下载完成
// // // InstallPlugin.installApk(savePath, "com.naji.one_key");
// // }
// // });
// },
// ))
// ],
// )
// // Builder(builder: (BuildContext context) {
// // return WebView(
// // initialUrl: "http://colorcun.com/privacy1.html",
// // javascriptMode: JavascriptMode.unrestricted,
// // onWebViewCreated: (WebViewController webViewController) {
// // _controller.complete(webViewController);
// // },
// // // TODO(iskakaushik): Remove this when collection literals makes it to stable.
// // // ignore: prefer_collection_literals
// // javascriptChannels: <JavascriptChannel>[
// // _toasterJavascriptChannel(context),
// // ].toSet(),
// // navigationDelegate: (NavigationRequest request) {
// // if (request.url.startsWith('https://www.youtube.com/')) {
// // print('blocking navigation to $request}');
// // return NavigationDecision.prevent;
// // }
// // print('allowing navigation to $request');
// // return NavigationDecision.navigate;
// // },
// // onPageStarted: (String url) {
// // print('Page started loading: $url');
// // },
// // onPageFinished: (String url) async {
// // print('Page finished loading: $url');
// // // showDownloadProgress(context);
// // final dir = await getExternalStorageDirectory();
// // String savePath = dir.path + "/one_key";
// // DioUtil().download(url, savePath,
// // onProgress: (received, total) {
// // // if (_progress != 100) {
// // // int progress = ((received / total) * 100).round();
// // // _progress = progress;
// // // _setState(() {});
// // // }
// // if (received == total) {
// // print('object');
// // //下载完成
// // // InstallPlugin.installApk(savePath, "com.naji.one_key");
// // }
// // });
// // },
// // gestureNavigationEnabled: true,
// // );
// // }),
// );
// }
// // JavascriptChannel _toasterJavascriptChannel(BuildContext context) {
// // return JavascriptChannel(
// // name: 'Toaster',
// // onMessageReceived: (JavascriptMessage message) {
// // Scaffold.of(context).showSnackBar(
// // SnackBar(content: Text(message.message)),
// // );
// // });
// // }
// }
// // class WebPage extends StatelessWidget {
// // final String title;
// // final String url;
// // final bool need;
// // const WebPage({Key key, this.title, this.url, this.need = false})
// // : super(key: key);
// // @override
// // Widget build(BuildContext context) {
// // final Completer<WebViewController> _controller =
// // Completer<WebViewController>();
// // return Scaffold(
// // appBar: SystemAppBar(title, onTap: () {
// // if (need) {
// // Utils.changeStatusColor(color: MyColours.color_199095);
// // }
// // Navigator.of(context).pop();
// // }),
// // body: WillPopScope(
// // onWillPop: () async {
// // if (need) {
// // Utils.changeStatusColor(color: MyColours.color_199095);
// // }
// // return true;
// // },
// // child: WebView(
// // initialUrl: "http://colorcun.com/privacy1.html",
// // javascriptMode: JavascriptMode.unrestricted,
// // onWebViewCreated: (WebViewController webViewController) {
// // // Loading.showLoading(context);
// // _controller.complete(webViewController);
// // },
// // javascriptChannels: <JavascriptChannel>[
// // _toasterJavascriptChannel(context),
// // ].toSet(),
// // navigationDelegate: (NavigationRequest request) {
// // if (request.url.startsWith('https://www.youtube.com/')) {
// // return NavigationDecision.prevent;
// // }
// // return NavigationDecision.navigate;
// // },
// // onPageStarted: (String url) {},
// // onPageFinished: (String url) {
// // // Loading.hideLoading(context);
// // },
// // gestureNavigationEnabled: true,
// // )),
// // );
// // }
// // JavascriptChannel _toasterJavascriptChannel(BuildContext context) {
// // return JavascriptChannel(
// // name: 'Toaster',
// // onMessageReceived: (JavascriptMessage message) {
// // Scaffold.of(context).showSnackBar(
// // SnackBar(content: Text(message.message)),
// // );
// // });
// // }
// // }
... ...
import 'dart:convert';
import 'dart:io';
import 'dart:async';
import 'dart:async'; // 需要导入这个库来使用 compute
import 'package:flutter/foundation.dart' show compute; // 从 Flutter 的包中导入 co
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
... ... @@ -37,9 +38,6 @@ import './dispose.dart';
import 'package:flutter_native_image/flutter_native_image.dart';
// import 'package:flutter_image_compress/flutter_image_compress.dart';
typedef void OnPickImageCallback(
double maxWidth, double maxHeight, int quality);
typedef void DeleteCallback(int index);
... ... @@ -90,7 +88,6 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> {
// 控制器,可以用于取消任务、获取上述的状态,进度等信息
// PutController putController = PutController();
// 当前的任务状态
@override
... ... @@ -248,9 +245,9 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> {
// });
// }
Future<void> _heavy(AssetEntity assetEntity) async {
await assetEntity.file;
}
///多图片选择
void pickAsset(RequestType type, {List<AssetPathEntity>? pathList}) async {
... ... @@ -271,6 +268,8 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> {
temp = widget.imageList;
}
print(temp);
List<MediaDN>? imgList = [];
if (Platform.isAndroid || Platform.isIOS) {
List<AssetEntity>? imagListTemp = await AssetPicker.pickAssets(context,
... ... @@ -279,11 +278,21 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> {
// selectedAssets: assets,
requestType: type,
themeColor: MyColours.color_199095));
imagListTemp?.forEach((elenemt) async {
MediaDN mediaDN = MediaDN();
mediaDN.file = await elenemt.file;
imgList.add(mediaDN);
});
int? countAll = imagListTemp?.length;
if (countAll != null && countAll > 0) {
for (int i = 0; i < imagListTemp!.length; i++) {
AssetEntity element = imagListTemp[i];
MediaDN mediaDN = MediaDN();
mediaDN.file = await element.file;
imgList.add(mediaDN);
}
if (imgList.length == countAll) {
for (int i = 0; i < imgList.length; i++) {
_upload(imgList[i], temp, countAll);
}
}
}
} else if (Platform.isOhos) {
List<XFile> imagListTemp = await ImageSelectOhosUtil.onImageButtonPressed(
ImageSource.gallery,
... ... @@ -292,62 +301,71 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> {
isVideo: false,
limit: widget.maxImageNumber - temp!.length);
imagListTemp.forEach((elenemt) async {
MediaDN mediaDN = MediaDN();
mediaDN.file = File(elenemt.path);
imgList.add(mediaDN);
});
if (imagListTemp != null && imagListTemp.length > 0) {
int countAll = imagListTemp.length;
if (countAll > 0) {
for (int i = 0; i < imagListTemp.length; i++) {
XFile element = imagListTemp[i];
MediaDN mediaDN = MediaDN();
mediaDN.file = File(element.path);
imgList.add(mediaDN);
}
if (imgList.length == countAll) {
for (int i = 0; i < imgList.length; i++) {
_upload(imgList[i], temp, countAll);
}
}
}
}
}
}
if (imgList.length == 0 || imgList.isEmpty) {
print("No pick item.");
return;
} else {
for (int i = 0; i < imgList.length; i++) {
var file = (imgList[i].file)!;
//从相册选取照片后进行裁剪压缩
File yourFile = file;
Uint8List afterImg = await yourFile.readAsBytes();
Uint8List? newImg = await Utils.testFromFileComporessList(
context, afterImg,
needResize:
widget.uploadType == UploadType.CouponDishType ? true : false);
String? path = await Utils.saveImage(newImg);
// File compressedFile;
if (path == null) {
// File compressedFile = await FlutterNativeImage.compressImage(
// file.path,
// quality: 50,
// percentage: 50);
File compressedFile =
(await Utils.compressImageToFile(file.path, quality: 70))!;
path = compressedFile.path;
}
// File compressedFile = await FlutterNativeImage.compressImage(
// file.absolute.path,
// quality: 50,
// percentage: 50);
setState(() {
UploadImgModel imgModel = UploadImgModel();
imgModel.file = File(path!);
imgModel.process = 0.01;
temp!.add(imgModel);
});
bool need = await Utils.sizeNeed(file);
_upload(MediaDN mediaDN, List<UploadImgModel>? temp, int countAll) async {
var file = (mediaDN.file)!;
//从相册选取照片后进行裁剪压缩
File yourFile = file;
Uint8List afterImg = await yourFile.readAsBytes();
Uint8List? newImg = await Utils.testFromFileComporessList(context, afterImg,
needResize:
widget.uploadType == UploadType.CouponDishType ? true : false);
String? path = await Utils.saveImage(newImg);
// File compressedFile;
if (path == null) {
// File compressedFile = await FlutterNativeImage.compressImage(
// file.path,
// quality: 50,
// percentage: 50);
File compressedFile =
(await Utils.compressImageToFile(file.path, quality: 70))!;
path = compressedFile.path;
}
// File compressedFile = await FlutterNativeImage.compressImage(
// file.absolute.path,
// quality: 50,
// percentage: 50);
bool need = await Utils.sizeNeed(file);
if (need) {
file = File(path);
}
UploadImageUtil().startUpload(context, File(path), temp!.length - 1,
false, widget.model!, widget.uploadType,
countAll: imgList.length,
callback: widget.callback,
imageList: widget.imageList);
// startUpload(File(file.absolute.path),
// _uploadImageProvider.imageList.length - 1, false);
}
if (need) {
File compressedFile =
(await Utils.compressImageToFile(file.path, quality: 70))!;
path = compressedFile.path;
// file = File(path);
}
setState(() {
UploadImgModel imgModel = UploadImgModel();
imgModel.file = File(path!);
imgModel.process = 0.01;
temp!.add(imgModel);
});
UploadImageUtil().startUpload(context, File(path), temp!.length - 1, false,
widget.model!, widget.uploadType,
countAll: countAll,
callback: widget.callback,
imageList: widget.imageList);
// startUpload(File(file.absolute.path),
// _uploadImageProvider.imageList.length - 1, false);
}
// ///上传到七牛云
... ...
... ... @@ -33,7 +33,7 @@ import 'package:qiniu_flutter_sdk/qiniu_flutter_sdk.dart';
import 'package:wechat_assets_picker/wechat_assets_picker.dart';
import '../../utils/screen_util.dart';
import './dispose.dart';
import 'package:photo_manager/photo_manager.dart';
// import 'package:photo_manager/photo_manager.dart';
import 'package:flutter_native_image/flutter_native_image.dart';
typedef void OnPickImageCallback(
... ... @@ -180,6 +180,34 @@ class _ImgPickerFWidgetState extends DisposableState<ImgPickerFWidget> {
}
}
_upload(MediaDN mediaDN, List<UploadImgModel>? temp, int countAll) async {
var file = (mediaDN.file)!;
// File compressedFile = await FlutterNativeImage.compressImage(
// file.absolute.path,
// quality: 50,
// percentage: 50);
File? compressedFile = File(file.absolute.path);
bool need = await Utils.sizeNeed(file);
if (need) {
compressedFile =
await Utils.compressImageToFile(file.absolute.path, quality: 70);
// file = File(compressedFile!.absolute.path);
}
setState(() {
UploadImgModel imgModel = UploadImgModel();
imgModel.file = compressedFile;
imgModel.process = 0.01;
temp!.add(imgModel);
});
UploadImageUtil().startUpload(context, file, temp!.length - 1, false,
widget.model!, widget.uploadType,
countAll: countAll,
callback: widget.callback,
feastRemarkXtImageList: temp);
}
///多图片选择
void pickAsset(RequestType type, {List<AssetPathEntity>? pathList}) async {
List<UploadImgModel>? temp = [];
... ... @@ -210,11 +238,20 @@ class _ImgPickerFWidgetState extends DisposableState<ImgPickerFWidget> {
// selectedAssets: assets,
requestType: type,
themeColor: MyColours.color_199095));
imagListTemp?.forEach((elenemt) async {
MediaDN mediaDN = MediaDN();
mediaDN.file = await elenemt.file;
imgList.add(mediaDN);
});
int? countAll = imagListTemp?.length;
if (countAll != null && countAll > 0) {
for (int i = 0; i < imagListTemp!.length; i++) {
AssetEntity element = imagListTemp[i];
MediaDN mediaDN = MediaDN();
mediaDN.file = await element.file;
imgList.add(mediaDN);
}
if (imgList.length == countAll) {
for (int i = 0; i < imgList.length; i++) {
_upload(imgList[i], temp, countAll);
}
}
}
} else if (Platform.isOhos) {
List<XFile> imagListTemp = await ImageSelectOhosUtil.onImageButtonPressed(
ImageSource.gallery,
... ... @@ -222,43 +259,21 @@ class _ImgPickerFWidgetState extends DisposableState<ImgPickerFWidget> {
isMultiImage: true,
isVideo: false,
limit: widget.maxImageNumber - temp!.length);
imagListTemp.forEach((elenemt) async {
MediaDN mediaDN = MediaDN();
mediaDN.file = File(elenemt.path);
imgList.add(mediaDN);
});
}
if (imgList.length == 0 || imgList.isEmpty) {
print("No pick item.");
return;
} else {
for (int i = 0; i < imgList.length; i++) {
var file = ( imgList[i].file)!;
// File compressedFile = await FlutterNativeImage.compressImage(
// file.absolute.path,
// quality: 50,
// percentage: 50);
File? compressedFile =
await Utils.compressImageToFile(file.absolute.path, quality: 70);
setState(() {
UploadImgModel imgModel = UploadImgModel();
imgModel.file = compressedFile;
imgModel.process = 0.01;
temp!.add(imgModel);
});
bool need = await Utils.sizeNeed(file);
if (need) {
file = File(compressedFile!.absolute.path);
if (imagListTemp != null && imagListTemp.length > 0) {
int countAll = imagListTemp.length;
if (countAll > 0) {
for (int i = 0; i < imagListTemp.length; i++) {
XFile element = imagListTemp[i];
MediaDN mediaDN = MediaDN();
mediaDN.file = File(element.path);
imgList.add(mediaDN);
}
if (imgList.length == countAll) {
for (int i = 0; i < imgList.length; i++) {
_upload(imgList[i], temp, countAll);
}
}
}
UploadImageUtil().startUpload(context, file, temp!.length - 1, false,
widget.model!, widget.uploadType,
countAll: imgList.length,
callback: widget.callback,
feastRemarkXtImageList: temp);
// startUpload(File(file.absolute.path),
// _uploadImageProvider.imageList.length - 1, false);
}
}
}
... ...
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:one_key/utils/event_bus.dart';
import 'package:one_key/widgets/app_bar.dart';
import 'package:one_key/widgets/system_app_bar.dart';
// import 'package:path_provider/path_provider.dart';
import 'package:webview_flutter/webview_flutter.dart';
// #docregion platform_imports
// Import for Android features.
import 'package:webview_flutter_android/webview_flutter_android.dart';
// Import for iOS features.
import 'package:webview_flutter_wkwebview/webview_flutter_wkwebview.dart';
/**
*
* 帮助与反馈页面 功能暂时已经弃用
*/
class WebViewPage extends StatefulWidget {
@override
... ... @@ -23,86 +16,14 @@ class WebViewPage extends StatefulWidget {
}
class _WebViewPageState extends State<WebViewPage> {
late WebViewController _controller = WebViewController();
// late final WebViewController _controller;
final Completer<WebViewController> _controller =
Completer<WebViewController>();
@override
void initState() {
super.initState();
// Enable hybrid composition.
// if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView();
// #docregion platform_features
late final PlatformWebViewControllerCreationParams params;
if (WebViewPlatform.instance is WebKitWebViewPlatform) {
params = WebKitWebViewControllerCreationParams(
allowsInlineMediaPlayback: true,
mediaTypesRequiringUserAction: const <PlaybackMediaTypes>{},
);
} else {
params = const PlatformWebViewControllerCreationParams();
}
final WebViewController controller =
WebViewController.fromPlatformCreationParams(params);
// #enddocregion platform_features
controller
..setJavaScriptMode(JavaScriptMode.unrestricted)
..setBackgroundColor(const Color(0x00000000))
..setNavigationDelegate(
NavigationDelegate(
onProgress: (int progress) {
debugPrint('WebView is loading (progress : $progress%)');
},
onPageStarted: (String url) {
debugPrint('Page started loading: $url');
},
onPageFinished: (String url) {
debugPrint('Page finished loading: $url');
},
onWebResourceError: (WebResourceError error) {
debugPrint('''
Page resource error:
code: ${error.errorCode}
description: ${error.description}
errorType: ${error.errorType}
isForMainFrame: ${error.isForMainFrame}
''');
},
onNavigationRequest: (NavigationRequest request) {
if (request.url.startsWith('https://www.youtube.com/')) {
debugPrint('blocking navigation to ${request.url}');
return NavigationDecision.prevent;
}
debugPrint('allowing navigation to ${request.url}');
return NavigationDecision.navigate;
},
onUrlChange: (UrlChange change) {
debugPrint('url change to ${change.url}');
},
onHttpAuthRequest: (HttpAuthRequest request) {
// openDialog(request);
},
),
)
..addJavaScriptChannel(
'Toaster',
onMessageReceived: (JavaScriptMessage message) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(message.message)),
);
},
)
..loadRequest(Uri.parse("https://support.qq.com/product/152856"));
// #docregion platform_features
if (controller.platform is AndroidWebViewController) {
AndroidWebViewController.enableDebugging(true);
(controller.platform as AndroidWebViewController)
.setMediaPlaybackRequiresUserGesture(false);
}
// #enddocregion platform_features
_controller = controller;
if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView();
}
@override
... ... @@ -121,44 +42,45 @@ Page resource error:
'周到安排商家',
),
body: Builder(builder: (BuildContext context) {
return WebViewWidget(controller: _controller);
// initialUrl: "https://support.qq.com/product/152856",
// javascriptMode: JavascriptMode.unrestricted,
// onWebViewCreated: (WebViewController webViewController) {
// _controller.complete(webViewController);
// },
// // TODO(iskakaushik): Remove this when collection literals makes it to stable.
// // ignore: prefer_collection_literals
// javascriptChannels: <JavascriptChannel>[
// _toasterJavascriptChannel(context),
// ].toSet(),
// navigationDelegate: (NavigationRequest request) {
// if (request.url.startsWith('https://www.youtube.com/')) {
// print('blocking navigation to $request}');
// return NavigationDecision.prevent;
// }
// print('allowing navigation to $request');
// return NavigationDecision.navigate;
// },
// onPageStarted: (String url) {
// print('Page started loading: $url');
// },
// onPageFinished: (String url) {
// print('Page finished loading: $url');
// },
// gestureNavigationEnabled: true,
// );
return WebView(
initialUrl: "https://support.qq.com/product/152856",
javascriptMode: JavascriptMode.unrestricted,
onWebViewCreated: (WebViewController webViewController) {
_controller.complete(webViewController);
},
// TODO(iskakaushik): Remove this when collection literals makes it to stable.
// ignore: prefer_collection_literals
javascriptChannels: <JavascriptChannel>[
_toasterJavascriptChannel(context),
].toSet(),
navigationDelegate: (NavigationRequest request) {
if (request.url.startsWith('https://www.youtube.com/')) {
print('blocking navigation to $request}');
return NavigationDecision.prevent;
}
print('allowing navigation to $request');
return NavigationDecision.navigate;
},
onPageStarted: (String url) {
print('Page started loading: $url');
},
onPageFinished: (String url) {
print('Page finished loading: $url');
},
gestureNavigationEnabled: true,
);
}),
);
}
// JavascriptChannel _toasterJavascriptChannel(BuildContext context) {
// return JavascriptChannel(
// name: 'Toaster',
// onMessageReceived: (JavascriptMessage message) {
// ScaffoldMessenger.of(context).showSnackBar(
// SnackBar(content: Text(message.message)),
// );
// });
// }
JavascriptChannel _toasterJavascriptChannel(BuildContext context) {
return JavascriptChannel(
name: 'Toaster',
onMessageReceived: (JavascriptMessage message) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(message.message)),
);
});
}
}
... ...
// import 'dart:async';
// import 'dart:convert';
// import 'dart:io';
// import 'package:flutter/material.dart';
// import 'package:one_key/utils/event_bus.dart';
// import 'package:one_key/widgets/app_bar.dart';
// import 'package:one_key/widgets/system_app_bar.dart';
// import 'package:webview_flutter/webview_flutter.dart';
// class WebViewPage extends StatefulWidget {
// @override
// _WebViewPageState createState() => _WebViewPageState();
// }
// class _WebViewPageState extends State<WebViewPage> {
// final Completer<WebViewController> _controller =
// Completer<WebViewController>();
// @override
// void initState() {
// super.initState();
// // Enable hybrid composition.
// if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView();
// }
// @override
// void dispose() {
// // TODO: implement dispose
// EventBus().emit('changeStatusColor');
// super.dispose();
// }
// @override
// Widget build(BuildContext context) {
// return Scaffold(
// // We're using a Builder here so we have a context that is below the Scaffold
// // to allow calling Scaffold.of(context) so we can show a snackbar.
// appBar: SystemAppBar(
// '周到安排商家',
// ),
// body: Builder(builder: (BuildContext context) {
// return WebView(
// initialUrl: "https://support.qq.com/product/152856",
// javascriptMode: JavascriptMode.unrestricted,
// onWebViewCreated: (WebViewController webViewController) {
// _controller.complete(webViewController);
// },
// // TODO(iskakaushik): Remove this when collection literals makes it to stable.
// // ignore: prefer_collection_literals
// javascriptChannels: <JavascriptChannel>[
// _toasterJavascriptChannel(context),
// ].toSet(),
// navigationDelegate: (NavigationRequest request) {
// if (request.url.startsWith('https://www.youtube.com/')) {
// print('blocking navigation to $request}');
// return NavigationDecision.prevent;
// }
// print('allowing navigation to $request');
// return NavigationDecision.navigate;
// },
// onPageStarted: (String url) {
// print('Page started loading: $url');
// },
// onPageFinished: (String url) {
// print('Page finished loading: $url');
// },
// gestureNavigationEnabled: true,
// );
// }),
// );
// }
// JavascriptChannel _toasterJavascriptChannel(BuildContext context) {
// return JavascriptChannel(
// name: 'Toaster',
// onMessageReceived: (JavascriptMessage message) {
// ScaffoldMessenger.of(context).showSnackBar(
// SnackBar(content: Text(message.message)),
// );
// });
// }
// }
// import 'package:flutter/material.dart';
// import 'package:one_key/utils/event_bus.dart';
// import 'package:one_key/widgets/system_app_bar.dart';
// // import 'package:path_provider/path_provider.dart';
// import 'package:webview_flutter/webview_flutter.dart';
// // #docregion platform_imports
// // Import for Android features.
// import 'package:webview_flutter_android/webview_flutter_android.dart';
// // Import for iOS features.
// import 'package:webview_flutter_wkwebview/webview_flutter_wkwebview.dart';
// /**
// *
// * 帮助与反馈页面 功能暂时已经弃用
// */
// class WebViewPage extends StatefulWidget {
// @override
// _WebViewPageState createState() => _WebViewPageState();
// }
// class _WebViewPageState extends State<WebViewPage> {
// late WebViewController _controller = WebViewController();
// // late final WebViewController _controller;
// @override
// void initState() {
// super.initState();
// // Enable hybrid composition.
// // if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView();
// // #docregion platform_features
// late final PlatformWebViewControllerCreationParams params;
// if (WebViewPlatform.instance is WebKitWebViewPlatform) {
// params = WebKitWebViewControllerCreationParams(
// allowsInlineMediaPlayback: true,
// mediaTypesRequiringUserAction: const <PlaybackMediaTypes>{},
// );
// } else {
// params = const PlatformWebViewControllerCreationParams();
// }
// final WebViewController controller =
// WebViewController.fromPlatformCreationParams(params);
// // #enddocregion platform_features
// controller
// ..setJavaScriptMode(JavaScriptMode.unrestricted)
// ..setBackgroundColor(const Color(0x00000000))
// ..setNavigationDelegate(
// NavigationDelegate(
// onProgress: (int progress) {
// debugPrint('WebView is loading (progress : $progress%)');
// },
// onPageStarted: (String url) {
// debugPrint('Page started loading: $url');
// },
// onPageFinished: (String url) {
// debugPrint('Page finished loading: $url');
// },
// onWebResourceError: (WebResourceError error) {
// debugPrint('''
// Page resource error:
// code: ${error.errorCode}
// description: ${error.description}
// errorType: ${error.errorType}
// isForMainFrame: ${error.isForMainFrame}
// ''');
// },
// onNavigationRequest: (NavigationRequest request) {
// if (request.url.startsWith('https://www.youtube.com/')) {
// debugPrint('blocking navigation to ${request.url}');
// return NavigationDecision.prevent;
// }
// debugPrint('allowing navigation to ${request.url}');
// return NavigationDecision.navigate;
// },
// onUrlChange: (UrlChange change) {
// debugPrint('url change to ${change.url}');
// },
// onHttpAuthRequest: (HttpAuthRequest request) {
// // openDialog(request);
// },
// ),
// )
// ..addJavaScriptChannel(
// 'Toaster',
// onMessageReceived: (JavaScriptMessage message) {
// ScaffoldMessenger.of(context).showSnackBar(
// SnackBar(content: Text(message.message)),
// );
// },
// )
// ..loadRequest(Uri.parse("https://support.qq.com/product/152856"));
// // #docregion platform_features
// if (controller.platform is AndroidWebViewController) {
// AndroidWebViewController.enableDebugging(true);
// (controller.platform as AndroidWebViewController)
// .setMediaPlaybackRequiresUserGesture(false);
// }
// // #enddocregion platform_features
// _controller = controller;
// }
// @override
// void dispose() {
// // TODO: implement dispose
// EventBus().emit('changeStatusColor');
// super.dispose();
// }
// @override
// Widget build(BuildContext context) {
// return Scaffold(
// // We're using a Builder here so we have a context that is below the Scaffold
// // to allow calling Scaffold.of(context) so we can show a snackbar.
// appBar: SystemAppBar(
// '周到安排商家',
// ),
// body: Builder(builder: (BuildContext context) {
// return WebViewWidget(controller: _controller);
// // initialUrl: "https://support.qq.com/product/152856",
// // javascriptMode: JavascriptMode.unrestricted,
// // onWebViewCreated: (WebViewController webViewController) {
// // _controller.complete(webViewController);
// // },
// // // TODO(iskakaushik): Remove this when collection literals makes it to stable.
// // // ignore: prefer_collection_literals
// // javascriptChannels: <JavascriptChannel>[
// // _toasterJavascriptChannel(context),
// // ].toSet(),
// // navigationDelegate: (NavigationRequest request) {
// // if (request.url.startsWith('https://www.youtube.com/')) {
// // print('blocking navigation to $request}');
// // return NavigationDecision.prevent;
// // }
// // print('allowing navigation to $request');
// // return NavigationDecision.navigate;
// // },
// // onPageStarted: (String url) {
// // print('Page started loading: $url');
// // },
// // onPageFinished: (String url) {
// // print('Page finished loading: $url');
// // },
// // gestureNavigationEnabled: true,
// // );
// }),
// );
// }
// // JavascriptChannel _toasterJavascriptChannel(BuildContext context) {
// // return JavascriptChannel(
// // name: 'Toaster',
// // onMessageReceived: (JavascriptMessage message) {
// // ScaffoldMessenger.of(context).showSnackBar(
// // SnackBar(content: Text(message.message)),
// // );
// // });
// // }
// }
... ...
... ... @@ -120,7 +120,9 @@ class UpdateModelMy {
versionCode = info.buildNumber; //1
}
String make = "3";
if (Platform.isIOS) {
if (Platform.isAndroid) {
make = "3";
} else if (Platform.isIOS) {
make = "4";
} else if (Platform.isOhos) {
make = "5";
... ...
... ... @@ -132,7 +132,7 @@ import 'package:one_key/pages/sms/sms_page.dart';
import 'package:one_key/pages/table/select_table_page.dart';
import 'package:one_key/pages/my/photo_type/table_photo_manager_page.dart';
import 'package:one_key/pages/table/table_manager_page.dart';
import 'package:one_key/pages/webview/webview_page.dart';
import 'package:one_key/pages/webview/webview_page_ohos.dart';
import 'package:one_key/pages_sim/my/customer_type/store_customer/customer_list_page.dart';
import 'package:one_key/pages_sim/my/marketing_center/customer_notice_setting_page.dart';
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';
import '../pages/order_advance/order_edit_list_show_page.dart';
import '../pages/order_advance/order_preview_page.dart';
import '../pages/order_advance/order_share_page.dart';
import '../pages/webview/webview_page_anzhuo.dart';
import '../pages/webview/webview_page.dart';
import '../pages_sim/detail/handle_online_page.dart';
import '../pages_sim/detail/notebook_detail_page.dart';
import '../pages_sim/home/home_page.dart';
... ...
... ... @@ -4,6 +4,7 @@
"requires": true,
"packages": {
"../../../../../../fvm/versions/custom_3.27.4-ohos-dev/packages/flutter_tools/hvigor": {
"name": "flutter-hvigor-plugin",
"version": "1.0.0",
"license": "ISC",
"devDependencies": {
... ...
... ... @@ -9,6 +9,7 @@
}
},
"../../../../../../fvm/versions/custom_3.27.4-ohos-dev/packages/flutter_tools/hvigor": {
"name": "flutter-hvigor-plugin",
"version": "1.0.0",
"license": "ISC",
"devDependencies": {
... ...
... ... @@ -4,6 +4,7 @@
"requires": true,
"packages": {
"../../../../../../fvm/versions/custom_3.27.4-ohos-dev/packages/flutter_tools/hvigor": {
"name": "flutter-hvigor-plugin",
"version": "1.0.0",
"license": "ISC",
"devDependencies": {
... ...
... ... @@ -9,6 +9,7 @@
}
},
"../../../../../../fvm/versions/custom_3.27.4-ohos-dev/packages/flutter_tools/hvigor": {
"name": "flutter-hvigor-plugin",
"version": "1.0.0",
"license": "ISC",
"devDependencies": {
... ...
... ... @@ -7,12 +7,9 @@ import Foundation
import audioplayers_darwin
import connectivity_plus
import device_info_plus
import file_selector_macos
import flutter_app_badger
import flutter_app_icon_badge
import flutter_image_compress_macos
import flutter_inappwebview_macos
import flutter_udid
import package_info
import package_info_plus
... ... @@ -28,12 +25,9 @@ import video_player_avfoundation
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
AudioplayersDarwinPlugin.register(with: registry.registrar(forPlugin: "AudioplayersDarwinPlugin"))
ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin"))
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
FlutterAppBadgerPlugin.register(with: registry.registrar(forPlugin: "FlutterAppBadgerPlugin"))
FlutterAppIconBadgePlugin.register(with: registry.registrar(forPlugin: "FlutterAppIconBadgePlugin"))
FlutterImageCompressMacosPlugin.register(with: registry.registrar(forPlugin: "FlutterImageCompressMacosPlugin"))
InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin"))
FlutterUdidPlugin.register(with: registry.registrar(forPlugin: "FlutterUdidPlugin"))
FLTPackageInfoPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlugin"))
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
... ...
import type common from "@ohos:app.ability.common";
import fs from "@ohos:file.fs";
import util from "@ohos:util";
import Log from "@normalized:N&&&@ohos/flutter_ohos/src/main/ets/util/Log&1.0.0-2317265cd5";
const TAG = "FileUtils";
export default class FileUtils {
static getPathFromUri(context: common.Context | null, uri: string, defExtension?: string) {
Log.i(TAG, "getPathFromUri : " + uri);
let inputFile: fs.File;
try {
inputFile = fs.openSync(uri);
}
catch (err) {
Log.e(TAG, "open uri file failed err:" + err);
return null;
}
if (inputFile == null) {
return null;
}
const uuid = util.generateRandomUUID();
if (!context) {
return;
}
{
const targetDirectoryPath = context.cacheDir + "/" + uuid;
try {
fs.mkdirSync(targetDirectoryPath);
let targetDir = fs.openSync(targetDirectoryPath);
Log.i(TAG, "mkdirSync success targetDirectoryPath:" + targetDirectoryPath + " fd: " + targetDir.fd);
fs.closeSync(targetDir);
}
catch (err) {
Log.e(TAG, "mkdirSync failed err:" + err);
return null;
}
const inputFilePath = uri.substring(uri.lastIndexOf("/") + 1);
const inputFilePathSplits = inputFilePath.split(".");
Log.i(TAG, "getPathFromUri inputFilePath: " + inputFilePath);
const outputFileName = inputFilePathSplits[0];
let extension: string;
if (inputFilePathSplits.length == 2) {
extension = "." + inputFilePathSplits[1];
}
else {
if (defExtension) {
extension = defExtension;
}
else {
extension = ".jpg";
}
}
const outputFilePath = targetDirectoryPath + "/" + outputFileName + extension;
const outputFile = fs.openSync(outputFilePath, fs.OpenMode.CREATE);
try {
Log.i(TAG, "copyFileSync inputFile fd:" + inputFile.fd + " outputFile fd:" + outputFile.fd);
fs.copyFileSync(inputFile.fd, outputFilePath);
}
catch (err) {
Log.e(TAG, "copyFileSync failed err:" + err);
return null;
}
finally {
fs.closeSync(inputFile);
fs.closeSync(outputFile);
}
return outputFilePath;
}
}
}
{"@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":""}}
\ No newline at end of file
{
"layered-image": {
"background": "$media:150994946",
"foreground": "$media:150994947"
}
}
\ No newline at end of file
../../../oh_modules/.ohpm/@ohos+flutter_ohos@z+esrfzju6x1o3bcfuku8xtvaawms8gp1tiq996zf1o=/oh_modules/@ohos/flutter_ohos
\ No newline at end of file
../../../library/app_update_check_plugin/ohos
\ No newline at end of file
../../../../../.pub-cache/git/flutter_audioplayers-5b1f0f972b200b543b5ac27c46f8efba63662e12/packages/audioplayers_ohos/ohos
\ No newline at end of file
../../../../../.pub-cache/git/flutter_plus_plugins-8720286d1b4b664dbc1d87ba169125242d4f10fb/packages/connectivity_plus/connectivity_plus/ohos
\ No newline at end of file
../../../library/contants_select/ohos
\ No newline at end of file
../../../library/csp_amap_flutter_location-1.0.2/ohos
\ No newline at end of file
../../../library/csp_amap_flutter_map-10106fa7e336393b5af648e3441d9a19d0ad7bad_new/ohos
\ No newline at end of file
../../../../../.pub-cache/git/flutter_plus_plugins-9f92933f2ac78bb3d7ec534f22bc3183a257fbb9/packages/device_info_plus/device_info_plus/ohos
\ No newline at end of file
../../../../../.pub-cache/git/flutter_app_icon_badge-87a21b24a2d160623c74ff705c01ae5e29be7d25/ohos
\ No newline at end of file
../../../library/fluttertpc_flutter_barcode_scanner-af5d0e6d2bc53977f979c4f2b852f46274dc8405_new/ohos/ohos
\ No newline at end of file
../../../../../.pub-cache/hosted/pub.flutter-io.cn/flutter_bugly-1.1.0/ohos
\ No newline at end of file
../../../../../.pub-cache/git/fluttertpc_flutter_document_picker-ffd471d268656455a776e11d43ea86f8f500b9eb/ohos
\ No newline at end of file
../../../../../.pub-cache/git/fluttertpc_flutter_downloader-026ef4fcb90250e5f85dd3f2083e25512df6395a/ohos
\ No newline at end of file
../../../../../.pub-cache/hosted/pub.flutter-io.cn/flutter_image_compress_ohos-0.0.3/ohos
\ No newline at end of file
../../../../../.pub-cache/git/flutter_inappwebview-04b233befaeaa500d89e46b510ec072dd49dc5ee/flutter_inappwebview_ohos/ohos
\ No newline at end of file
../../../../../.pub-cache/git/flutter_keyboard_visibility-479318b7632199849ec43b44d89ecb81fa0f29bc/flutter_keyboard_visibility/ohos
\ No newline at end of file
../../../../../.pub-cache/git/flutter_native_contact_picker-b994d5f5b567a20513ba90ed60c3c311b661e7d7/ohos
\ No newline at end of file
../../../../../.pub-cache/git/flutter_native_image-c584b4a15afdef3f90b9a648a55809ec959a56b8/ohos
\ No newline at end of file
../../../../../.pub-cache/git/fluttertpc_flutter_sms-b91cabe9da18110ddf67e9114083b7699cdec588/ohos
\ No newline at end of file
../../../../../.pub-cache/git/fluttertpc_flutter_statusbarcolor_ns-785d70de3b6c9db5d5f477c734f515f40685f4ac/ohos/ohos
\ No newline at end of file
../../../../../.pub-cache/git/fluttertpc_flutter_udid-6b4b0306efd2b981b38baaf3ae0c8a38048fc244/ohos
\ No newline at end of file
../../../../../.pub-cache/git/flutter_fluttertoast-54a9ccaf32fbf0e53e0ce16ced890ebc49e04599/ohos
\ No newline at end of file
../../../../../.pub-cache/hosted/pub.flutter-io.cn/fluwx-5.7.5/ohos
\ No newline at end of file
../../../library/fluttertpc_image_cropper-65c2c99891882ea59732959a672f3d5993a837bb_new/image_cropper/ohos
\ No newline at end of file
../../../../../.pub-cache/git/flutter_image_gallery_saver-dd2f556450707bc9029ddfd475aa3142bb13aa98/ohos
\ No newline at end of file
../../../../../.pub-cache/git/flutter_packages-213ce425e799abcd6c8c4a1864adc7336add0145/packages/image_picker/image_picker_ohos/ohos
\ No newline at end of file
../../../../../fvm/versions/custom_3.27.4-ohos-dev/packages/integration_test/ohos
\ No newline at end of file
../../../../../.pub-cache/git/flutter_plus_plugins-0eb41c70f961f124a987b8de59c9a26ca919af17/packages/package_info_plus/package_info_plus/ohos
\ No newline at end of file
../../../../../.pub-cache/git/flutter_packages-759e65b17c9ddf365594b700b9ab7d13b87adbe9/packages/path_provider/path_provider_ohos/ohos
\ No newline at end of file
../../../../../.pub-cache/git/flutter_permission_handler-2b85757fa47bffca7b43fa224051cd979de106c2/permission_handler_ohos/ohos
\ No newline at end of file
../../../../../.pub-cache/git/flutter_photo_manager-5725d1e0c60e96e694fb9bfd163929da227b6dcb/ohos
\ No newline at end of file
../../../library/save_file/ohos
\ No newline at end of file
../../../../../.pub-cache/git/flutter_packages-759e65b17c9ddf365594b700b9ab7d13b87adbe9/packages/shared_preferences/shared_preferences_ohos/ohos
\ No newline at end of file
../../../../../.pub-cache/git/fluttertpc_dart_packages-fe6c48868bd3f3ce8ad599ce9a8c0508be4b41f7/packages/sign_in_with_apple/sign_in_with_apple/ohos
\ No newline at end of file
../../../../../.pub-cache/git/flutter_sqflite-a1f67c8d86367fbc35bd35052afae57192a575d2/sqflite/ohos
\ No newline at end of file
../../../library/TPNS-Flutter-Plugin-a5349371525462b1d1b6cfa4cf4d2a59503f1435_new/ohos
\ No newline at end of file