Commit c2c14ef7d02aa7407d58186316a55cfd8de698ba

Authored by weixin_45529955
1 parent 845ac3e5

微信分享登录&&预订表下载预览&&评论列表视频封面展示播放&&版本更新&&店铺门头照片裁剪

Showing 100 changed files with 2688 additions and 174 deletions

Too many changes to show.

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

... ... @@ -4,6 +4,8 @@ import 'package:fluwx/fluwx.dart';
class Constant {
static const int status_success = 200; //服务器返回成功
static const String ohos_app_id = '6917567548342276009'; //服务器返回成功
/**
*
* 打包注意事项 !!!!!!!! ****************苹果 看看导出预订数据****************
... ...
import 'dart:convert';
import 'package:common_utils/common_utils.dart';
class CommentsModel {
... ... @@ -212,21 +210,22 @@ class CommentsImageModel {
ImageAve? imageAve;
String? url;
String? avinfo;
CommentsImageModel(
{this.key,
this.bucket,
this.mimeType,
this.fsize,
this.exif,
this.imageInfo,
this.imageAve,
this.url,
this.avinfo,
});
CommentsImageModel.fromJson(Map<String, dynamic> json) {
String? filePath;
CommentsImageModel({
this.key,
this.bucket,
this.mimeType,
this.fsize,
this.exif,
this.imageInfo,
this.imageAve,
this.url,
this.avinfo,
});
CommentsImageModel.fromJson(Map<String, dynamic> json) {
key = json['key'];
bucket = json['bucket'];
mimeType = json['mimeType'];
... ... @@ -241,8 +240,6 @@ class CommentsImageModel {
url = json['url'];
avinfo = json['avinfo'] == null ? null : jsonEncode(json['avinfo']);
print(avinfo);
}
Map<String, dynamic> toJson() {
... ...
... ... @@ -542,6 +542,9 @@ class _MapChoicePointPageState extends State<MapChoicePointPage> {
list.add(new PoiModel(title.toString(), cityStr, latLng));
}
print(list);
setState(() {
// isloading = false;
});
... ...
... ... @@ -30,6 +30,10 @@ 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;
... ...
import 'dart:async';
import 'dart:io';
import 'dart:ui';
... ... @@ -10,6 +9,7 @@ import 'package:flutter/rendering.dart';
import 'package:one_key/models/comments_label_model.dart';
import 'package:one_key/models/comments_model.dart';
import 'package:one_key/pages/my/comment_manage/input_buttom_widget.dart';
import 'package:one_key/pages/my/comment_manage/ohos_video_page.dart';
import 'package:one_key/pages/my/comment_manage/pop_route.dart';
import 'package:one_key/pages/my/comment_manage/video_page.dart';
import 'package:one_key/provider/user_model.dart';
... ... @@ -36,6 +36,11 @@ import '../../online_check/photo_view_wiget.dart';
// import 'package:cached_video_player/cached_video_player.dart';
import 'package:video_thumbnail/video_thumbnail.dart';
import 'package:path_provider_platform_interface/path_provider_platform_interface.dart';
import 'package:dio/dio.dart';
// import 'package:flutter_downloader/flutter_downloader.dart';
/**
* 评价管理
*/
... ... @@ -60,7 +65,8 @@ class _CommentManageHomePageState extends State<CommentManageHomePage> {
starTextMap = {'1': '差', '2': '有点差', '3': '一般', '4': '满意', '5': '非常满意'};
WidgetsBinding.instance.addPostFrameCallback((_) {
WidgetsBinding.instance.addPostFrameCallback((_) async {
// await FlutterDownloader.initialize(debug: true, ignoreSsl: true);
_getSellerComments(isShowLoading: false);
// _getCountCommentLabel(isShowLoading: false);
});
... ... @@ -111,7 +117,7 @@ class _CommentManageHomePageState extends State<CommentManageHomePage> {
};
bool success = await commentManageProvider.setComment(context, pramas,
isShowLoading: isShowLoading) ;
isShowLoading: isShowLoading);
if (success) {
//成功 刷新列表
_getSellerComments(isShowLoading: false);
... ... @@ -180,24 +186,97 @@ class _CommentManageHomePageState extends State<CommentManageHomePage> {
// return data;
// }
Future<String?>? getThumbnailFile(
Future<String?>? getThumbnailFile(
List<CommentsImageModel> imags, int index) async {
final fileName = await VideoThumbnail.thumbnailFile(
video: imags[index].url!,
thumbnailPath: (await getTemporaryDirectory()).path,
// imageFormat: ImageFormat.WEBP,
// maxHeight:
// 64, // specify the height of the thumbnail, let the width auto-scaled to keep the source aspect ratio
quality: 100,
String? thumbnailPath;
if (Platform.isAndroid || Platform.isIOS) {
thumbnailPath = (await getTemporaryDirectory()).path;
try {
final fileName = await VideoThumbnail.thumbnailFile(
video: imags[index].url!,
thumbnailPath: thumbnailPath,
// imageFormat: ImageFormat.WEBP,
// maxHeight:
// 64, // specify the height of the thumbnail, let the width auto-scaled to keep the source aspect ratio
quality: 100,
);
print(fileName);
return fileName;
} catch (e) {
print(e);
}
} else if (Platform.isOhos) {
// final PathProviderPlatform provider = PathProviderPlatform.instance;
// thumbnailPath = await provider.getExternalStoragePath();
// Directory? downloadsDir = await getTemporaryDirectory();
thumbnailPath = (await getTemporaryDirectory()).path;
// getTemporaryDirectory().then((d) => thumbnailPath = d.path);
print(thumbnailPath);
String fileName = Utils.extractFileNameFromUrl(imags[index].url!);
print("File Name: $fileName"); // 输出:File Name: file.txt
//鸿蒙,flutter侧下载视频到缓存,然后使用video_thumbnail 插件从鸿蒙设备本地缓存读取文件并获取第一帧图片
String thumbnailPathVideo = await downloadVideo(
imags[index].url!, thumbnailPath + '/' + fileName);
try {
final fileName = await VideoThumbnail.thumbnailFile(
video: thumbnailPathVideo,
thumbnailPath: thumbnailPath,
// imageFormat: ImageFormat.WEBP,
// maxHeight:
// 64, // specify the height of the thumbnail, let the width auto-scaled to keep the source aspect ratio
quality: 100,
);
imags[index].filePath = fileName;
print(fileName);
return fileName;
} catch (e) {
print(e);
}
}
return null;
}
Future<String> downloadVideo(String url, String savePath) async {
var dio = Dio();
var response = await dio.get(
url,
options: Options(responseType: ResponseType.bytes),
);
return fileName;
final file = File(savePath);
File tempFile = await file.writeAsBytes(response.data); // 将字节写入文件
return tempFile.path;
}
// Future<void> _requestDownload(String url) async {
//ohos不需要请求权限,路径直接返回image
// String _localPath = 'Image';
// try {
// String? taskId = await FlutterDownloader.enqueue(
// url: url,
// headers: {'auth': 'test_for_sql_encoding'},
// savedDir: _localPath,
// saveInPublicStorage: false,
// );
// print(taskId);
// } catch (e) {
// print(e);
// }
// 下载结束后把缓存地址给鸿蒙原生回传
// }
/// 九宫格
Widget _getGridImg(List<CommentsImageModel> imags) {
imags.removeWhere((element) => element.url == null || element.url == '');
return GridView.builder(
controller: controller,
padding: EdgeInsets.symmetric(vertical: w(7)),
... ... @@ -214,7 +293,7 @@ class _CommentManageHomePageState extends State<CommentManageHomePage> {
crossAxisSpacing: w(7),
//子组件宽高长度比例
childAspectRatio: 1.0),
itemBuilder: (BuildContext context, int index){
itemBuilder: (BuildContext context, int index) {
if (imags[index].avinfo != null &&
imags[index].avinfo != 'false' &&
imags[index].avinfo != '0') {
... ... @@ -238,12 +317,21 @@ class _CommentManageHomePageState extends State<CommentManageHomePage> {
if (snapshot.hasData) {
return InkWell(
onTap: () {
Navigator.push(
context,
PopRoute(
child: VideoPage(
url: imags[index].url,
)));
if (Platform.isIOS || Platform.isAndroid) {
Navigator.push(
context,
PopRoute(
child: VideoPage(
url: imags[index].url,
)));
} else {
Navigator.push(
context,
PopRoute(
child: BumbleBeeRemoteVideo(
imags[index].url ?? '',imags[index].filePath
)));
}
},
child: Stack(alignment: Alignment.center, children: [
ClipRRect(
... ...
import 'dart:io';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/screen_util.dart';
import 'package:video_player/video_player.dart';
import '../../../widgets/system_app_bar.dart';
class BumbleBeeRemoteVideo extends StatefulWidget {
const BumbleBeeRemoteVideo(this.url, this.filePath);
final String? filePath;
final String url;
@override
BumbleBeeRemoteVideoState createState() => BumbleBeeRemoteVideoState();
}
class BumbleBeeRemoteVideoState extends State<BumbleBeeRemoteVideo> {
late VideoPlayerController _controller;
// Future<ClosedCaptionFile> _loadCaptions() async {
// final String fileContents = await DefaultAssetBundle.of(context)
// .loadString('assets/bumble_bee_captions.vtt');
// return WebVTTCaptionFile(
// fileContents); // For vtt files, use WebVTTCaptionFile
// }
@override
void initState() {
super.initState();
_controller = VideoPlayerController.networkUrl(
Uri.parse(widget.url),
// Uri.parse(
// 'https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4'),
// closedCaptionFile: _loadCaptions(),
videoPlayerOptions: VideoPlayerOptions(mixWithOthers: true),
// viewType: widget.viewType,
);
_controller.addListener(() {
setState(() {});
});
_controller.setLooping(true);
_controller.initialize();
// _controller.initialize().then((_) {
// // 确保添加了这一行,以便在初始化完成后执行操作
// setState(() {});
// });
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: SystemAppBar("评价管理"),
body: Container(
child: _controller.value.isInitialized
? Center(
child: Stack(
alignment: Alignment.bottomCenter,
children: <Widget>[
VideoPlayer(_controller),
// widget.filePath != null
// ? Image.file(
// File(widget.filePath!),
// fit: BoxFit.contain,
// width: ScreenUtil().screenWidth,
// height: ScreenUtil().screenHeight,
// )
// : SizedBox(),
// ClosedCaption(text: _controller.value.caption.text),
_ControlsOverlay(controller: _controller),
VideoProgressIndicator(
_controller,
allowScrubbing: true,
colors: VideoProgressColors(
playedColor: MyColours.color_438E93,
bufferedColor: Colors.black,
backgroundColor: Colors.black),
),
],
),
// AspectRatio(
// aspectRatio: _controller.value.aspectRatio,
// child:
// ),
// Material(
// child: SingleChildScrollView(
// child: Column(
// children: <Widget>[
// // // Container(padding: const EdgeInsets.only(top: 20.0)),
// // // const Text('With remote mp4'),
// // Container(
// // // padding: const EdgeInsets.all(20),
// // child:
// // ),
// ],
// ),
// ))
)
: Container(
width: ScreenUtil().screenWidth,
height: ScreenUtil().screenHeight,
color: MyColours.color_000000,
child: SizedBox(
width: ScreenUtil().setWidth(80),
height: ScreenUtil().setWidth(80),
child: Center(
child: CircularProgressIndicator(
color: Colors.white,
),
)),
),
));
}
}
class _ControlsOverlay extends StatelessWidget {
const _ControlsOverlay({required this.controller});
// static const List<Duration> _exampleCaptionOffsets = <Duration>[
// Duration(seconds: -10),
// Duration(seconds: -3),
// Duration(seconds: -1, milliseconds: -500),
// Duration(milliseconds: -250),
// Duration.zero,
// Duration(milliseconds: 250),
// Duration(seconds: 1, milliseconds: 500),
// Duration(seconds: 3),
// Duration(seconds: 10),
// ];
// static const List<double> _examplePlaybackRates = <double>[
// 0.25,
// 0.5,
// 1.0,
// 1.5,
// 2.0,
// 3.0,
// 5.0,
// 10.0,
// ];
final VideoPlayerController controller;
@override
Widget build(BuildContext context) {
return Stack(
children: <Widget>[
AnimatedSwitcher(
duration: const Duration(milliseconds: 50),
reverseDuration: const Duration(milliseconds: 200),
child: controller.value.isPlaying
? const SizedBox.shrink()
: const ColoredBox(
color: Colors.black26,
child: Center(
child: Icon(
Icons.play_arrow,
color: Colors.white,
size: 50,
semanticLabel: 'Play',
),
),
),
),
GestureDetector(
onTap: () {
controller.value.isPlaying ? controller.pause() : controller.play();
},
),
// Align(
// alignment: Alignment.topLeft,
// child: PopupMenuButton<Duration>(
// initialValue: controller.value.captionOffset,
// tooltip: 'Caption Offset',
// onSelected: (Duration delay) {
// controller.setCaptionOffset(delay);
// },
// itemBuilder: (BuildContext context) {
// return <PopupMenuItem<Duration>>[
// for (final Duration offsetDuration in _exampleCaptionOffsets)
// PopupMenuItem<Duration>(
// value: offsetDuration,
// child: Text('${offsetDuration.inMilliseconds}ms'),
// )
// ];
// },
// child: Padding(
// padding: const EdgeInsets.symmetric(
// // Using less vertical padding as the text is also longer
// // horizontally, so it feels like it would need more spacing
// // horizontally (matching the aspect ratio of the video).
// vertical: 12,
// horizontal: 16,
// ),
// child: Text('${controller.value.captionOffset.inMilliseconds}ms'),
// ),
// ),
// ),
// Align(
// alignment: Alignment.topRight,
// child: PopupMenuButton<double>(
// initialValue: controller.value.playbackSpeed,
// tooltip: 'Playback speed',
// onSelected: (double speed) {
// controller.setPlaybackSpeed(speed);
// },
// itemBuilder: (BuildContext context) {
// return <PopupMenuItem<double>>[
// for (final double speed in _examplePlaybackRates)
// PopupMenuItem<double>(
// value: speed,
// child: Text('${speed}x'),
// )
// ];
// },
// child: Padding(
// padding: const EdgeInsets.symmetric(
// // Using less vertical padding as the text is also longer
// // horizontally, so it feels like it would need more spacing
// // horizontally (matching the aspect ratio of the video).
// vertical: 12,
// horizontal: 16,
// ),
// child: Text('${controller.value.playbackSpeed}x'),
// ),
// ),
// ),
],
);
}
}
... ...
... ... @@ -2,9 +2,9 @@ import 'dart:async';
import 'dart:io';
import 'package:common_utils/common_utils.dart';
// import 'package:device_info/device_info.dart';
import 'package:device_info/device_info.dart';
import 'package:device_info_plus/device_info_plus.dart';
// import 'package:device_info_plus/device_info_plus.dart';
// import 'package:device_info_plus/device_info_plus.dart';
... ... @@ -39,6 +39,11 @@ import 'package:excel/excel.dart' as excelUtil;
import '../../../../widgets/loading.dart';
import 'package:path_provider_platform_interface/path_provider_platform_interface.dart';
// import 'package:flutter_document_picker/flutter_document_picker.dart';
// import 'package:file_document_saver/file_document_saver.dart';
import 'package:save_file/save_file.dart';
// import 'package:open_file_plus/open_file_plus.dart';
// import 'package:flutter_filereader/flutter_filereader.dart';
... ... @@ -103,6 +108,20 @@ class _ExportBookDataPageState extends State<ExportBookDataPage> {
externalStorageDirPath =
externalStorageDirPath.replaceFirst("Library/Caches", "Documents");
} else if (Platform.isOhos) {
final PathProviderPlatform provider = PathProviderPlatform.instance;
String? externalStorageDirPath1 = await provider.getExternalStoragePath();
// Directory? downloadsDir =await getApplicationDocumentsDirectory();
// Directory? downloadsDir = await getTemporaryDirectory();
// getDownloadsDirectory();
// getApplicationDocumentsDirectory();
// getDownloadsDirectory();
// provider.getTemporaryPath(); cache
// String? externalStorageDirPath1 = downloadsDir.path;
// ;
print(externalStorageDirPath1);
return externalStorageDirPath1;
}
return externalStorageDirPath;
}
... ... @@ -110,33 +129,7 @@ class _ExportBookDataPageState extends State<ExportBookDataPage> {
Future<bool> _checkPermission() async {
if (Platform.isIOS) {
return true;
}
if (Platform.isOhos) {
// DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin();
// Map<String, dynamic> _deviceData = (await deviceInfoPlugin.ohosInfo).data;
// print(_deviceData);
var status = await Permission.storage.status;
if (!status.isGranted) {
var result = await Permission.storage.request();
if (result.isGranted) {
// 权限被用户允许
print('Permission granted');
return true;
} else {
// 权限被用户拒绝
print('Permission denied');
return false;
}
} else {
// 权限已经授权
print('Permission already granted');
return true;
}
}
if (Platform.isAndroid) {
} else if (Platform.isAndroid) {
final info = await DeviceInfoPlugin().androidInfo;
if (info.version.sdkInt >= 33) {
... ... @@ -183,7 +176,30 @@ class _ExportBookDataPageState extends State<ExportBookDataPage> {
}
return result == PermissionStatus.granted;
}
} else if (Platform.isOhos) {
// return true;
// DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin();
// Map<String, dynamic> _deviceData = (await deviceInfoPlugin.ohosInfo).data;
// print(_deviceData);
var status = await Permission.photos.status;
if (!status.isGranted) {
var result = await Permission.photos.request();
if (result.isGranted) {
// 权限被用户允许
print('Permission granted');
return true;
} else {
// 权限被用户拒绝
print('Permission denied');
return false;
}
} else {
// 权限已经授权
print('Permission already granted');
return true;
}
}
// manageExternalStorage
throw StateError('unknown platform');
}
... ... @@ -280,6 +296,26 @@ class _ExportBookDataPageState extends State<ExportBookDataPage> {
return data;
}
_openOHOSFile(String? filePath) async {
// OpenFilex.open 需要传入有权限访问的文件地址才能访问,比如应用沙箱路径下的文件
// 这里使用了其它三方库来自定义选取文件做功能展示
var _openResult = 'Unknown';
// String? path = await FlutterDocumentPicker.openDocument();
if (filePath != null) {
// String filePath = "file://com.crazecoder.openfile.example$path";
final result = await OpenFilex.open(
filePath);
_openResult = "type=${result.type} message=${result.message}";
} else {
// setState(() {
_openResult = "User canceled the picker";
// });
}
print(_openResult);
}
void _download() async {
Loading.showLoading(
context,
... ... @@ -378,7 +414,7 @@ class _ExportBookDataPageState extends State<ExportBookDataPage> {
String timetemp =
((DateTime.now().millisecondsSinceEpoch / 1000).floor()).toString();
String sunfix = '.xlsx';
// String sunfix = '.xls';
// String fileName = "/${sellername}${starttime}至${endtime}.xlsx";
String fileName = nameS + timetemp + sunfix;
... ... @@ -388,14 +424,41 @@ class _ExportBookDataPageState extends State<ExportBookDataPage> {
String filePath = _localPath! + '${fileName}';
if (fileBytes != null) {
File file = File(filePath)
..createSync(recursive: true)
..writeAsBytesSync(fileBytes);
try {
File file1 = await file.copy('/storage/emulated/0/Download${fileName}');
// Utils.showToast('文件已保存到${file1.path}');
} catch (e) {
// Utils.showToast('保存失败!');
String? resultPath ;
if (Platform.isIOS || Platform.isAndroid) {
File file = File(filePath)
..createSync(recursive: true)
..writeAsBytesSync(fileBytes);
try {
File file1 =
await file.copy('/storage/emulated/0/Download${fileName}');
// Utils.showToast('文件已保存到${file1.path}');
} catch (e) {
// Utils.showToast('保存失败!');
}
} else if (Platform.isOhos) {
File file = File(filePath)
..createSync(recursive: true)
..writeAsBytesSync(fileBytes);
try {
final _saveFilePlugin = SaveFile();
resultPath = await _saveFilePlugin.saveFile(file.path,'${sellername}${starttime}至${endtime}_${timetemp}');
print(resultPath);
} catch (e) {
print(e);
}
// try {
// File file1 = await file
// .copy('/storage/media/100/local/files/Documents${fileName}');
// } catch (e) {
// print(e);
// }
// 把当前存储目录的文件复制到文件管理器的文档目录里
// String downloadUri = FileManager.getUri(FileManager.DIRECTORY_DOWNLOADS);
// File file = new File(downloadUri + "/filename.txt");
// file.writeString('content');
}
Loading.hideLoading(context);
... ... @@ -409,20 +472,27 @@ class _ExportBookDataPageState extends State<ExportBookDataPage> {
progress = null;
setState(() {});
}, rCallback: () async {
// final result =
// await OpenFilex.open(filePath, type: 'application/vnd.ms-excel');
final result = await OpenFilex.open(filePath,
type:
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
print(result.type);
if (result.type == ResultType.noAppToOpen) {
Utils.showToast('没有应用可以打开');
} else if (result.type == ResultType.fileNotFound) {
Utils.showToast('找不到文件');
} else if (result.type == ResultType.permissionDenied) {
Utils.showToast('没有相关权限');
} else if (result.type == ResultType.permissionDenied) {
Utils.showToast('发生未知错误');
if (Platform.isAndroid || Platform.isIOS) {
// final result =
// await OpenFilex.open(filePath, type: 'application/vnd.ms-excel');
final result = await OpenFilex.open(filePath,
type:
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
print(result.type);
if (result.type == ResultType.noAppToOpen) {
Utils.showToast('没有应用可以打开');
} else if (result.type == ResultType.fileNotFound) {
Utils.showToast('找不到文件');
} else if (result.type == ResultType.permissionDenied) {
Utils.showToast('没有相关权限');
} else if (result.type == ResultType.permissionDenied) {
Utils.showToast('发生未知错误');
}
} else if (Platform.isOhos) {
_openOHOSFile(filePath);
// _openOHOSFile(resultPath);
}
});
} else {
... ... @@ -648,16 +718,16 @@ class _ExportBookDataPageState extends State<ExportBookDataPage> {
}
}
} else {
// String title = Platform.isAndroid ? '存储' : '相册';
String title = Platform.isIOS ? '相册' : Platform.isAndroid ?'存储':'图片和视频';
// //用户选择不在弹出权限提示框
// print('never');
// // Navigator.pop(context);
// DialogUtil.openAlertDialog(context, '未获得${title}权限',
// "请在手机的权限管理里,将${title}权限开启", '去设置', 340.0, onTap: () {
// openSetting();
// Navigator.pop(context, '');
// });
DialogUtil.openAlertDialog(context, '未获得${title}权限',
"请在手机的权限管理里,将${title}权限开启", '去设置', 340.0, onTap: () {
openSetting();
Navigator.pop(context, '');
});
}
},
)
... ...
... ... @@ -6,6 +6,7 @@ import 'package:flutter_app_update/azhon_app_update.dart';
// import 'package:flutter_ex_widget/ex_text.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:fluwx/fluwx.dart';
import 'package:install_plugin/install_plugin.dart';
import 'package:one_key/constant/state.dart';
import 'package:one_key/models/sms_info.dart';
import 'package:one_key/models/store_info.dart';
... ... @@ -1775,7 +1776,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
)),
VEmptyView(48),
InkWell(
onTap: () {
onTap: () async {
UserModel usermodel =
Provider.of<UserModel>(context,
listen: false);
... ...
... ... @@ -869,7 +869,6 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> {
Uint8List newImg = (await Utils.testFromFileComporessList(
context, afterImg,
needResize: true))!;
print(Utils.size(newImg.length));
if (newImg != null) {
String? path = await Utils.saveImage(newImg);
... ... @@ -1930,7 +1929,8 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> {
FocusScope.of(context).requestFocus(
FocusNode()); //点击空白处隐藏键盘
},
keyboardType: TextInputType.numberWithOptions(),
keyboardType:
TextInputType.numberWithOptions(),
),
)),
HEmptyView(20),
... ... @@ -2016,7 +2016,8 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> {
.requestFocus(
FocusNode()); //点击空白处隐藏键盘
},
keyboardType: TextInputType.numberWithOptions(),
keyboardType: TextInputType
.numberWithOptions(),
),
)),
HEmptyView(20),
... ...
... ... @@ -1719,9 +1719,17 @@ class MyPageSimState extends State<MyPageSim> with WidgetsBindingObserver {
VEmptyView(48),
InkWell(
onTap: () {
UpdateModelMy updateModel =
new UpdateModelMy();
updateModel.showUpdateDialog(
context,Version());
UserModel usermodel =
Provider.of<UserModel>(context,
listen: false);
if (usermodel.downLoading) {
Utils.showToast("正在后台下载新版本…");
return;
... ...
... ... @@ -20,11 +20,13 @@ import 'package:one_key/utils/misc.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/MyDivider.dart';
import 'package:one_key/widgets/v_empty_view.dart';
// import 'package:package_info/package_info.dart';
import 'package:path_provider/path_provider.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import 'package:flutter_app_update/azhon_app_update.dart';
import 'package:flutter_app_update/update_model.dart';
import 'package:url_launcher/url_launcher.dart';
import '../app.dart';
import '../utils/dialog_util.dart';
... ... @@ -32,6 +34,8 @@ import 'package:device_utils_my/device_utils_my.dart';
import '../widgets/fixed_text.dart';
import 'package:package_info_plus/package_info_plus.dart';
typedef VeisonCallback = void Function(Version value);
class UpdateModelMy {
... ... @@ -105,15 +109,22 @@ class UpdateModelMy {
//检查更新
checkUpdate(BuildContext context, VeisonCallback callback,
{showToast = true}) async {
String deviceId = await Utils.getUUID()??''; //鸿蒙获取uuid代码测试
String deviceId = await Utils.getUUID() ?? ''; //鸿蒙获取uuid代码测试
UserModel userModel = Provider.of<UserModel>(context, listen: false);
int versionCode = await AzhonAppUpdate.getVersionCode;
String versionCode = '';
if (Platform.isIOS || Platform.isAndroid) {
versionCode = (await AzhonAppUpdate.getVersionCode).toString();
} else if (Platform.isOhos) {
final info = await PackageInfo.fromPlatform();
// String version = info.version; // 1.0.0
versionCode = info.buildNumber; //1
}
String make = "3";
if (Platform.isIOS) make = "4";
Map<String, String?> params = {
"deviceId": deviceId,
"sid": userModel.user!.sellerid,
"versionCode": versionCode.toString(),
"versionCode": versionCode,
"flag": "4",
"make": make, //3 android 4 ios
};
... ... @@ -124,7 +135,7 @@ class UpdateModelMy {
if (baseResp != null && baseResp.code == Constant.status_success) {
LogUtil.v(baseResp.data);
Map<String, dynamic> dataMap = baseResp.data![0];
if (int.parse(dataMap["version"].toString()) > versionCode) {
if (int.parse(dataMap["version"].toString()) > int.parse(versionCode)) {
Version version = Version.fromJson({
"name": dataMap["name"].toString(),
"version": dataMap["version"].toString(),
... ... @@ -166,6 +177,22 @@ class UpdateModelMy {
}
}
Future<void> launchHarmonyAppStore(String appId) async {
final urls = [
'harmony://appstore/$appId', // 鸿蒙原生Scheme
'https://appgallery.huawei.com/app/$appId', // 网页版
];
for (final url in urls) {
if (await canLaunch(url)) {
await launch(url);
return;
}
}
// 所有方案都失败时打开默认应用商店主页
await launch('https://appgallery.huawei.com');
}
//版本更新弹框
showUpdateDialog(BuildContext pageContext, Version? version) {
showDialog(
... ... @@ -243,10 +270,12 @@ class UpdateModelMy {
// tryOtaUpdate(version.file_url);
simpleUse(false, version.file_url);
Navigator.of(context).pop();
} else {
} else if (Platform.isIOS) {
Navigator.of(context).pop();
InstallPlugin.gotoAppStore(
"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=1510697490");
} else if (Platform.isOhos) {
launchHarmonyAppStore(Constant.ohos_app_id);
}
},
child: FixedText(
... ...
... ... @@ -12,7 +12,7 @@ class MyColours {
static const Color color_FBF6F1 = Color(0xFFFBF6F1);
static const Color color_4D4E50 = Color(0xFF4D4E50);
static const Color color_00715F = Color(0xFF00715F);
static const Color color_80D9D9D9 = Color(0x80D9D9D9);
static const Color color_80D9D9D9 = Color.fromARGB(128, 12, 3, 3);
static const Color color_42A5FF = Color(0xFF42A5FF);
static const Color color_4C8DAD = Color(0xFF4C8DAD);
static const Color color_4D0C0F0E = Color(0x4D0C0F0E);
... ...
import 'package:flutter/material.dart';
import 'package:image_cropper/image_cropper.dart';
class CropImageUtils {
static cropImage(BuildContext context, String path) async {
final croppedFile = await ImageCropper().cropImage(
sourcePath: path,
compressFormat: ImageCompressFormat.jpg,
compressQuality: 100,
uiSettings: [
AndroidUiSettings(
// backgroundColor: Colors.red,
// toolbarTitle: 'Cropper',
// toolbarColor: Colors.deepOrange,
// toolbarWidgetColor: Colors.white,
// initAspectRatio: CropAspectRatioPreset.ratio5x4,
cropStyle: CropStyle.rectangle,
aspectRatioPresets: [CropAspectRatioPreset.ratio5x4],
hideBottomControls: true,
lockAspectRatio: true),
IOSUiSettings(
// title: 'Cropper',
// rotateButtonsHidden: true,
// rotateClockwiseButtonHidden: true,
cropStyle: CropStyle.rectangle,
aspectRatioPresets: [CropAspectRatioPreset.ratio5x4],
resetAspectRatioEnabled: false,
doneButtonTitle: '确定',
cancelButtonTitle: '取消',
aspectRatioLockEnabled: true),
// AndroidUiSettings(
// toolbarTitle: '裁剪',
// toolbarColor: Colors.white,
// toolbarWidgetColor: Colors.white,
// initAspectRatio: CropAspectRatioPreset.square,
// lockAspectRatio: false,
// aspectRatioPresets: [
// // CropAspectRatioPreset.original,
// // CropAspectRatioPreset.square,
// CropAspectRatioPreset.ratio5x4,
// // CropAspectRatioPresetCustom(),
// ],
// ),
// IOSUiSettings(
// title: '裁剪',
// aspectRatioPresets: [
// // CropAspectRatioPreset.original,
// // CropAspectRatioPreset.square,
// CropAspectRatioPreset.ratio5x4,
// // CropAspectRatioPresetCustom(),
// ],
// ),
WebUiSettings(
context: context,
presentStyle: WebPresentStyle.dialog,
size: const CropperSize(
width: 500,
height:400,
),
),
],
);
return croppedFile;
}
}
// class CropAspectRatioPresetCustom implements CropAspectRatioPresetData {
// @override
// (int, int)? get data => (5, 4);
// @override
// String get name => '5x4';
// }
... ...
import 'dart:async';
import 'dart:io';
... ... @@ -10,14 +9,28 @@ import 'package:permission_handler/permission_handler.dart';
import '../app.dart';
FutureOr<bool> checkPermissionStorage() async {
var status = await Permission.storage.status;
if (!status.isGranted) {
status = await Permission.storage.request();
if (status.isGranted) {
if (Platform.isIOS || Platform.isAndroid) {
var status = await Permission.storage.status;
if (!status.isGranted) {
status = await Permission.storage.request();
if (status.isGranted) {
return true;
}
} else {
return true;
}
} else {
return true;
return false;
} else if (Platform.isOhos) {
var status = await Permission.photos.status;
if (!status.isGranted) {
status = await Permission.photos.request();
if (status.isGranted) {
return true;
}
} else {
return true;
}
return false;
}
return false;
}
... ... @@ -40,7 +53,7 @@ FutureOr<bool> checkPermission(Permission permissionGroup) async {
}
}
FutureOr<bool> requestPermission( Permission permissionGroup) async {
FutureOr<bool> requestPermission(Permission permissionGroup) async {
//全局提示权限使用目的
if (Platform.isAndroid) {
//全局提示权限使用目的
... ... @@ -68,13 +81,13 @@ FutureOr<bool> requestPermission( Permission permissionGroup) async {
}
final permissions = await [permissionGroup].request();
if(App.isShowDes){
//全局提示权限使用目的
if (App.isShowDes) {
//全局提示权限使用目的
BuildContext context = App.navigatorKey.currentState!.overlay!.context;
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
}
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
}
if (await permissionGroup.request().isGranted) {
print(true);
// Either the permission was already granted before or the user just granted it.
... ...
... ... @@ -6,8 +6,6 @@
* @Description: 截图工具,生成截图,保存到相册或者保存本地cash文件夹返回文件路径(供分享使用)
*/
import 'dart:io';
import 'dart:typed_data';
import 'dart:async';
... ... @@ -45,9 +43,17 @@ class RepaintBoundaryUtils {
bool isDirExist = await Directory(applicationDir.path).exists();
if (!isDirExist) Directory(applicationDir.path).create();
// 直接保存,返回的就是保存后的文件
File saveFile = await File(
applicationDir.path + "${DateTime.now().toIso8601String()}.jpg")
.writeAsBytes(pngBytes);
File saveFile;
if (Platform.isOhos) {
// 直接保存,返回的就是保存后的文件
saveFile = await File(
applicationDir.path + "/${DateTime.now().toIso8601String()}.jpg")
.writeAsBytes(pngBytes);
} else {
saveFile = await File(
applicationDir.path + "${DateTime.now().toIso8601String()}.jpg")
.writeAsBytes(pngBytes);
}
filePath = saveFile.path;
// if (Platform.isAndroid) {
// // 如果是Android 的话,直接使用image_gallery_saver就可以了
... ...
... ... @@ -24,6 +24,7 @@ import 'package:fluwx/fluwx.dart';
import 'package:one_key/provider/my_model.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/crop_image_utils.dart';
import 'package:one_key/utils/dialog_util.dart';
import 'package:one_key/utils/lunar_calendar.dart';
import 'package:one_key/utils/misc.dart';
... ... @@ -31,7 +32,7 @@ import 'package:one_key/route/navigator_util.dart';
import 'package:one_key/utils/screen_util.dart';
import 'package:one_key/utils/wx_sdk.dart';
import 'package:one_key/widgets/loading.dart';
import 'package:package_info/package_info.dart';
// import 'package:package_info_plus/package_info_plus.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
... ... @@ -54,10 +55,24 @@ import '../models/recharge_list_model.dart';
// import 'dart:typed_data';
import 'dart:typed_data';
// import 'package:image/image.dart' as Img;
import 'package:path/path.dart' as p; // 导入path包
import 'package:flutter_udid/flutter_udid.dart';
// import 'package:package_info/package_info.dart';
import 'package:package_info_plus/package_info_plus.dart';
typedef BookTimeSetCallback = void Function(bool needChange);
class Utils {
static String extractFileNameFromUrl(String url) {
try {
Uri uri = Uri.parse(url);
return p.basename(uri.path); // 使用basename函数提取文件名
} catch (e) {
print("Error parsing URL: $e");
return ""; // 或者返回null或抛出异常,根据你的需求处理错误情况
}
}
static bool isBeforeToday(DateTime dateToCompare) {
DateTime today = DateTime.now();
// 只比较年、月、日部分,忽略时间部分
... ... @@ -1714,7 +1729,7 @@ class Utils {
NavigatorUtil.goWebviewPage(context);
}
//获取应用版本昊
//获取应用版本h号
static getCurrVersion() async {
PackageInfo packageInfo = await PackageInfo.fromPlatform();
String version = packageInfo.version;
... ... @@ -1726,16 +1741,27 @@ class Utils {
PackageInfo packageInfo = await PackageInfo.fromPlatform();
return int.parse(packageInfo.buildNumber);
}
//获取唯一标识
//获取唯一标识
static Future<String> getUUID() async {
DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin();
if (Platform.isAndroid) {
AndroidDeviceInfo androidDeviceInfo = await deviceInfoPlugin.androidInfo;
return androidDeviceInfo.androidId;
} else {
} else if (Platform.isIOS) {
IosDeviceInfo iosDeviceInfo = await deviceInfoPlugin.iosInfo;
return iosDeviceInfo.identifierForVendor;
} else if (Platform.isOhos) {
String udid;
try {
udid = await FlutterUdid.udid;
} on PlatformException {
udid = 'Failed to get UDID.';
}
return udid;
}
return '';
}
//获取唯一标识
... ... @@ -1749,7 +1775,7 @@ class Utils {
// IosDeviceInfo iosDeviceInfo = await deviceInfoPlugin.iosInfo;
// return iosDeviceInfo.identifierForVendor;
// } else {
// OhosDeviceInfo ohosDeviceInfo = await deviceInfoPlugin.ohosInfo;
// return ohosDeviceInfo.udid;
// }
... ... @@ -1791,7 +1817,7 @@ class Utils {
Uint8List? result = list;
Uint8List? resultnew;
if (needResize) {
result = (await resizeImage(list)) ?? null; //重置图片尺寸,裁剪5:4尺寸
result = (await resizeImage(list, context)) ?? null; //重置图片尺寸,裁剪5:4尺寸
if (result == null) {
//取消重置尺寸
Loading.hideLoading(context);
... ... @@ -1956,7 +1982,8 @@ class Utils {
}
//裁剪图片,改变图片大小
static Future<Uint8List?> resizeImage(Uint8List data) async {
static Future<Uint8List?> resizeImage(
Uint8List data, BuildContext context) async {
/**
//image插件改变图片尺寸 copyCrop、copyResize 两个方法
... ... @@ -1987,44 +2014,59 @@ class Utils {
// Uint8List afterImg = data;
Uint8List? afterImg;
if (imgPath != null) {
final croppedImage = await ImageCropper().cropImage(
sourcePath: imgPath,
//
compressQuality: 100,
compressFormat: ImageCompressFormat.jpg,
//
aspectRatio: const CropAspectRatio(ratioX: 5, ratioY: 4),
uiSettings: [
AndroidUiSettings(
// backgroundColor: Colors.red,
// toolbarTitle: 'Cropper',
// toolbarColor: Colors.deepOrange,
// toolbarWidgetColor: Colors.white,
// initAspectRatio: CropAspectRatioPreset.ratio5x4,
cropStyle: CropStyle.rectangle,
aspectRatioPresets: [CropAspectRatioPreset.ratio5x4],
hideBottomControls: true,
lockAspectRatio: true),
IOSUiSettings(
// title: 'Cropper',
// rotateButtonsHidden: true,
// rotateClockwiseButtonHidden: true,
cropStyle: CropStyle.rectangle,
aspectRatioPresets: [CropAspectRatioPreset.ratio5x4],
resetAspectRatioEnabled: false,
doneButtonTitle: '确定',
cancelButtonTitle: '取消',
aspectRatioLockEnabled: true),
// WebUiSettings(
// context: context,
// ),
],
);
print(croppedImage);
if (croppedImage != null) {
File yourFile = File(croppedImage.path);
afterImg = await yourFile.readAsBytes();
if (Platform.isIOS || Platform.isAndroid) {
final croppedImage = await ImageCropper().cropImage(
sourcePath: imgPath,
//
compressQuality: 100,
compressFormat: ImageCompressFormat.jpg,
//
aspectRatio: const CropAspectRatio(ratioX: 5, ratioY: 4),
uiSettings: [
AndroidUiSettings(
// backgroundColor: Colors.red,
// toolbarTitle: 'Cropper',
// toolbarColor: Colors.deepOrange,
// toolbarWidgetColor: Colors.white,
// initAspectRatio: CropAspectRatioPreset.ratio5x4,
cropStyle: CropStyle.rectangle,
aspectRatioPresets: [CropAspectRatioPreset.ratio5x4],
hideBottomControls: true,
lockAspectRatio: true),
IOSUiSettings(
// title: 'Cropper',
// rotateButtonsHidden: true,
// rotateClockwiseButtonHidden: true,
cropStyle: CropStyle.rectangle,
aspectRatioPresets: [CropAspectRatioPreset.ratio5x4],
resetAspectRatioEnabled: false,
doneButtonTitle: '确定',
cancelButtonTitle: '取消',
aspectRatioLockEnabled: true),
// WebUiSettings(
// context: context,
// ),
],
);
print(croppedImage);
if (croppedImage != null) {
File yourFile = File(croppedImage.path);
afterImg = await yourFile.readAsBytes();
}
} else if (Platform.isOhos) {
// 该插件需要构造一个CropWidget组件来实现裁剪功能,该插件使用方式和其他端相比有差异
//鸿蒙需要创建一个widget
final croppedImage = await CropImageUtils.cropImage(context, imgPath);
print(croppedImage);
if (croppedImage != null) {
File yourFile = File(croppedImage.path);
afterImg = await yourFile.readAsBytes();
}
} else {
return null;
}
}
... ... @@ -3596,7 +3638,8 @@ class Utils {
return isSuccess;
}
//检查网络连接
//检查网络连接
static Future<bool> checkConnectiviy() async {
var connectivityResult = await (new Connectivity().checkConnectivity());
if (connectivityResult == ConnectivityResult.mobile) {
... ... @@ -3605,7 +3648,7 @@ class Utils {
} else if (connectivityResult == ConnectivityResult.wifi) {
// I am connected to a wifi network.
return true;
}else if(connectivityResult == ConnectivityResult.ethernet){
} else if (connectivityResult == ConnectivityResult.ethernet) {
return true;
}
return false;
... ... @@ -3623,7 +3666,7 @@ class Utils {
// return true;
// }
// }
// return false;
// }
... ...
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
# Flutter/Dart/Pub related
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
/pubspec.lock
**/doc/api/
.dart_tool/
build/
... ...
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
version:
revision: "c4a66f77d0e5047ddf5a1bd353fd3ee9cbfeafcd"
channel: "[user-branch]"
project_type: plugin
# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: c4a66f77d0e5047ddf5a1bd353fd3ee9cbfeafcd
base_revision: c4a66f77d0e5047ddf5a1bd353fd3ee9cbfeafcd
- platform: android
create_revision: c4a66f77d0e5047ddf5a1bd353fd3ee9cbfeafcd
base_revision: c4a66f77d0e5047ddf5a1bd353fd3ee9cbfeafcd
- platform: ios
create_revision: c4a66f77d0e5047ddf5a1bd353fd3ee9cbfeafcd
base_revision: c4a66f77d0e5047ddf5a1bd353fd3ee9cbfeafcd
- platform: ohos
create_revision: c4a66f77d0e5047ddf5a1bd353fd3ee9cbfeafcd
base_revision: c4a66f77d0e5047ddf5a1bd353fd3ee9cbfeafcd
# User provided section
# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
... ...
## 0.0.1
* TODO: Describe initial release.
... ...
TODO: Add your license here.
... ...
# file_document_saver
A new Flutter plugin project.
## Getting Started
This project is a starting point for a Flutter
[plug-in package](https://flutter.dev/developing-packages/),
a specialized package that includes platform-specific implementation code for
Android and/or iOS.
For help getting started with Flutter development, view the
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
... ...
include: package:flutter_lints/flutter.yaml
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
... ...
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.cxx
... ...
group = "com.example.file_document_saver"
version = "1.0-SNAPSHOT"
buildscript {
ext.kotlin_version = "1.7.10"
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.3.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
apply plugin: "com.android.library"
apply plugin: "kotlin-android"
android {
if (project.android.hasProperty("namespace")) {
namespace = "com.example.file_document_saver"
}
compileSdk = 34
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
sourceSets {
main.java.srcDirs += "src/main/kotlin"
test.java.srcDirs += "src/test/kotlin"
}
defaultConfig {
minSdk = 21
}
dependencies {
testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("org.mockito:mockito-core:5.0.0")
}
testOptions {
unitTests.all {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
outputs.upToDateWhen {false}
showStandardStreams = true
}
}
}
}
... ...
rootProject.name = 'file_document_saver'
... ...
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.file_document_saver">
</manifest>
... ...
package com.example.file_document_saver
import androidx.annotation.NonNull
import io.flutter.embedding.engine.plugins.FlutterPlugin
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
import io.flutter.plugin.common.MethodChannel.Result
/** FileDocumentSaverPlugin */
class FileDocumentSaverPlugin: FlutterPlugin, MethodCallHandler {
/// The MethodChannel that will the communication between Flutter and native Android
///
/// This local reference serves to register the plugin with the Flutter Engine and unregister it
/// when the Flutter Engine is detached from the Activity
private lateinit var channel : MethodChannel
override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
channel = MethodChannel(flutterPluginBinding.binaryMessenger, "file_document_saver")
channel.setMethodCallHandler(this)
}
override fun onMethodCall(call: MethodCall, result: Result) {
if (call.method == "getPlatformVersion") {
result.success("Android ${android.os.Build.VERSION.RELEASE}")
} else {
result.notImplemented()
}
}
override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) {
channel.setMethodCallHandler(null)
}
}
... ...
package com.example.file_document_saver
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
import kotlin.test.Test
import org.mockito.Mockito
/*
* This demonstrates a simple unit test of the Kotlin portion of this plugin's implementation.
*
* Once you have built the plugin's example app, you can run these tests from the command
* line by running `./gradlew testDebugUnitTest` in the `example/android/` directory, or
* you can run them directly from IDEs that support JUnit such as Android Studio.
*/
internal class FileDocumentSaverPluginTest {
@Test
fun onMethodCall_getPlatformVersion_returnsExpectedValue() {
val plugin = FileDocumentSaverPlugin()
val call = MethodCall("getPlatformVersion", null)
val mockResult: MethodChannel.Result = Mockito.mock(MethodChannel.Result::class.java)
plugin.onMethodCall(call, mockResult)
Mockito.verify(mockResult).success("Android " + android.os.Build.VERSION.RELEASE)
}
}
... ...
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.pub-cache/
.pub/
/build/
# Symbolication related
app.*.symbols
# Obfuscation related
app.*.map.json
# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
... ...
# file_document_saver_example
Demonstrates how to use the file_document_saver plugin.
## Getting Started
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
For help getting started with Flutter development, view the
[online documentation](https://docs.flutter.dev/), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
... ...
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.
# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml
linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at https://dart.dev/lints.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
... ...
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java
# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
key.properties
**/*.keystore
**/*.jks
... ...
plugins {
id "com.android.application"
id "kotlin-android"
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id "dev.flutter.flutter-gradle-plugin"
}
def localProperties = new Properties()
def localPropertiesFile = rootProject.file("local.properties")
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader("UTF-8") { reader ->
localProperties.load(reader)
}
}
def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
if (flutterVersionCode == null) {
flutterVersionCode = "1"
}
def flutterVersionName = localProperties.getProperty("flutter.versionName")
if (flutterVersionName == null) {
flutterVersionName = "1.0"
}
android {
namespace = "com.example.file_document_saver_example"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "com.example.file_document_saver_example"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutterVersionCode.toInteger()
versionName = flutterVersionName
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig = signingConfigs.debug
}
}
}
flutter {
source = "../.."
}
... ...
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
... ...
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="file_document_saver_example"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:taskAffinity=""
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
<!-- Required to query activities that can process text, see:
https://developer.android.com/training/package-visibility and
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
<queries>
<intent>
<action android:name="android.intent.action.PROCESS_TEXT"/>
<data android:mimeType="text/plain"/>
</intent>
</queries>
</manifest>
... ...
package com.example.file_document_saver_example
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity()
... ...
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="?android:colorBackground" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
... ...
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
... ...
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
... ...
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
... ...
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
... ...
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = "../build"
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(":app")
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
... ...
org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.enableJetifier=true
... ...
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
... ...
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
}
include ":app"
... ...
// This is a basic Flutter integration test.
//
// Since integration tests run in a full Flutter application, they can interact
// with the host side of a plugin implementation, unlike Dart unit tests.
//
// For more information about Flutter integration tests, please see
// https://docs.flutter.dev/cookbook/testing/integration/introduction
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:file_document_saver/file_document_saver.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
testWidgets('getPlatformVersion test', (WidgetTester tester) async {
final FileDocumentSaver plugin = FileDocumentSaver();
final String? version = await plugin.getPlatformVersion();
// The version string depends on the host platform running the test, so
// just assert that some non-empty string is returned.
expect(version?.isNotEmpty, true);
});
}
... ...
**/dgph
*.mode1v3
*.mode2v3
*.moved-aside
*.pbxuser
*.perspectivev3
**/*sync/
.sconsign.dblite
.tags*
**/.vagrant/
**/DerivedData/
Icon?
**/Pods/
**/.symlinks/
profile
xcuserdata
**/.generated/
Flutter/App.framework
Flutter/Flutter.framework
Flutter/Flutter.podspec
Flutter/Generated.xcconfig
Flutter/ephemeral/
Flutter/app.flx
Flutter/app.zip
Flutter/flutter_assets/
Flutter/flutter_export_environment.sh
ServiceDefinitions.json
Runner/GeneratedPluginRegistrant.*
# Exceptions to above rules.
!default.mode1v3
!default.mode2v3
!default.pbxuser
!default.perspectivev3
... ...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>App</string>
<key>CFBundleIdentifier</key>
<string>io.flutter.flutter.app</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>App</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>12.0</string>
</dict>
</plist>
... ...
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
... ...
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
... ...
# Uncomment this line to define a global platform for your project
# platform :ios, '12.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
... ...
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 54;
objects = {
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 97C146E61CF9000F007C117D /* Project object */;
proxyType = 1;
remoteGlobalIDString = 97C146ED1CF9000F007C117D;
remoteInfo = Runner;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
9705A1C41CF9048500538489 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
97C146EB1CF9000F007C117D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
331C8082294A63A400263BE5 /* RunnerTests */ = {
isa = PBXGroup;
children = (
331C807B294A618700263BE5 /* RunnerTests.swift */,
);
path = RunnerTests;
sourceTree = "<group>";
};
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
9740EEB31CF90195004384FC /* Generated.xcconfig */,
);
name = Flutter;
sourceTree = "<group>";
};
97C146E51CF9000F007C117D = {
isa = PBXGroup;
children = (
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
331C8082294A63A400263BE5 /* RunnerTests */,
);
sourceTree = "<group>";
};
97C146EF1CF9000F007C117D /* Products */ = {
isa = PBXGroup;
children = (
97C146EE1CF9000F007C117D /* Runner.app */,
331C8081294A63A400263BE5 /* RunnerTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup;
children = (
97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
97C147021CF9000F007C117D /* Info.plist */,
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
);
path = Runner;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
331C8080294A63A400263BE5 /* RunnerTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
buildPhases = (
331C807D294A63A400263BE5 /* Sources */,
331C807F294A63A400263BE5 /* Resources */,
);
buildRules = (
);
dependencies = (
331C8086294A63A400263BE5 /* PBXTargetDependency */,
);
name = RunnerTests;
productName = RunnerTests;
productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
97C146ED1CF9000F007C117D /* Runner */ = {
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
);
buildRules = (
);
dependencies = (
);
name = Runner;
productName = Runner;
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
331C8080294A63A400263BE5 = {
CreatedOnToolsVersion = 14.0;
TestTargetID = 97C146ED1CF9000F007C117D;
};
97C146ED1CF9000F007C117D = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 1100;
};
};
};
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 97C146E51CF9000F007C117D;
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
97C146ED1CF9000F007C117D /* Runner */,
331C8080294A63A400263BE5 /* RunnerTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
331C807F294A63A400263BE5 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
97C146EC1CF9000F007C117D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Run Script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
331C807D294A63A400263BE5 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
97C146EA1CF9000F007C117D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
331C8086294A63A400263BE5 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 97C146ED1CF9000F007C117D /* Runner */;
targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
97C146FA1CF9000F007C117D /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
97C146FB1CF9000F007C117D /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
97C147001CF9000F007C117D /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
249021D3217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Profile;
};
249021D4217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.fileDocumentSaverExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Profile;
};
331C8088294A63A400263BE5 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.fileDocumentSaverExample.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
};
name = Debug;
};
331C8089294A63A400263BE5 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.fileDocumentSaverExample.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
};
name = Release;
};
331C808A294A63A400263BE5 /* Profile */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.fileDocumentSaverExample.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
};
name = Profile;
};
97C147031CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
97C147041CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
97C147061CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.fileDocumentSaverExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
};
97C147071CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.fileDocumentSaverExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
331C8088294A63A400263BE5 /* Debug */,
331C8089294A63A400263BE5 /* Release */,
331C808A294A63A400263BE5 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
isa = XCConfigurationList;
buildConfigurations = (
97C147031CF9000F007C117D /* Debug */,
97C147041CF9000F007C117D /* Release */,
249021D3217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
isa = XCConfigurationList;
buildConfigurations = (
97C147061CF9000F007C117D /* Debug */,
97C147071CF9000F007C117D /* Release */,
249021D4217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}
... ...
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>
... ...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
... ...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>
... ...
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO"
parallelizable = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "331C8080294A63A400263BE5"
BuildableName = "RunnerTests.xctest"
BlueprintName = "RunnerTests"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Profile"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
... ...
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
</Workspace>
... ...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
... ...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>
... ...
import Flutter
import UIKit
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
... ...
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@3x.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@1x.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@1x.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@1x.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@2x.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "Icon-App-83.5x83.5@2x.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "Icon-App-1024x1024@1x.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
... ...
{
"images" : [
{
"idiom" : "universal",
"filename" : "LaunchImage.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
... ...
# Launch Screen Assets
You can customize the launch screen with your own desired assets by replacing the image files in this directory.
You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/>
<viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
</imageView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
<resources>
<image name="LaunchImage" width="168" height="185"/>
</resources>
</document>
... ...
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<scenes>
<!--Flutter View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>
... ...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>File Document Saver</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>file_document_saver_example</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>
... ...
import Flutter
import UIKit
import XCTest
@testable import file_document_saver
// This demonstrates a simple unit test of the Swift portion of this plugin's implementation.
//
// See https://developer.apple.com/documentation/xctest for more information about using XCTest.
class RunnerTests: XCTestCase {
func testGetPlatformVersion() {
let plugin = FileDocumentSaverPlugin()
let call = FlutterMethodCall(methodName: "getPlatformVersion", arguments: [])
let resultExpectation = expectation(description: "result block must be called.")
plugin.handle(call) { result in
XCTAssertEqual(result as! String, "iOS " + UIDevice.current.systemVersion)
resultExpectation.fulfill()
}
waitForExpectations(timeout: 1)
}
}
... ...
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter/services.dart';
import 'package:file_document_saver/file_document_saver.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
String _platformVersion = 'Unknown';
final _fileDocumentSaverPlugin = FileDocumentSaver();
@override
void initState() {
super.initState();
initPlatformState();
}
// Platform messages are asynchronous, so we initialize in an async method.
Future<void> initPlatformState() async {
String platformVersion;
// Platform messages may fail, so we use a try/catch PlatformException.
// We also handle the message potentially returning null.
try {
platformVersion =
await _fileDocumentSaverPlugin.getPlatformVersion() ?? 'Unknown platform version';
} on PlatformException {
platformVersion = 'Failed to get platform version.';
}
// If the widget was removed from the tree while the asynchronous platform
// message was in flight, we want to discard the reply rather than calling
// setState to update our non-existent appearance.
if (!mounted) return;
setState(() {
_platformVersion = platformVersion;
});
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: Text('Running on: $_platformVersion\n'),
),
),
);
}
}
... ...
/node_modules
/oh_modules
/local.properties
/.idea
**/build
/.hvigor
.cxx
/.clangd
/.clang-format
/.clang-tidy
**/.test
**/BuildProfile.ets
**/oh-package-lock.json5
/package.json
/package-lock.json
**/src/main/resources/rawfile/flutter_assets/
**/libs/**/libapp.so
**/libs/**/libflutter.so
**/libs/**/libvmservice_snapshot.so
... ...
{
"app": {
"bundleName": "com.example.file_document_saver_example",
"vendor": "example",
"versionCode": 1000000,
"versionName": "1.0.0",
"icon": "$media:app_icon",
"label": "$string:app_name"
}
}
... ...
{
"string": [
{
"name": "app_name",
"value": "file_document_saver_example"
}
]
}
... ...
{
"app": {
"signingConfigs": [],
"products": [
{
"name": "default",
"signingConfig": "default",
"compatibleSdkVersion": "5.1.0(18)",
"runtimeOS": "HarmonyOS",
}
],
"buildModeSet": [
{
"name": "debug"
},
{
"name": "profile"
},
{
"name": "release"
}
]
},
"modules": [
{
"name": "entry",
"srcPath": "./entry",
"targets": [
{
"name": "default",
"applyToProducts": [
"default"
]
}
]
}
]
}
\ No newline at end of file
... ...
/node_modules
/oh_modules
/.preview
/build
/.cxx
/.test
GeneratedPluginRegistrant.ets
\ No newline at end of file
... ...
{
"apiType": 'stageMode',
"buildOption": {
},
"targets": [
{
"name": "default",
"runtimeOS": "HarmonyOS"
},
{
"name": "ohosTest",
}
]
}
\ No newline at end of file
... ...
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
import { hapTasks } from '@ohos/hvigor-ohos-plugin';
export default {
system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
plugins: [] /* Custom plugin to extend the functionality of Hvigor. */
}
... ...