From 7fe7aa5de538f42c4f8fdbe11aa396d94b965b9a Mon Sep 17 00:00:00 2001 From: Sachin Singh Date: Wed, 11 May 2022 17:46:48 +0530 Subject: [PATCH 1/9] file download percentage added for mobile and desktop --- lib/app.dart | 2 + lib/data_models/file_transfer.dart | 27 ++-- .../desktop_received_file_details.dart | 65 +++++--- .../labelled_circular_progress.dart | 32 ++++ .../widgets/received_file_list_tile.dart | 152 +++++++++++++----- .../welcome_screen/welcome_screen.dart | 17 -- lib/services/file_transfer_service.dart | 58 +++++-- lib/utils/text_strings.dart | 2 +- lib/view_models/file_progress_provider.dart | 29 ++++ lib/view_models/history_provider.dart | 47 ++++-- 10 files changed, 305 insertions(+), 126 deletions(-) create mode 100644 lib/screens/common_widgets/labelled_circular_progress.dart create mode 100644 lib/view_models/file_progress_provider.dart diff --git a/lib/app.dart b/lib/app.dart index adb28c90..e55b7904 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -1,5 +1,6 @@ import 'package:atsign_atmosphere_pro/view_models/file_download_checker.dart'; import 'package:atsign_atmosphere_pro/desktop_routes/desktop_routes.dart'; +import 'package:atsign_atmosphere_pro/view_models/file_progress_provider.dart'; import 'package:atsign_atmosphere_pro/view_models/internet_connectivity_checker.dart'; import 'package:atsign_atmosphere_pro/view_models/side_bar_provider.dart'; import 'package:atsign_atmosphere_pro/view_models/switch_atsign_provider.dart'; @@ -51,6 +52,7 @@ class _MyAppState extends State { ChangeNotifierProvider(create: (context) => NestedRouteProvider()), ChangeNotifierProvider(create: (context) => SwitchAtsignProvider()), ChangeNotifierProvider(create: (context) => FileDownloadChecker()), + ChangeNotifierProvider(create: (context) => FileProgressProvider()), ChangeNotifierProvider( create: (context) => InternetConnectivityChecker()) ], diff --git a/lib/data_models/file_transfer.dart b/lib/data_models/file_transfer.dart index c997c4ce..0e0c7079 100644 --- a/lib/data_models/file_transfer.dart +++ b/lib/data_models/file_transfer.dart @@ -11,18 +11,17 @@ class FileTransfer { bool? isUpdate; bool? isDownloading; bool? isWidgetOpen; - FileTransferProgress? fileTransferProgress; - FileTransfer( - {this.url, - this.files, - this.expiry, - this.platformFiles, - this.date, - this.key, - this.isUpdate = false, - this.isDownloading = false, - this.isWidgetOpen = false, - this.fileTransferProgress}) { + FileTransfer({ + this.url, + this.files, + this.expiry, + this.platformFiles, + this.date, + this.key, + this.isUpdate = false, + this.isDownloading = false, + this.isWidgetOpen = false, + }) { this.expiry = expiry ?? DateTime.now().add(Duration(days: 6)); this.date = date ?? DateTime.now(); @@ -216,8 +215,8 @@ class DownloadAcknowledgement { class FileTransferProgress { FileState fileState; - double percent; - String fileName; + double? percent; + String? fileName; FileTransferProgress(this.fileState, this.percent, this.fileName); } diff --git a/lib/desktop_screens/desktop_history/widgets/desktop_received_file_details.dart b/lib/desktop_screens/desktop_history/widgets/desktop_received_file_details.dart index 04458532..cb21de96 100644 --- a/lib/desktop_screens/desktop_history/widgets/desktop_received_file_details.dart +++ b/lib/desktop_screens/desktop_history/widgets/desktop_received_file_details.dart @@ -1,6 +1,7 @@ import 'dart:io'; import 'package:atsign_atmosphere_pro/data_models/file_transfer.dart'; +import 'package:atsign_atmosphere_pro/screens/common_widgets/labelled_circular_progress.dart'; import 'package:atsign_atmosphere_pro/services/backend_service.dart'; import 'package:atsign_atmosphere_pro/services/common_utility_functions.dart'; import 'package:atsign_atmosphere_pro/services/navigation_service.dart'; @@ -9,6 +10,7 @@ import 'package:atsign_atmosphere_pro/utils/colors.dart'; import 'package:atsign_atmosphere_pro/utils/constants.dart'; import 'package:atsign_atmosphere_pro/utils/text_strings.dart'; import 'package:atsign_atmosphere_pro/utils/text_styles.dart'; +import 'package:atsign_atmosphere_pro/view_models/file_progress_provider.dart'; import 'package:atsign_atmosphere_pro/view_models/history_provider.dart'; import 'package:flutter/material.dart'; import 'package:at_common_flutter/services/size_config.dart'; @@ -152,10 +154,14 @@ class _DesktopReceivedFileDetailsState widget.fileTransfer!.isDownloading! ? Padding( padding: const EdgeInsets.only(right: 10.0), - child: SizedBox( - width: 30, - height: 30, - child: CircularProgressIndicator()), + child: Consumer( + builder: (_c, provider, _) { + var fileTransferProgress = + provider.receivedFileProgress[ + widget.fileTransfer!.key!]; + + return getDownloadStatus(fileTransferProgress); + }), ) : isDownloadAvailable ? Padding( @@ -284,18 +290,25 @@ class _DesktopReceivedFileDetailsState ], ), SizedBox(height: 15.toHeight), - RichText( - text: TextSpan( - text: - '${DateFormat("MM-dd-yyyy").format(widget.fileTransfer!.date!)} | ${DateFormat('kk: mm').format(widget.fileTransfer!.date!)} | ', - style: CustomTextStyles.greyText15, - children: [ - widget.fileTransfer!.isDownloading! - ? TextSpan( - text: '${getFileStateMessage()}', - style: CustomTextStyles.blueRegular14) - : TextSpan(text: ''), - ]), + Consumer( + builder: (_context, provider, _widget) { + var fileTransferProgress = + provider.receivedFileProgress[widget.fileTransfer!.key!]; + return RichText( + text: TextSpan( + text: + '${DateFormat("MM-dd-yyyy").format(widget.fileTransfer!.date!)} | ${DateFormat('kk: mm').format(widget.fileTransfer!.date!)} | ', + style: CustomTextStyles.greyText15, + children: [ + widget.fileTransfer!.isDownloading! + ? TextSpan( + text: + '${getFileStateMessage(fileTransferProgress)}', + style: CustomTextStyles.blueRegular14) + : TextSpan(text: ''), + ]), + ); + }, ), SizedBox(height: 15.toHeight), SizedBox(height: 15.toHeight), @@ -470,9 +483,7 @@ class _DesktopReceivedFileDetailsState } } - String getFileStateMessage() { - FileTransferProgress? fileTransferProgress = - widget.fileTransfer!.fileTransferProgress; + String getFileStateMessage(FileTransferProgress? fileTransferProgress) { if (fileTransferProgress == null) { return ''; } @@ -492,4 +503,20 @@ class _DesktopReceivedFileDetailsState } return fileState; } + + Widget getDownloadStatus(FileTransferProgress? fileTransferProgress) { + Widget spinner = CircularProgressIndicator(); + + if (fileTransferProgress == null) { + return spinner; + } + + if (fileTransferProgress.fileState == FileState.download && + fileTransferProgress.percent != null) { + spinner = LabelledCircularProgressIndicator( + value: (fileTransferProgress.percent! / 100)); + } + + return spinner; + } } diff --git a/lib/screens/common_widgets/labelled_circular_progress.dart b/lib/screens/common_widgets/labelled_circular_progress.dart new file mode 100644 index 00000000..2ed80334 --- /dev/null +++ b/lib/screens/common_widgets/labelled_circular_progress.dart @@ -0,0 +1,32 @@ +import 'package:flutter/material.dart'; + +import '../../utils/colors.dart'; + +class LabelledCircularProgressIndicator extends StatelessWidget { + double? value; + LabelledCircularProgressIndicator({this.value}); + @override + Widget build(BuildContext context) { + return SizedBox( + child: Stack( + children: [ + CircularProgressIndicator(value: value), + value != null + ? Positioned( + top: 10, + child: Padding( + padding: EdgeInsets.only(left: 11), + child: Text((value! * 100).toStringAsFixed(0), + style: TextStyle( + fontSize: 10, + fontWeight: FontWeight.bold, + color: ColorConstants.blueText, + )), + ), + ) + : SizedBox() + ], + ), + ); + } +} diff --git a/lib/screens/history/widgets/received_file_list_tile.dart b/lib/screens/history/widgets/received_file_list_tile.dart index 56f8fb95..f5834095 100644 --- a/lib/screens/history/widgets/received_file_list_tile.dart +++ b/lib/screens/history/widgets/received_file_list_tile.dart @@ -9,6 +9,7 @@ import 'package:atsign_atmosphere_pro/screens/common_widgets/add_contact.dart'; import 'package:atsign_atmosphere_pro/screens/common_widgets/contact_initial.dart'; import 'package:atsign_atmosphere_pro/screens/common_widgets/custom_button.dart'; import 'package:atsign_atmosphere_pro/screens/common_widgets/custom_circle_avatar.dart'; +import 'package:atsign_atmosphere_pro/screens/common_widgets/labelled_circular_progress.dart'; import 'package:atsign_atmosphere_pro/services/backend_service.dart'; import 'package:atsign_atmosphere_pro/services/common_utility_functions.dart'; import 'package:atsign_atmosphere_pro/services/navigation_service.dart'; @@ -19,6 +20,7 @@ import 'package:atsign_atmosphere_pro/utils/file_types.dart'; import 'package:atsign_atmosphere_pro/utils/images.dart'; import 'package:atsign_atmosphere_pro/utils/text_strings.dart'; import 'package:atsign_atmosphere_pro/utils/text_styles.dart'; +import 'package:atsign_atmosphere_pro/view_models/file_progress_provider.dart'; import 'package:atsign_atmosphere_pro/view_models/history_provider.dart'; import 'package:flutter/material.dart'; import 'package:at_common_flutter/services/size_config.dart'; @@ -54,6 +56,7 @@ class _ReceivedFilesListTileState extends State { int fileSize = 0; List existingFileNamesToOverwrite = []; String nickName = ''; + Map _futureBuilder = {}; Future videoThumbnailBuilder(String path) async { videoThumbnail = await VideoThumbnail.thumbnailData( @@ -77,6 +80,7 @@ class _ReceivedFilesListTileState extends State { getAtSignDetail(); getDisplayDetails(); isFilesAlreadyDownloaded(); + getFutureBuilders(); super.initState(); } @@ -153,6 +157,12 @@ class _ReceivedFilesListTileState extends State { }); } + getFutureBuilders() { + widget.receivedHistory!.files!.forEach((element) { + _futureBuilder[element.name] = isFilePresent(element.name!); + }); + } + @override Widget build(BuildContext context) { sendTime = DateTime.now(); @@ -266,22 +276,29 @@ class _ReceivedFilesListTileState extends State { }, child: Padding( padding: EdgeInsets.only(top: 5.0), - child: isDownloadAvailable - ? widget.receivedHistory!.isDownloading! - ? CircularProgressIndicator() - : ((isDownloaded || - isFilesAvailableOfline) && - !isOverwrite) - ? Icon( - Icons.done, - color: Color(0xFF08CB21), - size: 25.toFont, - ) - : Icon( - Icons.download_sharp, - size: 25.toFont, - ) - : SizedBox())) + child: Consumer( + builder: (_c, provider, _) { + var fileTransferProgress = + provider.receivedFileProgress[ + widget.receivedHistory!.key!]; + return isDownloadAvailable + ? widget.receivedHistory!.isDownloading! + ? getDownloadStatus( + fileTransferProgress) + : ((isDownloaded || + isFilesAvailableOfline) && + !isOverwrite) + ? Icon( + Icons.done, + color: Color(0xFF08CB21), + size: 25.toFont, + ) + : Icon( + Icons.download_sharp, + size: 25.toFont, + ) + : SizedBox(); + }))) ], ), Row( @@ -335,12 +352,21 @@ class _ReceivedFilesListTileState extends State { SizedBox(width: 10.toHeight), widget.receivedHistory!.isDownloading! ? Expanded( - child: Text(getFileStateMessage(), - style: TextStyle( - fontSize: 11.toFont, - color: ColorConstants.blueText, - fontWeight: FontWeight.normal, - )), + child: Consumer( + builder: (_context, provider, _widget) { + var fileTransferProgress = + provider.receivedFileProgress[ + widget.receivedHistory!.key!]; + return Text( + getFileStateMessage( + fileTransferProgress), + style: TextStyle( + fontSize: 11.toFont, + color: ColorConstants.blueText, + fontWeight: FontWeight.normal, + )); + }, + ), ) : SizedBox() ], @@ -477,13 +503,11 @@ class _ReceivedFilesListTileState extends State { height: 50.toHeight, width: 50.toHeight, child: FutureBuilder( - future: isFilePresent(widget - .receivedHistory! - .files![index] - .name ?? - ''), - builder: (context, - AsyncSnapshot snapshot) { + key: Key(widget + .receivedHistory!.files![index].name!), + future: _futureBuilder[widget + .receivedHistory!.files![index].name], + builder: (context, snapshot) { return snapshot.connectionState == ConnectionState.done && snapshot.data != null @@ -499,7 +523,8 @@ class _ReceivedFilesListTileState extends State { (widget.receivedHistory! .files![index].name ?? ''), - isFilePresent: snapshot.data) + isFilePresent: + snapshot.data as bool) : SizedBox(); }), ), @@ -556,14 +581,25 @@ class _ReceivedFilesListTileState extends State { .secondaryRegular12, ), SizedBox(width: 10.toHeight), - Text( - (widget.receivedHistory!.files![index] - .isDownloading ?? - false) - ? TextStrings().downloading - : '', - style: CustomTextStyles.redSmall12, - ), + Consumer(builder: + (_context, _provider, _widget) { + var fileTransferProgress = + _provider.receivedFileProgress[ + widget.receivedHistory!.key!]; + return Text( + (widget + .receivedHistory! + .files![index] + .isDownloading ?? + false) + ? getSingleFileDownloadMessage( + fileTransferProgress, + widget.receivedHistory! + .files![index].name!) + : '', + style: CustomTextStyles.redSmall12, + ); + }), (CommonUtilityFunctions() .isFileDownloadAvailable( widget.receivedHistory! @@ -809,6 +845,7 @@ class _ReceivedFilesListTileState extends State { if (result is bool && result) { if (mounted) { + getFutureBuilders(); setState(() { isDownloaded = true; isFilesAvailableOfline = true; @@ -960,9 +997,7 @@ class _ReceivedFilesListTileState extends State { return textSpansMessage; } - String getFileStateMessage() { - FileTransferProgress? fileTransferProgress = - widget.receivedHistory!.fileTransferProgress; + String getFileStateMessage(FileTransferProgress? fileTransferProgress) { if (fileTransferProgress == null) { return ''; } @@ -994,4 +1029,39 @@ class _ReceivedFilesListTileState extends State { receivedHistoryLogs[index].isWidgetOpen = isOpen; } } + + Widget getDownloadStatus(FileTransferProgress? fileTransferProgress) { + Widget spinner = CircularProgressIndicator(); + + if (fileTransferProgress == null) { + return spinner; + } + + if (fileTransferProgress.fileState == FileState.download && + fileTransferProgress.percent != null) { + spinner = LabelledCircularProgressIndicator( + value: (fileTransferProgress.percent! / 100)); + } + + return spinner; + } + + String getSingleFileDownloadMessage( + FileTransferProgress? fileTransferProgress, String fileName) { + String downloadMessage = TextStrings().downloading; + + if (fileTransferProgress == null) { + return downloadMessage; + } + + if (fileTransferProgress.fileState == FileState.download && + fileTransferProgress.percent != null && + fileTransferProgress.fileName == fileName) { + downloadMessage += + '(${fileTransferProgress.percent!.toStringAsFixed(0)}%)'; + } else if (fileTransferProgress.fileState == FileState.decrypt) { + downloadMessage = 'Decrypting...'; + } + return downloadMessage; + } } diff --git a/lib/screens/welcome_screen/welcome_screen.dart b/lib/screens/welcome_screen/welcome_screen.dart index 53303c9a..fd086d93 100644 --- a/lib/screens/welcome_screen/welcome_screen.dart +++ b/lib/screens/welcome_screen/welcome_screen.dart @@ -58,7 +58,6 @@ class _WelcomeScreenState extends State { WidgetsBinding.instance!.addPostFrameCallback((_) async { WelcomeScreenProvider().isExpanded = false; await initPackages(); - // await getSentAndReceivedHistory(); }); super.initState(); @@ -69,22 +68,6 @@ class _WelcomeScreenState extends State { super.dispose(); } - // getSentAndReceivedHistory() async { - // await Provider.of(NavService.navKey.currentState!.context, - // listen: false) - // .getFileDownloadedAcknowledgement(); - // await Provider.of(NavService.navKey.currentState!.context, - // listen: false) - // .getSentHistory(); - // await Provider.of(NavService.navKey.currentState!.context, - // listen: false) - // .getReceivedHistory(); - - // Provider.of(NavService.navKey.currentContext!, - // listen: false) - // .checkForUndownloadedFiles(); - // } - listenForFlushBarStatus() { FileTransferProvider().flushBarStatusStream.listen((flushbarStatus) async { OverlayService.instance.showOverlay(flushbarStatus); diff --git a/lib/services/file_transfer_service.dart b/lib/services/file_transfer_service.dart index 0a9ff035..5fb09214 100644 --- a/lib/services/file_transfer_service.dart +++ b/lib/services/file_transfer_service.dart @@ -10,7 +10,7 @@ import 'package:atsign_atmosphere_pro/data_models/file_transfer.dart'; import 'package:atsign_atmosphere_pro/services/backend_service.dart'; import 'package:atsign_atmosphere_pro/services/navigation_service.dart'; import 'package:atsign_atmosphere_pro/utils/constants.dart'; -import 'package:atsign_atmosphere_pro/view_models/history_provider.dart'; +import 'package:atsign_atmosphere_pro/view_models/file_progress_provider.dart'; import 'package:provider/provider.dart'; import 'package:uuid/uuid.dart'; import 'package:http/http.dart' as http; @@ -43,6 +43,10 @@ class FileTransferService { Future> _uploadFiles( String transferId, List files, String encryptionKey) async { + var fileUploadProvider = Provider.of( + NavService.navKey.currentContext!, + listen: false); + var _preference = BackendService.getInstance().atClientPreference; var fileStatuses = []; @@ -53,6 +57,8 @@ class FileTransferService { size: await file.length(), ); try { + fileUploadProvider.updateSentFileTransferProgress = + FileTransferProgress(FileState.encrypt, null, null); final encryptedFile = await encryptFile( file, encryptionKey, @@ -183,13 +189,24 @@ class FileTransferService { Future uploadToFileBinWithStreamedRequest( File file, String container, String fileName) async { try { + var fileUploadProvider = Provider.of( + NavService.navKey.currentContext!, + listen: false); var postUri = Uri.parse(MixedConstants.FILEBIN_URL + '$container/' + fileName); final streamedRequest = http.StreamedRequest('POST', postUri); - streamedRequest.contentLength = await file.length(); + var uploadedBytes = 0; + var fileLength = await file.length(); + + streamedRequest.contentLength = fileLength; file.openRead().listen((chunk) { streamedRequest.sink.add(chunk); + + uploadedBytes += chunk.length; + var percent = (uploadedBytes / fileLength) * 100; + fileUploadProvider.updateSentFileTransferProgress = + FileTransferProgress(FileState.upload, percent, fileName); }, onDone: () { streamedRequest.sink.close(); }); @@ -240,7 +257,7 @@ class FileTransferService { updateFileTransferState( encryptedFile.path.split(Platform.pathSeparator).last, transferId, - 0, + null, FileState.decrypt); var decryptedFile = await decryptFile( File(encryptedFile.path), @@ -301,12 +318,12 @@ class FileTransferService { updateFileTransferState( fileName, fileTransferObject.transferId, - 0, + null, FileState.download, ); - var downloadResponse = - await downloadIndividualFile(fileUrl, tempDirectory.path, fileName); + var downloadResponse = await downloadIndividualFile(fileUrl, + tempDirectory.path, fileName, fileTransferObject.transferId); if (downloadResponse.isError) { fileDownloadResponse = FileDownloadResponse( isError: true, @@ -326,8 +343,8 @@ class FileTransferService { return completer.future; } - Future downloadIndividualFile( - String fileUrl, String tempPath, String fileName) async { + Future downloadIndividualFile(String fileUrl, String tempPath, + String fileName, String transferId) async { final Completer completer = Completer(); var httpClient = http.Client(); @@ -343,7 +360,7 @@ class FileTransferService { late StreamSubscription downloadSubscription; File file = File(tempPath + Platform.pathSeparator + fileName); - int downloaded = 0; + double downloaded = 0; try { downloadSubscription = @@ -352,9 +369,16 @@ class FileTransferService { (List chunk) { file.writeAsBytesSync(chunk, mode: FileMode.append); downloaded += chunk.length; - // if (r.contentLength != null) { - // print('percentage: ${(downloaded / r.contentLength!)}'); - // } + if (r.contentLength != null) { + var percent = (downloaded / r.contentLength!) * 100; + + updateFileTransferState( + fileName, + transferId, + percent.roundToDouble(), + FileState.download, + ); + } }, onDone: () async { await downloadSubscription.cancel(); @@ -378,17 +402,17 @@ class FileTransferService { } /// [updateFileTransferState] sets download/decrypt file state in history screen. - updateFileTransferState( - String fileName, String transferId, double percent, FileState fileState) { + updateFileTransferState(String fileName, String transferId, double? percent, + FileState fileState) { var fileTransferProgress = FileTransferProgress( fileState, - 0, // currently not showing download/decrypt % + percent, // currently not showing download/decrypt % fileName, ); - Provider.of(NavService.navKey.currentContext!, + Provider.of(NavService.navKey.currentContext!, listen: false) - .updateFileTransferState( + .updateReceivedFileProgress( transferId, fileTransferProgress, ); diff --git a/lib/utils/text_strings.dart b/lib/utils/text_strings.dart index 57f32d16..5d484d10 100644 --- a/lib/utils/text_strings.dart +++ b/lib/utils/text_strings.dart @@ -288,7 +288,7 @@ class TextStrings { String byDate = 'By date'; String apply = 'Apply'; - String downloading = 'Downloading...'; + String downloading = 'Downloading'; // Error Message diff --git a/lib/view_models/file_progress_provider.dart b/lib/view_models/file_progress_provider.dart new file mode 100644 index 00000000..56899a55 --- /dev/null +++ b/lib/view_models/file_progress_provider.dart @@ -0,0 +1,29 @@ +import 'package:atsign_atmosphere_pro/data_models/file_transfer.dart'; +import 'package:atsign_atmosphere_pro/view_models/base_model.dart'; + +class FileProgressProvider extends BaseModel { + FileTransferProgress? _sentFileTransferProgress; + Map _receivedFileProgress = {}; + + FileTransferProgress? get sentFileTransferProgress => + _sentFileTransferProgress; + + Map get receivedFileProgress => + _receivedFileProgress; + + set updateSentFileTransferProgress( + FileTransferProgress fileTransferProgress) { + _sentFileTransferProgress = fileTransferProgress; + notifyListeners(); + } + + updateReceivedFileProgress( + String transferId, FileTransferProgress fileTransferProgress) { + _receivedFileProgress[transferId] = fileTransferProgress; + notifyListeners(); + } + + removeReceiveProgressItem(String transferId) { + _receivedFileProgress.remove(transferId); + } +} diff --git a/lib/view_models/history_provider.dart b/lib/view_models/history_provider.dart index 4be04593..1b0a63d4 100644 --- a/lib/view_models/history_provider.dart +++ b/lib/view_models/history_provider.dart @@ -29,9 +29,9 @@ import 'package:atsign_atmosphere_pro/utils/constants.dart'; import 'package:atsign_atmosphere_pro/utils/file_types.dart'; import 'package:atsign_atmosphere_pro/view_models/base_model.dart'; import 'package:atsign_atmosphere_pro/view_models/file_download_checker.dart'; +import 'package:atsign_atmosphere_pro/view_models/file_progress_provider.dart'; import 'package:flutter/cupertino.dart'; import 'package:at_client/src/stream/file_transfer_object.dart'; -import 'package:at_client/src/service/encryption_service.dart'; import 'package:flutter/services.dart'; import 'package:http/http.dart' as http; import 'package:at_client/src/service/notification_service.dart'; @@ -985,8 +985,10 @@ class HistoryProvider extends BaseModel { listen: false) .checkForUndownloadedFiles(); - updateFileTransferState( - transferId, null); //setting filetransfer progress as null + Provider.of(NavService.navKey.currentContext!, + listen: false) + .removeReceiveProgressItem( + transferId); //setting filetransfer progress as null if (files is List) { await sortFiles(receivedHistoryLogs); populateTabs(); @@ -1084,12 +1086,9 @@ class HistoryProvider extends BaseModel { var tempDirectory = await Directory(downloadPath).createTemp('encrypted-files'); - var fileDownloadReponse = - await FileTransferService.getInstance().downloadIndividualFile( - fileTransferObject.fileUrl, - tempDirectory.path, - fileName, - ); + var fileDownloadReponse = await FileTransferService.getInstance() + .downloadIndividualFile(fileTransferObject.fileUrl, tempDirectory.path, + fileName, transferId!); if (fileDownloadReponse.isError) { throw Exception('download fail'); @@ -1097,13 +1096,21 @@ class HistoryProvider extends BaseModel { var encryptedFileList = tempDirectory.listSync(); try { for (var encryptedFile in encryptedFileList) { - var decryptedFile = await EncryptionService().decryptFileInChunks( + FileTransferService.getInstance().updateFileTransferState( + fileName, + fileTransferObject.transferId, + null, + FileState.decrypt, + ); + + var decryptedFile = await FileTransferService.getInstance().decryptFile( File(encryptedFile.path), fileTransferObject.fileEncryptionKey, BackendService.getInstance() .atClientPreference .fileEncryptionChunkSize, ); + decryptedFile.copySync(downloadPath + Platform.pathSeparator + encryptedFile.path.split(Platform.pathSeparator).last); @@ -1112,6 +1119,10 @@ class HistoryProvider extends BaseModel { encryptedFile.path.split(Platform.pathSeparator).last)); decryptedFile.deleteSync(); } + + Provider.of(NavService.navKey.currentContext!, + listen: false) + .removeReceiveProgressItem(transferId); // deleting temp directory Directory(fileDownloadReponse.filePath!).deleteSync(recursive: true); return downloadedFiles; @@ -1277,13 +1288,15 @@ class HistoryProvider extends BaseModel { } updateFileTransferState( - String transferId, FileTransferProgress? fileTransferProgress) { - var index = - receivedHistoryLogs.indexWhere((element) => element.key == transferId); - if (index != -1) { - receivedHistoryLogs[index].fileTransferProgress = fileTransferProgress; - notifyListeners(); - } + String transferId, FileTransferProgress fileTransferProgress) { + Provider.of(NavService.navKey.currentContext!, + listen: false) + .updateReceivedFileProgress( + transferId, + fileTransferProgress, + ); + + notifyListeners(); } refreshReceivedFile({bool setLoading = true}) async { From be4e6ec03cf148b2a7681c1deec3b6d146b06a78 Mon Sep 17 00:00:00 2001 From: Sachin Singh Date: Thu, 12 May 2022 14:15:17 +0530 Subject: [PATCH 2/9] % sign added and nul check issue resolved --- .../common_widgets/labelled_circular_progress.dart | 4 ++-- lib/screens/history/widgets/received_file_list_tile.dart | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/screens/common_widgets/labelled_circular_progress.dart b/lib/screens/common_widgets/labelled_circular_progress.dart index 2ed80334..ae76cc9e 100644 --- a/lib/screens/common_widgets/labelled_circular_progress.dart +++ b/lib/screens/common_widgets/labelled_circular_progress.dart @@ -15,8 +15,8 @@ class LabelledCircularProgressIndicator extends StatelessWidget { ? Positioned( top: 10, child: Padding( - padding: EdgeInsets.only(left: 11), - child: Text((value! * 100).toStringAsFixed(0), + padding: EdgeInsets.only(left: 8), + child: Text((value! * 100).toStringAsFixed(0) + '%', style: TextStyle( fontSize: 10, fontWeight: FontWeight.bold, diff --git a/lib/screens/history/widgets/received_file_list_tile.dart b/lib/screens/history/widgets/received_file_list_tile.dart index f5834095..ba7dadd6 100644 --- a/lib/screens/history/widgets/received_file_list_tile.dart +++ b/lib/screens/history/widgets/received_file_list_tile.dart @@ -58,7 +58,7 @@ class _ReceivedFilesListTileState extends State { String nickName = ''; Map _futureBuilder = {}; - Future videoThumbnailBuilder(String path) async { + Future videoThumbnailBuilder(String path) async { videoThumbnail = await VideoThumbnail.thumbnailData( video: path, imageFormat: ImageFormat.JPEG, @@ -672,7 +672,7 @@ class _ReceivedFilesListTileState extends State { Widget thumbnail( String? extension, String path, { - bool? isFilePresent = true, + bool isFilePresent = true, }) { // when file overwrite is true, we are not showing file preview. if (isOverwrite) { @@ -684,7 +684,7 @@ class _ReceivedFilesListTileState extends State { child: Container( height: 50.toHeight, width: 50.toWidth, - child: isFilePresent! + child: isFilePresent ? Image.file( File(path), fit: BoxFit.cover, @@ -719,7 +719,7 @@ class _ReceivedFilesListTileState extends State { fit: BoxFit.cover, ) : Image.memory( - videoThumbnail!, + snapshot.data! as Uint8List, fit: BoxFit.cover, errorBuilder: (BuildContext _context, _, __) { return Container( From 527bf57675f46f93037f62af90f7ff9413f7f813 Mon Sep 17 00:00:00 2001 From: Sachin Singh Date: Thu, 12 May 2022 15:21:57 +0530 Subject: [PATCH 3/9] added function to filter through history data --- lib/data_models/file_modal.dart | 52 ----- lib/data_models/file_transfer.dart | 7 +- lib/demo_data/file_transfer_data.dart | 43 ---- .../labelled_circular_progress.dart | 2 +- lib/screens/history/history_screen.dart | 184 ++++++++++-------- lib/view_models/file_transfer_provider.dart | 3 +- lib/view_models/history_provider.dart | 48 +---- 7 files changed, 115 insertions(+), 224 deletions(-) delete mode 100644 lib/demo_data/file_transfer_data.dart diff --git a/lib/data_models/file_modal.dart b/lib/data_models/file_modal.dart index 18e296d1..5275279e 100644 --- a/lib/data_models/file_modal.dart +++ b/lib/data_models/file_modal.dart @@ -4,58 +4,6 @@ import 'package:atsign_atmosphere_pro/data_models/file_transfer_status.dart'; enum HistoryType { send, received } -class FilesModel { - List? name; - String? handle; - String? date; - int? id; - double? totalSize; - HistoryType? historyType; - - List? files; - - FilesModel( - {this.name, - this.handle, - this.date, - this.files, - this.id, - this.historyType, - this.totalSize}); - - FilesModel.fromJson(json) { - name = jsonDecode(json['name']); - handle = json['handle'].toString(); - date = json['date'].toString(); - id = json['id']; - totalSize = double.parse(json['total_size'].toString()); - - if (json['files'] != null) { - files = []; - json['files'].forEach((v) { - if (v.runtimeType == String) { - files!.add(FilesDetail.fromJson(v)); - } else { - files!.add(FilesDetail.fromMap(v)); - } - }); - } - } - - Map toJson() { - final Map data = Map(); - data['name'] = jsonEncode(this.name); - data['handle'] = this.handle; - data['date'] = this.date; - data['total_size'] = this.totalSize; - data['id'] = this.id; - if (this.files != null) { - data['files'] = this.files!.map((v) => v.toJson()).toList(); - } - return data; - } -} - class FilesDetail { String? fileName; String? filePath; diff --git a/lib/data_models/file_transfer.dart b/lib/data_models/file_transfer.dart index 0e0c7079..dc9499fc 100644 --- a/lib/data_models/file_transfer.dart +++ b/lib/data_models/file_transfer.dart @@ -4,7 +4,8 @@ import 'package:atsign_atmosphere_pro/data_models/file_modal.dart'; import 'package:file_picker/file_picker.dart'; class FileTransfer { - String? key, url, sender; + late String key, url; + String? sender; List? files; DateTime? date, expiry; List? platformFiles; @@ -12,12 +13,12 @@ class FileTransfer { bool? isDownloading; bool? isWidgetOpen; FileTransfer({ - this.url, + required this.url, this.files, this.expiry, this.platformFiles, this.date, - this.key, + required this.key, this.isUpdate = false, this.isDownloading = false, this.isWidgetOpen = false, diff --git a/lib/demo_data/file_transfer_data.dart b/lib/demo_data/file_transfer_data.dart deleted file mode 100644 index bec00944..00000000 --- a/lib/demo_data/file_transfer_data.dart +++ /dev/null @@ -1,43 +0,0 @@ -import 'package:atsign_atmosphere_pro/data_models/file_modal.dart'; -import 'package:atsign_atmosphere_pro/data_models/file_transfer.dart'; -import 'package:file_picker/file_picker.dart'; -import 'package:at_client/src/stream/file_transfer_object.dart'; - -class DemoData { - List getFileHistoryData() { - List fileHistorys = []; - for (int i = 0; i < 11; i++) { - FileTransfer fileTransfer = FileTransfer( - url: 'url', - files: [FileData(name: 'name', size: 10, url: 'url', path: 'path')], - expiry: DateTime.now(), - platformFiles: [ - PlatformFile( - name: 'name', - size: 1000, - path: 'path', - ) - ], - date: DateTime.now(), - ); - FileHistory fileHistory = FileHistory( - fileTransfer, - [ - ShareStatus('@kevin', true), - ShareStatus('@colin', true), - ShareStatus('@k', true) - ], - HistoryType.send, - FileTransferObject( - 'transferId', - 'fileEncryptionKey', - 'fileUrl', - 'sharedWith', - [], - )); - fileHistorys.add(fileHistory); - } - - return fileHistorys; - } -} diff --git a/lib/screens/common_widgets/labelled_circular_progress.dart b/lib/screens/common_widgets/labelled_circular_progress.dart index ae76cc9e..19db0e0c 100644 --- a/lib/screens/common_widgets/labelled_circular_progress.dart +++ b/lib/screens/common_widgets/labelled_circular_progress.dart @@ -15,7 +15,7 @@ class LabelledCircularProgressIndicator extends StatelessWidget { ? Positioned( top: 10, child: Padding( - padding: EdgeInsets.only(left: 8), + padding: EdgeInsets.only(left: 7), child: Text((value! * 100).toStringAsFixed(0) + '%', style: TextStyle( fontSize: 10, diff --git a/lib/screens/history/history_screen.dart b/lib/screens/history/history_screen.dart index fa041aba..177bae54 100644 --- a/lib/screens/history/history_screen.dart +++ b/lib/screens/history/history_screen.dart @@ -1,3 +1,4 @@ +import 'package:atsign_atmosphere_pro/data_models/file_transfer.dart'; import 'package:atsign_atmosphere_pro/screens/common_widgets/app_bar.dart'; import 'package:atsign_atmosphere_pro/screens/common_widgets/provider_handler.dart'; import 'package:atsign_atmosphere_pro/screens/history/widgets/received_file_list_tile.dart'; @@ -64,9 +65,6 @@ class _HistoryScreenState extends State Container( height: 40, child: TabBar( - onTap: (index) async { - print('current tab: ${index}'); - }, labelColor: ColorConstants.fontPrimary, indicatorWeight: 5.toHeight, indicatorColor: Colors.black, @@ -107,48 +105,63 @@ class _HistoryScreenState extends State child: ProviderHandler( functionName: historyProvider!.SENT_HISTORY, showError: false, - successBuilder: (provider) => (provider - .sentHistory.isEmpty) - ? ListView.separated( - padding: EdgeInsets.only(bottom: 170.toHeight), - physics: AlwaysScrollableScrollPhysics(), - separatorBuilder: (context, index) => - Divider(indent: 16.toWidth), - itemCount: 1, - itemBuilder: (context, index) => Padding( - padding: const EdgeInsets.all(8.0), - child: SizedBox( - height: SizeConfig().screenHeight - - 120.toHeight, - child: Center( - child: Text( - 'No files sent', - style: TextStyle( - fontSize: 15.toFont, - fontWeight: FontWeight.normal, - ), + successBuilder: (provider) { + if ((provider.sentHistory.isEmpty)) { + return ListView.separated( + padding: EdgeInsets.only(bottom: 170.toHeight), + physics: AlwaysScrollableScrollPhysics(), + separatorBuilder: (context, index) => + Divider(indent: 16.toWidth), + itemCount: 1, + itemBuilder: (context, index) => Padding( + padding: const EdgeInsets.all(8.0), + child: SizedBox( + height: + SizeConfig().screenHeight - 120.toHeight, + child: Center( + child: Text( + 'No files sent', + style: TextStyle( + fontSize: 15.toFont, + fontWeight: FontWeight.normal, ), ), ), ), - ) - : ListView.separated( - padding: EdgeInsets.only(bottom: 170.toHeight), - physics: AlwaysScrollableScrollPhysics(), - separatorBuilder: (context, index) { - return Divider( - indent: 16.toWidth, - ); - }, - itemCount: provider.sentHistory.length, - itemBuilder: (context, index) { - return SentFilesListTile( - sentHistory: provider.sentHistory[index], - key: Key(provider - .sentHistory[index].fileDetails!.key!), - ); - }, ), + ); + } else { + List filteredSentHistory = []; + provider.sentHistory.forEach((element) { + if (element.sharedWith!.any( + (ShareStatus sharedStatus) => sharedStatus + .atsign! + .contains(provider.getSearchText), + )) { + filteredSentHistory.add(element); + } + }); + + return ListView.separated( + padding: EdgeInsets.only(bottom: 170.toHeight), + physics: AlwaysScrollableScrollPhysics(), + separatorBuilder: (context, index) { + return Divider( + indent: 16.toWidth, + ); + }, + itemCount: filteredSentHistory.length, + itemBuilder: (context, index) { + return SentFilesListTile( + sentHistory: filteredSentHistory[index], + key: Key(filteredSentHistory[index] + .fileDetails! + .key), + ); + }, + ); + } + }, errorBuilder: (provider) => ListView.separated( padding: EdgeInsets.only(bottom: 170.toHeight), physics: AlwaysScrollableScrollPhysics(), @@ -186,55 +199,60 @@ class _HistoryScreenState extends State functionName: historyProvider!.RECEIVED_HISTORY, load: (provider) async {}, showError: false, - successBuilder: (provider) => (provider - .receivedHistoryLogs.isEmpty) - ? - // Used a listview for RefreshIndicator to be active. - ListView.separated( - padding: - EdgeInsets.only(bottom: 170.toHeight), - physics: AlwaysScrollableScrollPhysics(), - separatorBuilder: (context, index) => - Divider(indent: 16.toWidth), - itemCount: 1, - itemBuilder: (context, index) => Padding( - padding: const EdgeInsets.all(8.0), - child: SizedBox( - height: SizeConfig().screenHeight - - 120.toHeight, - child: Center( - child: Text( - 'No files received', - style: TextStyle( - fontSize: 15.toFont, - fontWeight: FontWeight.normal, - ), + successBuilder: (provider) { + if ((provider.receivedHistoryLogs.isEmpty)) { + return ListView.separated( + padding: EdgeInsets.only(bottom: 170.toHeight), + physics: AlwaysScrollableScrollPhysics(), + separatorBuilder: (context, index) => + Divider(indent: 16.toWidth), + itemCount: 1, + itemBuilder: (context, index) => Padding( + padding: const EdgeInsets.all(8.0), + child: SizedBox( + height: SizeConfig().screenHeight - + 120.toHeight, + child: Center( + child: Text( + 'No files received', + style: TextStyle( + fontSize: 15.toFont, + fontWeight: FontWeight.normal, ), ), ), ), - ) - : ListView.separated( - padding: - EdgeInsets.only(bottom: 170.toHeight), - physics: AlwaysScrollableScrollPhysics(), - separatorBuilder: (context, index) => - Divider(indent: 16.toWidth), - itemCount: - provider.receivedHistoryLogs.length, - itemBuilder: (context, index) => Padding( - padding: const EdgeInsets.all(8.0), - child: ReceivedFilesListTile( - key: Key(provider - .receivedHistoryLogs[index].key!), - receivedHistory: - provider.receivedHistoryLogs[index], - isWidgetOpen: provider - .receivedHistoryLogs[index] - .isWidgetOpen, - ), + ), + ); + } else { + List filteredReceivedList = []; + provider.receivedHistoryLogs.forEach((element) { + if (element.sender!.contains( + provider.getSearchText, + )) { + filteredReceivedList.add(element); + } + }); + + return ListView.separated( + padding: EdgeInsets.only(bottom: 170.toHeight), + physics: AlwaysScrollableScrollPhysics(), + separatorBuilder: (context, index) => + Divider(indent: 16.toWidth), + itemCount: filteredReceivedList.length, + itemBuilder: (context, index) => Padding( + padding: const EdgeInsets.all(8.0), + child: ReceivedFilesListTile( + key: Key(filteredReceivedList[index].key), + receivedHistory: + filteredReceivedList[index], + isWidgetOpen: filteredReceivedList[index] + .isWidgetOpen, ), ), + ); + } + }, errorBuilder: (provider) => ListView.separated( padding: EdgeInsets.only(bottom: 170.toHeight), physics: AlwaysScrollableScrollPhysics(), diff --git a/lib/view_models/file_transfer_provider.dart b/lib/view_models/file_transfer_provider.dart index d2510aa5..9b99057f 100644 --- a/lib/view_models/file_transfer_provider.dart +++ b/lib/view_models/file_transfer_provider.dart @@ -229,11 +229,10 @@ class FileTransferProvider extends BaseModel { NavService.navKey.currentContext!, listen: false); - FileTransfer filesToTransfer = FileTransfer(platformFiles: selectedFiles); var _files = []; var _atSigns = []; - filesToTransfer.files!.forEach((element) { + selectedFiles.forEach((element) { _files.add(File(element.path!)); }); diff --git a/lib/view_models/history_provider.dart b/lib/view_models/history_provider.dart index 1b0a63d4..0ef4a690 100644 --- a/lib/view_models/history_provider.dart +++ b/lib/view_models/history_provider.dart @@ -55,10 +55,10 @@ class HistoryProvider extends BaseModel { String DOWNLOAD_ACK = 'download_ack'; List sentHistory = [], tempSentHistory = []; List receivedHistoryLogs = []; - List receivedHistoryNew = []; Map> downloadedFileAcknowledgement = {}; Map individualSentFileId = {}, receivedItemsId = {}; String? state; + String _historySearchText = ''; // on first transfer history fetch, we show loader in history screen. // on second attempt we keep the status as idle. @@ -81,7 +81,6 @@ class HistoryProvider extends BaseModel { List tabs = [Recents()]; - List? receivedHistory, receivedAudioModel = []; List desktopTabs = [DesktopRecents()]; String SORT_FILES = 'sort_files'; String POPULATE_TABS = 'populate_tabs'; @@ -107,42 +106,12 @@ class HistoryProvider extends BaseModel { receivedItemsId = {}; } - // setFileTransferHistory( - // FileTransferObject fileTransferObject, - // List sharedWithAtsigns, - // Map fileShareResult, { - // bool isEdit = false, - // }) async { - // FileHistory fileHistory = convertFileTransferObjectToFileHistory( - // fileTransferObject, - // sharedWithAtsigns, - // fileShareResult, - // ); - - // setStatus(SET_FILE_HISTORY, Status.Loading); - // await getSentHistory(); - // if (isEdit) { - // int index = sentHistory.indexWhere((element) => - // element?.fileDetails?.key?.contains(fileHistory.fileDetails.key)); - - // if (index > -1) { - // sendFileHistory['history'][index] = fileHistory.toJson(); - // sentHistory[index] = fileHistory; - // } - // } else { - // sendFileHistory['history'].insert(0, (fileHistory.toJson())); - // sentHistory.insert(0, fileHistory); - // } + String get getSearchText => _historySearchText; - // try { - // var result = await updateSentHistory(); - // setStatus(SET_FILE_HISTORY, Status.Done); - // return result; - // } catch (e) { - // setError(SET_FILE_HISTORY, e.toString()); - // setStatus(SET_FILE_HISTORY, Status.Error); - // } - // } + set setHistorySearchText(String txt) { + _historySearchText = txt.trim().toLowerCase(); + notifyListeners(); + } updateFileHistoryDetail(FileHistory fileHistory) async { // checking whether sent file is stored in individual atKey or in sentHistory list. @@ -524,7 +493,6 @@ class HistoryProvider extends BaseModel { receivedHistoryLogs[index] = filesModel; } } else { - receivedHistoryNew.insert(0, filesModel); receivedHistoryLogs.insert(0, filesModel); receivedItemsId[filesModel.key] = true; } @@ -590,7 +558,7 @@ class HistoryProvider extends BaseModel { FileTransferObject.fromJson(jsonDecode(atvalue.value))!; FileTransfer filesModel = convertFiletransferObjectToFileTransfer(fileTransferObject); - filesModel.sender = atKey.sharedBy; + filesModel.sender = atKey.sharedBy!; if (filesModel.key != null) { tempReceivedHistoryLogs.insert(0, filesModel); @@ -1332,7 +1300,7 @@ class HistoryProvider extends BaseModel { FileTransferObject.fromJson(jsonDecode(atvalue.value))!; FileTransfer filesModel = convertFiletransferObjectToFileTransfer(fileTransferObject); - filesModel.sender = atKey.sharedBy; + filesModel.sender = atKey.sharedBy!; if (filesModel.key != null) { receivedHistoryLogs.insert(0, filesModel); From 294852519e2a0c4d25b7cb19564f2af9ab59fdcd Mon Sep 17 00:00:00 2001 From: sonle Date: Mon, 11 Apr 2022 22:59:39 +0700 Subject: [PATCH 4/9] feat: add notification dot to TransferHistory menu --- lib/screens/common_widgets/side_bar.dart | 4 ++ .../common_widgets/side_bar_list_item.dart | 37 +++++++++++++++---- 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/lib/screens/common_widgets/side_bar.dart b/lib/screens/common_widgets/side_bar.dart index cf42409b..c9a70e9c 100644 --- a/lib/screens/common_widgets/side_bar.dart +++ b/lib/screens/common_widgets/side_bar.dart @@ -268,6 +268,10 @@ class _SideBarWidgetState extends State { _fileDownloadChecker.undownloadedFilesExist ? ColorConstants.orangeColor : ColorConstants.fadedText, + showNotificationDot: + _fileDownloadChecker.undownloadedFilesExist + ? true + : false, ); }, ), diff --git a/lib/screens/common_widgets/side_bar_list_item.dart b/lib/screens/common_widgets/side_bar_list_item.dart index 62d5c5ea..d44569b4 100644 --- a/lib/screens/common_widgets/side_bar_list_item.dart +++ b/lib/screens/common_widgets/side_bar_list_item.dart @@ -13,6 +13,7 @@ class SideBarItem extends StatelessWidget { final WelcomeScreenProvider _welcomeScreenProvider = WelcomeScreenProvider(); final Color displayColor; bool isScale; + final bool showNotificationDot; SideBarItem( {Key? key, this.image, @@ -22,6 +23,7 @@ class SideBarItem extends StatelessWidget { this.showIconOnly = false, this.isScale = false, this.displayColor = ColorConstants.fadedText, + this.showNotificationDot = false, this.isDesktop = false}) : super(key: key); @override @@ -42,15 +44,34 @@ class SideBarItem extends StatelessWidget { height: 50, child: Row( children: [ - Transform.scale( - scale: isScale ? 1.2 : 1, - child: Image.asset( - image!, - height: SizeConfig().isTablet(context) ? 24 : 22.toHeight, - color: displayColor, - ), + Stack( + children: [ + Container( + margin: EdgeInsets.only(right: isDesktop ? 20 : 10), + child: Transform.scale( + scale: isScale ? 1.2 : 1, + child: Image.asset( + image!, + height: SizeConfig().isTablet(context) ? 24 : 22.toHeight, + color: displayColor, + ), + ), + ), + if (showNotificationDot) + Positioned( + top: 0, + right: (isDesktop ? 20 : 10) - 4.toWidth, + child: Container( + width: 8.toWidth, + height: 8.toWidth, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.red, + ), + ), + ) + ], ), - SizedBox(width: isDesktop ? 20 : 10), !showIconOnly ? Expanded( child: Text( From 16a88f630d3d50b194d6f421e17d479f86974b3e Mon Sep 17 00:00:00 2001 From: sonle Date: Wed, 13 Apr 2022 13:11:59 +0700 Subject: [PATCH 5/9] fix: add semantics to widget --- lib/screens/common_widgets/app_bar.dart | 81 +++--- lib/screens/common_widgets/common_button.dart | 7 +- lib/screens/common_widgets/custom_button.dart | 7 +- .../widgets/received_file_list_tile.dart | 16 +- lib/screens/home/home.dart | 17 +- .../widgets/select_contact_widget.dart | 48 ++-- .../widgets/select_file_widget.dart | 230 +++++++++--------- .../widgets/welcome_sceen_home.dart | 1 + 8 files changed, 209 insertions(+), 198 deletions(-) diff --git a/lib/screens/common_widgets/app_bar.dart b/lib/screens/common_widgets/app_bar.dart index 1a98802d..a2cc9b93 100644 --- a/lib/screens/common_widgets/app_bar.dart +++ b/lib/screens/common_widgets/app_bar.dart @@ -208,44 +208,51 @@ class _CustomAppBarState extends State { } Widget menuBar(BuildContext context) { - return GestureDetector( - onTap: () { - Scaffold.of(context).openEndDrawer(); - }, - child: Stack( - alignment: Alignment.topRight, - clipBehavior: Clip.none, - children: [ - Container( - margin: EdgeInsets.only(top: 10.toHeight), - height: 22.toHeight, - width: 22.toWidth, - child: Image.asset( - ImageConstants.drawerIcon, - ), - ), - Consumer( - builder: (context, _fileDownloadChecker, _) { - return _fileDownloadChecker.undownloadedFilesExist - ? Positioned( - right: -4, - top: 2, - child: Container( - decoration: BoxDecoration( - color: Colors.white, - shape: BoxShape.circle, - ), - padding: EdgeInsets.all(1.toHeight), - child: CircleAvatar( - backgroundColor: Colors.red, - radius: 5.toWidth, + return Consumer( + builder: (context, _fileDownloadChecker, _) { + return IconButton( + onPressed: () { + Scaffold.of(context).openEndDrawer(); + }, + alignment: Alignment.topCenter, + tooltip: _fileDownloadChecker.undownloadedFilesExist + ? 'Hamburger Menu & Dot' + : 'Hamburger Menu', + padding: EdgeInsets.zero, + icon: Stack( + alignment: Alignment.topRight, + clipBehavior: Clip.none, + children: [ + Container( + margin: EdgeInsets.only(top: 10.toHeight), + height: 22.toHeight, + width: 22.toWidth, + child: Image.asset( + ImageConstants.drawerIcon, + semanticLabel: '', + ), + ), + _fileDownloadChecker.undownloadedFilesExist + ? Positioned( + right: -4, + top: 2, + child: Container( + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.circle, + ), + padding: EdgeInsets.all(1.toHeight), + child: CircleAvatar( + backgroundColor: Colors.red, + radius: 5.toWidth, + ), ), - ), - ) - : SizedBox(); - }), - ], - ), + ) + : SizedBox(), + ], + ), + ); + }, ); } } diff --git a/lib/screens/common_widgets/common_button.dart b/lib/screens/common_widgets/common_button.dart index 658ac083..5f9ba265 100644 --- a/lib/screens/common_widgets/common_button.dart +++ b/lib/screens/common_widgets/common_button.dart @@ -25,8 +25,11 @@ class CommonButton extends StatelessWidget { @override Widget build(BuildContext context) { double deviceTextFactor = MediaQuery.of(context).textScaleFactor; - return InkWell( - onTap: onTap, + return TextButton( + onPressed: onTap, + style: TextButton.styleFrom( + padding: EdgeInsets.zero, + ), child: Container( width: width ?? 120.toWidth, height: height ?? 45.toHeight * deviceTextFactor, diff --git a/lib/screens/common_widgets/custom_button.dart b/lib/screens/common_widgets/custom_button.dart index 35022717..6c5c93fd 100644 --- a/lib/screens/common_widgets/custom_button.dart +++ b/lib/screens/common_widgets/custom_button.dart @@ -25,8 +25,11 @@ class CustomButton extends StatelessWidget { : super(key: key); @override Widget build(BuildContext context) { - return GestureDetector( - onTap: onPressed, + return TextButton( + onPressed: onPressed, + style: TextButton.styleFrom( + padding: EdgeInsets.zero, + ), child: Container( width: width ?? 158.toWidth, height: height ?? (50.toHeight), diff --git a/lib/screens/history/widgets/received_file_list_tile.dart b/lib/screens/history/widgets/received_file_list_tile.dart index 56f8fb95..ff1b153a 100644 --- a/lib/screens/history/widgets/received_file_list_tile.dart +++ b/lib/screens/history/widgets/received_file_list_tile.dart @@ -379,8 +379,12 @@ class _ReceivedFilesListTileState extends State { height: 3.toHeight, ), (!isOpen!) - ? GestureDetector( - onTap: () { + ? TextButton( + style: TextButton.styleFrom( + padding: EdgeInsets.zero, + tapTargetSize: MaterialTapTargetSize.shrinkWrap, + ), + onPressed: () { if (mounted) { setState(() { isOpen = !isOpen; @@ -593,8 +597,12 @@ class _ReceivedFilesListTileState extends State { ); }), ), - GestureDetector( - onTap: () { + TextButton( + style: TextButton.styleFrom( + padding: EdgeInsets.zero, + tapTargetSize: MaterialTapTargetSize.shrinkWrap, + ), + onPressed: () { if (mounted) { setState(() { isOpen = !isOpen!; diff --git a/lib/screens/home/home.dart b/lib/screens/home/home.dart index 1c9701d4..01711a39 100644 --- a/lib/screens/home/home.dart +++ b/lib/screens/home/home.dart @@ -229,6 +229,8 @@ class _HomeState extends State { children: [ Text( TextStrings().homeDescriptionMobile, + semanticsLabel: + '${TextStrings().appName} \n ${TextStrings().homeDescriptionMobile}', style: GoogleFonts.playfairDisplay( textStyle: TextStyle( fontSize: 38.toFont, @@ -266,18 +268,15 @@ class _HomeState extends State { await _backendService .checkToOnboard(); }), - SizedBox(height: 15.toHeight), - InkWell( - onTap: () { + // SizedBox(height: 15.toHeight), + CustomButton( + onPressed: () { CommonUtilityFunctions() .showResetAtsignDialog(); }, - child: Text( - TextStrings.resetButton, - style: TextStyle( - fontSize: 15.toFont, - fontWeight: FontWeight.bold), - ), + isInverted: true, + width: SizeConfig().screenWidth * 0.8, + buttonText: TextStrings.resetButton, ), ], ), diff --git a/lib/screens/welcome_screen/widgets/select_contact_widget.dart b/lib/screens/welcome_screen/widgets/select_contact_widget.dart index b70b9479..954c4794 100644 --- a/lib/screens/welcome_screen/widgets/select_contact_widget.dart +++ b/lib/screens/welcome_screen/widgets/select_contact_widget.dart @@ -35,7 +35,6 @@ class _SelectContactWidgetState extends State { textTheme: TextTheme( subtitle1: TextStyle( color: ColorConstants.inputFieldColor, - fontWeight: FontWeight.normal, ), ), ), @@ -62,36 +61,31 @@ class _ExpansionTileWidget extends StatelessWidget { _ExpansionTileWidget(this.headerText, this.onSelected); @override Widget build(BuildContext context) { - return ExpansionTile( - tilePadding: SizeConfig().isTablet(context) - ? EdgeInsets.symmetric(vertical: 10.toFont, horizontal: 10.toFont) - : EdgeInsets.only(left: 10.toFont, right: 10.toFont), - backgroundColor: ColorConstants.inputFieldColor, - title: InkWell( - onTap: () { - selectContact(context); - }, - child: Text( - headerText!, - style: TextStyle( - color: ColorConstants.fadedText, - fontSize: 14.toFont, - fontWeight: FontWeight.normal, - ), + return ListTile( + // tilePadding: SizeConfig().isTablet(context) + // ? EdgeInsets.symmetric(vertical: 10.toFont, horizontal: 10.toFont) + // : EdgeInsets.only(left: 10.toFont, right: 10.toFont), + // backgroundColor: ColorConstants.inputFieldColor, + title: Text( + headerText!, + style: TextStyle( + color: ColorConstants.fadedText, + fontSize: 14.toFont, + fontWeight: FontWeight.normal, ), + semanticsLabel: 'Select @sign from contacts button', ), - trailing: InkWell( - onTap: () { - selectContact(context); - }, - child: Container( - padding: EdgeInsets.symmetric(vertical: 15), - child: Image.asset( - ImageConstants.contactsIcon, - color: Colors.black, - ), + trailing: Container( + padding: EdgeInsets.symmetric(vertical: 15), + child: Image.asset( + ImageConstants.contactsIcon, + color: Colors.black, + semanticLabel: '', ), ), + onTap: () { + selectContact(context); + }, ); } diff --git a/lib/screens/welcome_screen/widgets/select_file_widget.dart b/lib/screens/welcome_screen/widgets/select_file_widget.dart index 31cd4430..35e7f927 100644 --- a/lib/screens/welcome_screen/widgets/select_file_widget.dart +++ b/lib/screens/welcome_screen/widgets/select_file_widget.dart @@ -119,133 +119,129 @@ class _SelectFileWidgetState extends State { @override Widget build(BuildContext context) { return ClipRRect( - child: InkWell( - onTap: () { - _showFileChoice(); - }, - child: Container( - padding: SizeConfig().isTablet(context) - ? EdgeInsets.symmetric(vertical: 10.toFont, horizontal: 10.toFont) - : EdgeInsets.only(left: 10.toFont, right: 10.toFont), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(15.toFont), - color: ColorConstants.inputFieldColor, - ), - child: Column( - children: [ - ListTile( - contentPadding: EdgeInsets.all(0), - title: Text( - filePickerProvider!.selectedFiles.isEmpty - ? TextStrings().welcomeFilePlaceholder - : TextStrings().welcomeAddFilePlaceholder, - style: TextStyle( - color: ColorConstants.fadedText, - fontSize: 14.toFont, - fontWeight: FontWeight.normal, - )), - subtitle: filePickerProvider!.selectedFiles.isEmpty - ? null - : Text( - double.parse( - filePickerProvider!.totalSize.toString()) <= - 1024 - ? '${filePickerProvider!.totalSize} Kb . ${filePickerProvider!.selectedFiles.length} file(s)' - : '${(filePickerProvider!.totalSize / (1024 * 1024)).toStringAsFixed(2)} Mb . ${filePickerProvider!.selectedFiles.length} file(s)', - style: TextStyle( - color: ColorConstants.fadedText, - fontSize: 10.toFont, - fontWeight: FontWeight.normal, - ), + child: Container( + // padding: SizeConfig().isTablet(context) + // ? EdgeInsets.symmetric(vertical: 10.toFont, horizontal: 10.toFont) + // : EdgeInsets.only(left: 10.toFont, right: 10.toFont), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15.toFont), + color: ColorConstants.inputFieldColor, + ), + child: Column( + children: [ + ListTile( + // contentPadding: EdgeInsets.all(0), + title: Text( + filePickerProvider!.selectedFiles.isEmpty + ? TextStrings().welcomeFilePlaceholder + : TextStrings().welcomeAddFilePlaceholder, + semanticsLabel: 'Select file to transfer button', + style: TextStyle( + color: ColorConstants.fadedText, + fontSize: 14.toFont, + fontWeight: FontWeight.normal, + )), + subtitle: filePickerProvider!.selectedFiles.isEmpty + ? null + : Text( + double.parse( + filePickerProvider!.totalSize.toString()) <= + 1024 + ? '${filePickerProvider!.totalSize} Kb . ${filePickerProvider!.selectedFiles.length} file(s)' + : '${(filePickerProvider!.totalSize / (1024 * 1024)).toStringAsFixed(2)} Mb . ${filePickerProvider!.selectedFiles.length} file(s)', + style: TextStyle( + color: ColorConstants.fadedText, + fontSize: 10.toFont, + fontWeight: FontWeight.normal, ), - trailing: InkWell( - onTap: () { - _showFileChoice(); - }, - child: Container( - padding: EdgeInsets.symmetric(vertical: 15.toHeight), - child: Icon( - Icons.add_circle, - color: Colors.black, ), - ), + onTap: () { + _showFileChoice(); + }, + trailing: Container( + padding: EdgeInsets.symmetric(vertical: 15.toHeight), + child: Icon( + Icons.add_circle, + color: Colors.black, ), ), - filePickerProvider!.selectedFiles.isNotEmpty - ? ListView.builder( - shrinkWrap: true, - physics: ClampingScrollPhysics(), - itemCount: filePickerProvider!.selectedFiles.isNotEmpty - ? int.parse(filePickerProvider!.selectedFiles.length - .toString()) - : 0, - itemBuilder: (c, index) { - return Consumer( - builder: (context, provider, _) { - if (provider.selectedFiles.isEmpty) { - return SizedBox(); - } - return Container( - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: ColorConstants.dividerColor - .withOpacity(0.1), - width: 1.toHeight, - ), + ), + filePickerProvider!.selectedFiles.isNotEmpty + ? ListView.builder( + shrinkWrap: true, + physics: ClampingScrollPhysics(), + itemCount: filePickerProvider!.selectedFiles.isNotEmpty + ? int.parse(filePickerProvider!.selectedFiles.length + .toString()) + : 0, + itemBuilder: (c, index) { + return Consumer( + builder: (context, provider, _) { + if (provider.selectedFiles.isEmpty) { + return SizedBox(); + } + return Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: ColorConstants.dividerColor + .withOpacity(0.1), + width: 1.toHeight, ), ), - child: ListTile( - title: Text( - provider.selectedFiles[index].name.toString(), - style: TextStyle( - color: Colors.black, - fontSize: 14.toFont, - fontWeight: FontWeight.normal, - ), + ), + child: ListTile( + title: Text( + provider.selectedFiles[index].name.toString(), + style: TextStyle( + color: Colors.black, + fontSize: 14.toFont, + fontWeight: FontWeight.normal, ), - subtitle: Text( - double.parse(provider.selectedFiles[index].size - .toString()) <= - 1024 - ? '${provider.selectedFiles[index].size} Kb' + - ' . ${provider.selectedFiles[index].extension}' - : '${(provider.selectedFiles[index].size / (1024 * 1024)).toStringAsFixed(2)} Mb' + - ' . ${provider.selectedFiles[index].extension}', - style: TextStyle( - color: ColorConstants.fadedText, - fontSize: 14.toFont, - fontWeight: FontWeight.normal, - ), + ), + subtitle: Text( + double.parse(provider.selectedFiles[index].size + .toString()) <= + 1024 + ? '${provider.selectedFiles[index].size} Kb' + + ' . ${provider.selectedFiles[index].extension}' + : '${(provider.selectedFiles[index].size / (1024 * 1024)).toStringAsFixed(2)} Mb' + + ' . ${provider.selectedFiles[index].extension}', + style: TextStyle( + color: ColorConstants.fadedText, + fontSize: 14.toFont, + fontWeight: FontWeight.normal, ), - leading: CommonUtilityFunctions().thumbnail( - provider.selectedFiles[index].extension - .toString(), - provider.selectedFiles[index].path - .toString()), - trailing: IconButton( - icon: Icon(Icons.clear), - onPressed: () { - setState(() { - provider.selectedFiles.removeAt(index); - provider.calculateSize(); - provider.hasSelectedFilesChanged = true; - }); - if (provider.selectedFiles.isEmpty) { - widget.onUpdate(false); - } else { - widget.onUpdate(true); - } - }, + ), + leading: CommonUtilityFunctions().thumbnail( + provider.selectedFiles[index].extension + .toString(), + provider.selectedFiles[index].path + .toString()), + trailing: IconButton( + icon: Icon( + Icons.clear, ), + onPressed: () { + setState(() { + provider.selectedFiles.removeAt(index); + provider.calculateSize(); + provider.hasSelectedFilesChanged = true; + }); + if (provider.selectedFiles.isEmpty) { + widget.onUpdate(false); + } else { + widget.onUpdate(true); + } + }, ), - ); - }); - }, - ) - : SizedBox(), - ], - ), + ), + ); + }); + }, + ) + : SizedBox(), + ], ), ), ); diff --git a/lib/screens/welcome_screen/widgets/welcome_sceen_home.dart b/lib/screens/welcome_screen/widgets/welcome_sceen_home.dart index 889993e8..e44e9530 100644 --- a/lib/screens/welcome_screen/widgets/welcome_sceen_home.dart +++ b/lib/screens/welcome_screen/widgets/welcome_sceen_home.dart @@ -75,6 +75,7 @@ class _WelcomeScreenHomeState extends State { children: [ Text( TextStrings().welcome, + semanticsLabel: TextStrings().welcome, style: GoogleFonts.playfairDisplay( textStyle: TextStyle( fontSize: 26.toFont, From 986e09045f329bfedd3785506e7eec8ae8622104 Mon Sep 17 00:00:00 2001 From: Sachin Singh Date: Fri, 13 May 2022 18:33:55 +0530 Subject: [PATCH 6/9] filter function added in history screen for desktop --- .../desktop_history/desktop_history.dart | 300 +++++++++++------- .../common_widgets/history_app_bar.dart | 157 +++++++++ lib/screens/history/history_screen.dart | 9 +- 3 files changed, 354 insertions(+), 112 deletions(-) create mode 100644 lib/screens/common_widgets/history_app_bar.dart diff --git a/lib/desktop_screens/desktop_history/desktop_history.dart b/lib/desktop_screens/desktop_history/desktop_history.dart index 22986436..c8df960a 100644 --- a/lib/desktop_screens/desktop_history/desktop_history.dart +++ b/lib/desktop_screens/desktop_history/desktop_history.dart @@ -1,3 +1,4 @@ +import 'package:at_common_flutter/widgets/custom_input_field.dart'; import 'package:atsign_atmosphere_pro/data_models/file_transfer.dart'; import 'package:atsign_atmosphere_pro/desktop_screens/desktop_history/widgets/desktop_received_file_details.dart'; import 'package:atsign_atmosphere_pro/desktop_screens/desktop_history/widgets/desktop_received_file_list_tile.dart'; @@ -5,6 +6,7 @@ import 'package:atsign_atmosphere_pro/desktop_screens/desktop_history/widgets/de import 'package:atsign_atmosphere_pro/desktop_screens/desktop_history/widgets/desktop_sent_file_list_tile.dart'; import 'package:atsign_atmosphere_pro/screens/common_widgets/provider_handler.dart'; import 'package:at_common_flutter/services/size_config.dart'; +import 'package:atsign_atmosphere_pro/services/navigation_service.dart'; import 'package:atsign_atmosphere_pro/utils/colors.dart'; import 'package:atsign_atmosphere_pro/utils/text_strings.dart'; import 'package:atsign_atmosphere_pro/utils/text_styles.dart'; @@ -24,33 +26,45 @@ class DesktopHistoryScreen extends StatefulWidget { class _DesktopHistoryScreenState extends State with SingleTickerProviderStateMixin { TabController? _controller; - HistoryProvider? historyProvider; + late HistoryProvider historyProvider; int sentSelectedIndex = 0; String? receivedSelectedFileId; FileHistory? selectedSentFileData; FileTransfer? receivedFileData; - bool isSentTab = false; + bool isSentTab = false, _showSearchField = false; + late TextEditingController _textController; + + @override + void initState() { + historyProvider = + Provider.of(NavService.navKey.currentContext!); + _textController = TextEditingController(); + super.initState(); + } @override void didChangeDependencies() async { - if (historyProvider == null) { - _controller = - TabController(length: 2, vsync: this, initialIndex: widget.tabIndex); - _controller!.addListener(onTabChanged); - historyProvider = Provider.of(context); - if (historyProvider!.sentHistory.isNotEmpty) { - selectedSentFileData = historyProvider!.sentHistory[0]; - } - if (historyProvider!.receivedHistoryLogs.isNotEmpty) { - receivedFileData = historyProvider!.receivedHistoryLogs[0]; - } + _controller = + TabController(length: 2, vsync: this, initialIndex: widget.tabIndex); + _controller!.addListener(onTabChanged); + + if (historyProvider.sentHistory.isNotEmpty) { + selectedSentFileData = historyProvider.sentHistory[0]; } + if (historyProvider.receivedHistoryLogs.isNotEmpty) { + receivedFileData = historyProvider.receivedHistoryLogs[0]; + } + super.didChangeDependencies(); } @override void dispose() { _controller!.removeListener(onTabChanged); + _textController.dispose(); + WidgetsBinding.instance!.addPostFrameCallback((timeStamp) { + historyProvider.setHistorySearchText = ''; + }); super.dispose(); } @@ -123,9 +137,21 @@ class _DesktopHistoryScreenState extends State child: InkWell( onTap: refreshHistoryScreen, child: Icon(Icons.refresh)), - ) + ), + Positioned( + right: 45, + top: 25, + child: InkWell( + onTap: () { + setState(() { + _showSearchField = true; + }); + }, + child: Icon(Icons.search)), + ), ], ), + _showSearchField ? searchHistoryField() : SizedBox(), Expanded( child: TabBarView( controller: _controller, @@ -134,45 +160,33 @@ class _DesktopHistoryScreenState extends State functionName: historyProvider!.SENT_HISTORY, showError: false, successBuilder: (provider) { - return (provider.sentHistory.isEmpty) - ? Center( - child: Text(TextStrings().noFilesSent, - style: TextStyle( - fontSize: 15.toFont, - fontWeight: FontWeight.normal, - )), - ) - : ListView.separated( - padding: - EdgeInsets.only(bottom: 170.toHeight), - physics: AlwaysScrollableScrollPhysics(), - separatorBuilder: (context, index) { - return Divider( - indent: 16.toWidth, - ); - }, - itemCount: provider.sentHistory.length, - itemBuilder: (context, index) { - return InkWell( - onTap: () { - setState(() { - sentSelectedIndex = index; - selectedSentFileData = - provider.sentHistory[index]; - }); - }, - child: DesktopSentFilesListTile( - sentHistory: - provider.sentHistory[index], - key: Key(provider.sentHistory[index] - .fileDetails!.key!), - isSelected: index == sentSelectedIndex - ? true - : false, - ), - ); - }, - ); + if ((provider.sentHistory.isEmpty)) { + return Center( + child: Text(TextStrings().noFilesSent, + style: TextStyle( + fontSize: 15.toFont, + fontWeight: FontWeight.normal, + )), + ); + } else { + List filteredSentHistory = []; + provider.sentHistory.forEach((element) { + if (element.sharedWith!.any( + (ShareStatus sharedStatus) => sharedStatus + .atsign! + .contains(provider.getSearchText), + )) { + filteredSentHistory.add(element); + } + }); + if (filteredSentHistory.isNotEmpty) { + return getSentHistory(filteredSentHistory); + } else { + return Center( + child: Text('No results found.'), + ); + } + } }, errorBuilder: (provider) => Center( child: Text(TextStrings().errorOccured), @@ -196,54 +210,32 @@ class _DesktopHistoryScreenState extends State provider.receivedHistoryLogs[0]; } - return (provider.receivedHistoryLogs.isEmpty) - ? Center( - child: Text( - TextStrings().noFilesRecieved, - style: TextStyle( - fontSize: 15.toFont, - fontWeight: FontWeight.normal, - ), - ), - ) - : ListView.separated( - padding: - EdgeInsets.only(bottom: 170.toHeight), - physics: AlwaysScrollableScrollPhysics(), - separatorBuilder: (context, index) => - Divider( - indent: 16.toWidth, - ), - itemCount: - provider.receivedHistoryLogs.length, - itemBuilder: (context, index) => Padding( - padding: const EdgeInsets.all(8.0), - child: InkWell( - onTap: () { - receivedFileData = provider - .receivedHistoryLogs[index]; + if ((provider.receivedHistoryLogs.isEmpty)) { + return Center( + child: Text( + TextStrings().noFilesRecieved, + style: TextStyle( + fontSize: 15.toFont, + fontWeight: FontWeight.normal, + ), + ), + ); + } else { + List filteredReceivedList = []; + provider.receivedHistoryLogs.forEach((element) { + if (element.sender!.contains( + provider.getSearchText, + )) { + filteredReceivedList.add(element); + } + }); - setState(() { - receivedSelectedFileId = provider - .receivedHistoryLogs[index].key; - }); - }, - child: DesktopReceivedFilesListTile( - key: Key(provider - .receivedHistoryLogs[index].key!), - receivedHistory: provider - .receivedHistoryLogs[index], - isSelected: receivedSelectedFileId == - provider - .receivedHistoryLogs[ - index] - .key - ? true - : false, - ), - ), - ), - ); + if (filteredReceivedList.isNotEmpty) { + return getReceivedTiles(filteredReceivedList); + } else { + return Center(child: Text('No results found')); + } + } }, errorBuilder: (provider) => Center( child: Text(TextStrings().errorOccured), @@ -284,7 +276,7 @@ class _DesktopHistoryScreenState extends State } return DesktopReceivedFileDetails( - key: Key(receivedFileData!.key!), + key: Key(receivedFileData!.key), fileTransfer: receivedFileData, ); }, @@ -297,18 +289,114 @@ class _DesktopHistoryScreenState extends State } refreshHistoryScreen() async { - if (historyProvider!.status[historyProvider!.PERIODIC_REFRESH] == + if (historyProvider.status[historyProvider.PERIODIC_REFRESH] == Status.Loading) { return; } - if (historyProvider!.status[historyProvider!.SENT_HISTORY] != + if (historyProvider.status[historyProvider.SENT_HISTORY] != Status.Loading) { - await historyProvider!.getSentHistory(); + await historyProvider.getSentHistory(); } - if (historyProvider!.status[historyProvider!.RECEIVED_HISTORY] != + if (historyProvider.status[historyProvider.RECEIVED_HISTORY] != Status.Loading) { - await historyProvider!.getReceivedHistory(); + await historyProvider.getReceivedHistory(); } } + + searchHistoryField() { + return Container( + height: 50.toHeight, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(5), + color: ColorConstants.receivedSelectedTileColor, + ), + padding: EdgeInsets.fromLTRB(10, 3, 10, 5), + margin: EdgeInsets.fromLTRB(10, 3, 10, 5), + child: Row( + children: [ + Expanded( + child: TextField( + autofocus: true, + controller: _textController, + style: TextStyle(fontSize: 12), + onChanged: (String txt) { + historyProvider.setHistorySearchText = txt; + }, + decoration: InputDecoration( + border: InputBorder.none, + hintText: 'Search history by atsign'), + ), + ), + InkWell( + onTap: () { + setState(() { + _showSearchField = false; + }); + }, + child: Icon(Icons.close), + ) + ], + ), + ); + } + + Widget getReceivedTiles(List filteredReceivedList) { + return ListView.separated( + padding: EdgeInsets.only(bottom: 170.toHeight), + physics: AlwaysScrollableScrollPhysics(), + separatorBuilder: (context, index) => Divider( + indent: 16.toWidth, + ), + itemCount: filteredReceivedList.length, + itemBuilder: (context, index) => Padding( + padding: const EdgeInsets.all(8.0), + child: InkWell( + onTap: () { + receivedFileData = filteredReceivedList[index]; + + setState(() { + receivedSelectedFileId = filteredReceivedList[index].key; + }); + }, + child: DesktopReceivedFilesListTile( + key: Key(filteredReceivedList[index].key), + receivedHistory: filteredReceivedList[index], + isSelected: + receivedSelectedFileId == filteredReceivedList[index].key + ? true + : false, + ), + ), + ), + ); + } + + getSentHistory(List filteredSentHistory) { + return ListView.separated( + padding: EdgeInsets.only(bottom: 170.toHeight), + physics: AlwaysScrollableScrollPhysics(), + separatorBuilder: (context, index) { + return Divider( + indent: 16.toWidth, + ); + }, + itemCount: filteredSentHistory.length, + itemBuilder: (context, index) { + return InkWell( + onTap: () { + setState(() { + sentSelectedIndex = index; + selectedSentFileData = filteredSentHistory[index]; + }); + }, + child: DesktopSentFilesListTile( + sentHistory: filteredSentHistory[index], + key: Key(filteredSentHistory[index].fileDetails!.key), + isSelected: index == sentSelectedIndex ? true : false, + ), + ); + }, + ); + } } diff --git a/lib/screens/common_widgets/history_app_bar.dart b/lib/screens/common_widgets/history_app_bar.dart new file mode 100644 index 00000000..64255341 --- /dev/null +++ b/lib/screens/common_widgets/history_app_bar.dart @@ -0,0 +1,157 @@ +import 'dart:io'; + +import 'package:at_common_flutter/widgets/custom_input_field.dart'; +import 'package:atsign_atmosphere_pro/services/navigation_service.dart'; +import 'package:atsign_atmosphere_pro/view_models/history_provider.dart'; +import 'package:filesystem_picker/filesystem_picker.dart'; +import 'package:flutter/material.dart'; +import 'package:at_common_flutter/services/size_config.dart'; +import 'package:permission_handler/permission_handler.dart'; +import 'package:provider/provider.dart'; +import 'package:url_launcher/url_launcher.dart'; + +import '../../services/backend_service.dart'; +import '../../utils/colors.dart'; +import '../../utils/text_styles.dart'; + +class HistoryAppBar extends StatefulWidget implements PreferredSizeWidget { + final String title; + HistoryAppBar({required this.title}); + + @override + _HistoryAppBarState createState() => _HistoryAppBarState(); + + @override + Size get preferredSize => Size.fromHeight(70.toHeight); +} + +class _HistoryAppBarState extends State { + late HistoryProvider _historyProvider; + bool _showSearchField = false; + + @override + void initState() { + _historyProvider = Provider.of( + NavService.navKey.currentContext!, + listen: false); + + super.initState(); + } + + @override + void dispose() { + WidgetsBinding.instance!.addPostFrameCallback((timeStamp) { + _historyProvider.setHistorySearchText = ''; + }); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return AppBar( + elevation: 0, + centerTitle: true, + leading: IconButton( + icon: Icon( + Icons.arrow_back, + color: ColorConstants.fontPrimary, + size: 25.toFont, + ), + onPressed: () { + if (_showSearchField) { + setState(() { + _showSearchField = false; + }); + + return; + } + if (Navigator.of(context).canPop()) { + Navigator.pop(context); + } + }, + ), + title: !_showSearchField + ? Text( + widget.title, + style: CustomTextStyles.primaryBold18, + ) + : Row( + children: [ + Expanded( + child: CustomInputField( + hintText: 'Search history by atsign', + initialValue: _historyProvider.getSearchText, + icon: Icons.search, + value: (String txt) { + _historyProvider.setHistorySearchText = txt; + }, + onSubmitted: (String txt) { + _historyProvider.setHistorySearchText = txt; + }, + ), + ), + ], + ), + actions: _showSearchField + ? null + : [ + Container( + height: 22.toHeight, + width: 22.toWidth, + margin: EdgeInsets.only(right: 15), + child: IconButton( + onPressed: () { + setState(() { + _showSearchField = true; + }); + }, + icon: Icon( + Icons.search, + size: 25.toFont, + color: ColorConstants.blueText, + ), + ), + ), + Container( + height: 22.toHeight, + width: 22.toWidth, + margin: EdgeInsets.only(right: 25), + child: IconButton( + onPressed: navigateToDownloads, + icon: Icon( + Icons.save_alt_outlined, + size: 25.toFont, + color: ColorConstants.blueText, + ), + ), + ) + ], + ); + } + + navigateToDownloads() async { + // navigate to downloads folder + if (Platform.isAndroid) { + await FilesystemPicker.open( + title: 'Atmosphere download folder', + context: context, + rootDirectory: BackendService.getInstance().downloadDirectory!, + fsType: FilesystemType.all, + folderIconColor: Colors.teal, + allowedExtensions: [], + fileTileSelectMode: FileTileSelectMode.wholeTile, + requestPermission: () async => + await Permission.storage.request().isGranted, + ); + } else { + String url = 'shareddocuments://' + + BackendService.getInstance().atClientPreference.downloadPath!; + if (await canLaunch(url)) { + await launch(url); + } else { + throw 'Could not launch $url'; + } + } + } +} diff --git a/lib/screens/history/history_screen.dart b/lib/screens/history/history_screen.dart index 177bae54..6eafee0b 100644 --- a/lib/screens/history/history_screen.dart +++ b/lib/screens/history/history_screen.dart @@ -12,6 +12,8 @@ import 'package:atsign_atmosphere_pro/view_models/history_provider.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../common_widgets/history_app_bar.dart'; + class HistoryScreen extends StatefulWidget { final int tabIndex; HistoryScreen({this.tabIndex = 0}); @@ -49,13 +51,8 @@ class _HistoryScreenState extends State Widget build(BuildContext context) { return Scaffold( backgroundColor: ColorConstants.scaffoldColor, - appBar: CustomAppBar( - showBackButton: true, - showTitle: true, + appBar: HistoryAppBar( title: TextStrings().history, - showTrailingButton: true, - trailingIcon: Icons.save_alt_outlined, - isHistory: true, ), body: SingleChildScrollView( child: Container( From 60a7525a31c509d331fd30dca24a3277e4806194 Mon Sep 17 00:00:00 2001 From: Sachin Singh Date: Mon, 16 May 2022 13:09:07 +0530 Subject: [PATCH 7/9] no result message added in mobile version on history filter --- .../desktop_history/desktop_history.dart | 6 +- lib/screens/history/history_screen.dart | 85 +++++++++++-------- 2 files changed, 53 insertions(+), 38 deletions(-) diff --git a/lib/desktop_screens/desktop_history/desktop_history.dart b/lib/desktop_screens/desktop_history/desktop_history.dart index c8df960a..143c2fcd 100644 --- a/lib/desktop_screens/desktop_history/desktop_history.dart +++ b/lib/desktop_screens/desktop_history/desktop_history.dart @@ -157,7 +157,7 @@ class _DesktopHistoryScreenState extends State controller: _controller, children: [ ProviderHandler( - functionName: historyProvider!.SENT_HISTORY, + functionName: historyProvider.SENT_HISTORY, showError: false, successBuilder: (provider) { if ((provider.sentHistory.isEmpty)) { @@ -183,7 +183,7 @@ class _DesktopHistoryScreenState extends State return getSentHistory(filteredSentHistory); } else { return Center( - child: Text('No results found.'), + child: Text('No results found'), ); } } @@ -196,7 +196,7 @@ class _DesktopHistoryScreenState extends State }, ), ProviderHandler( - functionName: historyProvider!.RECEIVED_HISTORY, + functionName: historyProvider.RECEIVED_HISTORY, load: (provider) async { await provider.getReceivedHistory(); }, diff --git a/lib/screens/history/history_screen.dart b/lib/screens/history/history_screen.dart index 6eafee0b..53364a92 100644 --- a/lib/screens/history/history_screen.dart +++ b/lib/screens/history/history_screen.dart @@ -139,24 +139,13 @@ class _HistoryScreenState extends State } }); - return ListView.separated( - padding: EdgeInsets.only(bottom: 170.toHeight), - physics: AlwaysScrollableScrollPhysics(), - separatorBuilder: (context, index) { - return Divider( - indent: 16.toWidth, - ); - }, - itemCount: filteredSentHistory.length, - itemBuilder: (context, index) { - return SentFilesListTile( - sentHistory: filteredSentHistory[index], - key: Key(filteredSentHistory[index] - .fileDetails! - .key), - ); - }, - ); + if (filteredSentHistory.isNotEmpty) { + return getSentList(filteredSentHistory); + } else { + return Center( + child: Text('No results found'), + ); + } } }, errorBuilder: (provider) => ListView.separated( @@ -231,23 +220,13 @@ class _HistoryScreenState extends State } }); - return ListView.separated( - padding: EdgeInsets.only(bottom: 170.toHeight), - physics: AlwaysScrollableScrollPhysics(), - separatorBuilder: (context, index) => - Divider(indent: 16.toWidth), - itemCount: filteredReceivedList.length, - itemBuilder: (context, index) => Padding( - padding: const EdgeInsets.all(8.0), - child: ReceivedFilesListTile( - key: Key(filteredReceivedList[index].key), - receivedHistory: - filteredReceivedList[index], - isWidgetOpen: filteredReceivedList[index] - .isWidgetOpen, - ), - ), - ); + if (filteredReceivedList.isNotEmpty) { + return getReceivedList(filteredReceivedList); + } else { + return Center( + child: Text('No results found'), + ); + } } }, errorBuilder: (provider) => ListView.separated( @@ -283,4 +262,40 @@ class _HistoryScreenState extends State ), ); } + + Widget getSentList(List filteredSentHistory) { + return ListView.separated( + padding: EdgeInsets.only(bottom: 170.toHeight), + physics: AlwaysScrollableScrollPhysics(), + separatorBuilder: (context, index) { + return Divider( + indent: 16.toWidth, + ); + }, + itemCount: filteredSentHistory.length, + itemBuilder: (context, index) { + return SentFilesListTile( + sentHistory: filteredSentHistory[index], + key: Key(filteredSentHistory[index].fileDetails!.key), + ); + }, + ); + } + + Widget getReceivedList(List filteredReceivedList) { + return ListView.separated( + padding: EdgeInsets.only(bottom: 170.toHeight), + physics: AlwaysScrollableScrollPhysics(), + separatorBuilder: (context, index) => Divider(indent: 16.toWidth), + itemCount: filteredReceivedList.length, + itemBuilder: (context, index) => Padding( + padding: const EdgeInsets.all(8.0), + child: ReceivedFilesListTile( + key: Key(filteredReceivedList[index].key), + receivedHistory: filteredReceivedList[index], + isWidgetOpen: filteredReceivedList[index].isWidgetOpen, + ), + ), + ); + } } From 7cb50a289a20cfb72a8c53cc7823f7fa164c523c Mon Sep 17 00:00:00 2001 From: Gayathri-GA Date: Wed, 18 May 2022 13:29:34 +0530 Subject: [PATCH 8/9] Fixed sidebar font overlap issue --- lib/screens/common_widgets/side_bar_list_item.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/screens/common_widgets/side_bar_list_item.dart b/lib/screens/common_widgets/side_bar_list_item.dart index d44569b4..6846334f 100644 --- a/lib/screens/common_widgets/side_bar_list_item.dart +++ b/lib/screens/common_widgets/side_bar_list_item.dart @@ -80,7 +80,7 @@ class SideBarItem extends StatelessWidget { style: TextStyle( color: displayColor, letterSpacing: 0.1, - fontSize: 14.toFont, + fontSize: 13.toFont, fontWeight: FontWeight.normal, ), ), From 7739aee3be342091b5e5bd7c396e7a2da329e77c Mon Sep 17 00:00:00 2001 From: Sarika Gautam Date: Wed, 18 May 2022 19:41:14 +0530 Subject: [PATCH 9/9] release changes for ios, android and macos for 1.0.7.41 --- ios/Podfile | 2 +- ios/Podfile.lock | 22 ++-- ios/Runner.xcodeproj/project.pbxproj | 142 ++++++++++++------------ ios/Runner/Info.plist | 2 + linux/flutter/generated_plugins.cmake | 8 ++ macos/Podfile.lock | 2 +- macos/Runner.xcodeproj/project.pbxproj | 26 +++-- pubspec.lock | 70 ++++++------ pubspec.yaml | 29 +++-- windows/flutter/generated_plugins.cmake | 8 ++ 10 files changed, 168 insertions(+), 143 deletions(-) diff --git a/ios/Podfile b/ios/Podfile index 628e431f..c1660a44 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -platform :ios, '9.0' +platform :ios, '10.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 22b642e5..274f3a26 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -9,14 +9,14 @@ PODS: - Flutter - biometric_storage (0.0.1): - Flutter - - DKImagePickerController/Core (4.3.2): + - DKImagePickerController/Core (4.3.3): - DKImagePickerController/ImageDataManager - DKImagePickerController/Resource - - DKImagePickerController/ImageDataManager (4.3.2) - - DKImagePickerController/PhotoGallery (4.3.2): + - DKImagePickerController/ImageDataManager (4.3.3) + - DKImagePickerController/PhotoGallery (4.3.3): - DKImagePickerController/Core - DKPhotoGallery - - DKImagePickerController/Resource (4.3.2) + - DKImagePickerController/Resource (4.3.3) - DKPhotoGallery (0.0.17): - DKPhotoGallery/Core (= 0.0.17) - DKPhotoGallery/Model (= 0.0.17) @@ -84,9 +84,9 @@ PODS: - Flutter - receive_sharing_intent (0.0.1): - Flutter - - SDWebImage (5.12.3): - - SDWebImage/Core (= 5.12.3) - - SDWebImage/Core (5.12.3) + - SDWebImage (5.12.5): + - SDWebImage/Core (= 5.12.5) + - SDWebImage/Core (5.12.5) - SDWebImageWebPCoder (0.8.4): - libwebp (~> 1.0) - SDWebImage/Core (~> 5.10) @@ -202,7 +202,7 @@ SPEC CHECKSUMS: at_contacts_group_flutter: 31bc718fdb2baca1ae36509009e48cf33a23fa5f at_onboarding_flutter: e8219b6d0bfb236d3837ec3528871aebdcc56e8d biometric_storage: 1400f1382af3a4cc2bf05340e13c3d8de873ceb9 - DKImagePickerController: b5eb7f7a388e4643264105d648d01f727110fc3d + DKImagePickerController: 72fd378f244cef3d27288e0aebf217a4467e4012 DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179 emoji_picker_flutter: df19dac03a2b39ac667dc8d1da939ef3a9e21347 file_picker: 3e6c3790de664ccf9b882732d9db5eaf6b8d4eb1 @@ -220,7 +220,7 @@ SPEC CHECKSUMS: path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02 permission_handler_apple: d21b38e1a4b2e041c63af9568f9165e114e507a6 receive_sharing_intent: c0d87310754e74c0f9542947e7cbdf3a0335a3b1 - SDWebImage: 53179a2dba77246efa8a9b85f5c5b21f8f43e38f + SDWebImage: 0905f1b7760fc8ac4198cae0036600d67478751e SDWebImageWebPCoder: f93010f3f6c031e2f8fb3081ca4ee6966c539815 share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68 shared_preferences_ios: 548a61f8053b9b8a49ac19c1ffbc8b92c50d68ad @@ -231,6 +231,6 @@ SPEC CHECKSUMS: video_thumbnail: c4e2a3c539e247d4de13cd545344fd2d26ffafd1 webview_flutter_wkwebview: 005fbd90c888a42c5690919a1527ecc6649e1162 -PODFILE CHECKSUM: be3641bcaef7a85afc04e2ed523c1b5ffa98afbe +PODFILE CHECKSUM: 72ac8371f55bd4afc2c8dc48c11ae0f045736f0f -COCOAPODS: 1.11.2 +COCOAPODS: 1.11.3 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 6cd8e021..f1bf1c49 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -10,10 +10,10 @@ 03729451251A04200081BDCF /* ShareViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03729450251A04200081BDCF /* ShareViewController.swift */; }; 03729454251A04200081BDCF /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 03729452251A04200081BDCF /* MainInterface.storyboard */; }; 03729458251A04200081BDCF /* @mosphere-pro.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 0372944E251A04200081BDCF /* @mosphere-pro.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + 0BDCBEE0D322301A1EF0869E /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B1C35B7369486DE1AB7F3C72 /* Pods_Runner.framework */; }; 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; - 97B079801633C6347D796F05 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52C2B57170D4C9CB7419F66D /* Pods_Runner.framework */; }; 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 */; }; @@ -62,14 +62,13 @@ 0372945F251A087A0081BDCF /* Share Extension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Share Extension.entitlements"; sourceTree = ""; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 24B4351BBBB55CF548320BEC /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 4E6CDF214BF667F301172F71 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; - 52C2B57170D4C9CB7419F66D /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 4F69A74C18BAFFE4AEA79529 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 655888FAAB2B85959C2880D1 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 7DEC98A4997FB097A739362A /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 8236931B8D27443DDF5E8751 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -77,6 +76,7 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + B1C35B7369486DE1AB7F3C72 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -91,7 +91,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 97B079801633C6347D796F05 /* Pods_Runner.framework in Frameworks */, + 0BDCBEE0D322301A1EF0869E /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -109,6 +109,14 @@ path = "Share Extension"; sourceTree = ""; }; + 75DCE734B469EA1865970A11 /* Frameworks */ = { + isa = PBXGroup; + children = ( + B1C35B7369486DE1AB7F3C72 /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -123,9 +131,9 @@ 978D8E3BA80D7D0BD7F4B6D7 /* Pods */ = { isa = PBXGroup; children = ( - 7DEC98A4997FB097A739362A /* Pods-Runner.debug.xcconfig */, - 4E6CDF214BF667F301172F71 /* Pods-Runner.release.xcconfig */, - 24B4351BBBB55CF548320BEC /* Pods-Runner.profile.xcconfig */, + 4F69A74C18BAFFE4AEA79529 /* Pods-Runner.debug.xcconfig */, + 655888FAAB2B85959C2880D1 /* Pods-Runner.release.xcconfig */, + 8236931B8D27443DDF5E8751 /* Pods-Runner.profile.xcconfig */, ); path = Pods; sourceTree = ""; @@ -138,7 +146,7 @@ 0372944F251A04200081BDCF /* Share Extension */, 97C146EF1CF9000F007C117D /* Products */, 978D8E3BA80D7D0BD7F4B6D7 /* Pods */, - C9673C53BF27FF4AC9E7E2F1 /* Frameworks */, + 75DCE734B469EA1865970A11 /* Frameworks */, ); sourceTree = ""; }; @@ -167,14 +175,6 @@ path = Runner; sourceTree = ""; }; - C9673C53BF27FF4AC9E7E2F1 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 52C2B57170D4C9CB7419F66D /* Pods_Runner.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -199,7 +199,7 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - 6C44FCF2CEBEE96738928FE0 /* [CP] Check Pods Manifest.lock */, + CF87B4D9A3D8128EF27369B4 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, @@ -207,7 +207,7 @@ 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 03729459251A04200081BDCF /* Embed App Extensions */, - A4F0BDB8BB5744219B7D1B73 /* [CP] Embed Pods Frameworks */, + CDE842460B64DBF139B1781B /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -294,57 +294,57 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; - 6C44FCF2CEBEE96738928FE0 /* [CP] Check Pods Manifest.lock */ = { + 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); - inputFileListPaths = ( - ); inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( ); + name = "Run Script"; outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - 9740EEB61CF901F6004384FC /* Run Script */ = { + CDE842460B64DBF139B1781B /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); - inputPaths = ( + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - name = "Run Script"; - outputPaths = ( + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; }; - A4F0BDB8BB5744219B7D1B73 /* [CP] Embed Pods Frameworks */ = { + CF87B4D9A3D8128EF27369B4 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Embed Pods Frameworks"; + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -415,17 +415,17 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_ENTITLEMENTS = "Share Extension/Share Extension.entitlements"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 40; + CURRENT_PROJECT_VERSION = 41; DEVELOPMENT_TEAM = 5XUSS6C2DF; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "Share Extension/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.6; + MARKETING_VERSION = 1.0.7; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.atsign.atmosphere-pro.ShareExtension"; @@ -448,17 +448,17 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_ENTITLEMENTS = "Share Extension/Share Extension.entitlements"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 40; + CURRENT_PROJECT_VERSION = 41; DEVELOPMENT_TEAM = 5XUSS6C2DF; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "Share Extension/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.6; + MARKETING_VERSION = 1.0.7; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.atsign.atmosphere-pro.ShareExtension"; PRODUCT_NAME = "@mosphere-pro"; @@ -478,17 +478,17 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_ENTITLEMENTS = "Share Extension/Share Extension.entitlements"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 40; + CURRENT_PROJECT_VERSION = 41; DEVELOPMENT_TEAM = 5XUSS6C2DF; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "Share Extension/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.6; + MARKETING_VERSION = 1.0.7; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.atsign.atmosphere-pro.ShareExtension"; PRODUCT_NAME = "@mosphere-pro"; @@ -543,6 +543,8 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -556,9 +558,9 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CODE_SIGN_IDENTITY = "iPhone Developer"; - CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 40; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 41; DEVELOPMENT_TEAM = 5XUSS6C2DF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -566,7 +568,7 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -575,10 +577,10 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 1.0.6; + MARKETING_VERSION = 1.0.7; PRODUCT_BUNDLE_IDENTIFIER = "com.atsign.atmosphere-pro"; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = "Atmosphere Pro dev provision profile"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -637,6 +639,8 @@ MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -688,6 +692,7 @@ SUPPORTED_PLATFORMS = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -701,9 +706,9 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CODE_SIGN_IDENTITY = "iPhone Developer"; - CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 40; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 41; DEVELOPMENT_TEAM = 5XUSS6C2DF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -711,7 +716,7 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -720,10 +725,10 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 1.0.6; + MARKETING_VERSION = 1.0.7; PRODUCT_BUNDLE_IDENTIFIER = "com.atsign.atmosphere-pro"; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = "Atmosphere Pro dev provision profile"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; @@ -740,9 +745,9 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CODE_SIGN_IDENTITY = "iPhone Developer"; - CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 40; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 41; DEVELOPMENT_TEAM = 5XUSS6C2DF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -750,7 +755,7 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -759,10 +764,11 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 1.0.6; + MARKETING_VERSION = 1.0.7; PRODUCT_BUNDLE_IDENTIFIER = "com.atsign.atmosphere-pro"; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = "Atmosphere Pro dev provision profile"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 126e44dc..eacd2e09 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -2,6 +2,8 @@ + CADisableMinimumFrameDurationOnPhone + CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleExecutable diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index 8948d8c2..f3fc1738 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -11,6 +11,9 @@ list(APPEND FLUTTER_PLUGIN_LIST url_launcher_linux ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -19,3 +22,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/macos/Podfile.lock b/macos/Podfile.lock index e8e0eb33..6b4ea507 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -91,4 +91,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c -COCOAPODS: 1.11.2 +COCOAPODS: 1.11.3 diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 141cbf63..f3aaf887 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -210,7 +210,6 @@ 33CC10EC2044A3C60003C045 = { CreatedOnToolsVersion = 9.2; LastSwiftMigration = 1100; - ProvisioningStyle = Automatic; SystemCapabilities = { com.apple.Sandbox = { enabled = 1; @@ -410,6 +409,7 @@ SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_VERSION = 5.0; }; name = Profile; }; @@ -421,9 +421,9 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Automatic; + CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 40; + CURRENT_PROJECT_VERSION = 41; DEVELOPMENT_TEAM = 5XUSS6C2DF; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = Runner/Info.plist; @@ -432,7 +432,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.11; - MARKETING_VERSION = 1.0.6; + MARKETING_VERSION = 1.0.7; PRODUCT_BUNDLE_IDENTIFIER = "com.atsign.atmosphere-pro"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 5.0; @@ -497,6 +497,7 @@ SDKROOT = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -543,6 +544,7 @@ SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -554,9 +556,9 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/atsign_atmosphere_proDebug.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Automatic; + CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 40; + CURRENT_PROJECT_VERSION = 41; DEVELOPMENT_TEAM = 5XUSS6C2DF; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = Runner/Info.plist; @@ -565,7 +567,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.11; - MARKETING_VERSION = 1.0.6; + MARKETING_VERSION = 1.0.7; PRODUCT_BUNDLE_IDENTIFIER = "com.atsign.atmosphere-pro"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -580,10 +582,10 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; - CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Automatic; + CODE_SIGN_IDENTITY = "Mac Developer"; + CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 40; + CURRENT_PROJECT_VERSION = 41; DEVELOPMENT_TEAM = 5XUSS6C2DF; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = Runner/Info.plist; @@ -592,9 +594,9 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.11; - MARKETING_VERSION = 1.0.6; + MARKETING_VERSION = 1.0.7; PRODUCT_BUNDLE_IDENTIFIER = "com.atsign.atmosphere-pro"; - PROVISIONING_PROFILE_SPECIFIER = ""; + PROVISIONING_PROFILE_SPECIFIER = "Atmosphere Pro Mac Provision Profile"; SWIFT_VERSION = 5.0; }; name = Release; diff --git a/pubspec.lock b/pubspec.lock index 16ee0bbd..8ae34964 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,14 +7,14 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "31.0.0" + version: "40.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "2.8.0" + version: "4.1.0" archive: dependency: "direct main" description: @@ -58,27 +58,25 @@ packages: source: hosted version: "1.0.0" at_client: - dependency: "direct overridden" + dependency: transitive description: - path: at_client - ref: get_keys_bugfix - resolved-ref: c1d1311589eb6b756f447d62c5a83cb8ee34441b - url: "https://github.com/atsign-foundation/at_client_sdk" - source: git - version: "3.0.21" + name: at_client + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.23" at_client_mobile: dependency: "direct main" description: name: at_client_mobile url: "https://pub.dartlang.org" source: hosted - version: "3.1.13" + version: "3.1.15" at_common_flutter: dependency: "direct main" description: path: at_common_flutter - ref: "fix/missing-fontweight" - resolved-ref: da2090e4fd06567e872f4b5ee791d239642852fe + ref: trunk + resolved-ref: a30bad49fd2825865b9545dd080081b5c0641e65 url: "https://github.com/atsign-foundation/at_widgets" source: git version: "2.0.7" @@ -100,20 +98,20 @@ packages: dependency: "direct main" description: path: at_contacts_flutter - ref: "feat/598" - resolved-ref: a4ecda2faf1ffb8d7855aafaa09e129dbac8825f + ref: trunk + resolved-ref: a30bad49fd2825865b9545dd080081b5c0641e65 url: "https://github.com/atsign-foundation/at_widgets" source: git - version: "4.0.3" + version: "4.0.4" at_contacts_group_flutter: dependency: "direct main" description: path: at_contacts_group_flutter - ref: "feat/598" - resolved-ref: a4ecda2faf1ffb8d7855aafaa09e129dbac8825f + ref: trunk + resolved-ref: a30bad49fd2825865b9545dd080081b5c0641e65 url: "https://github.com/atsign-foundation/at_widgets" source: git - version: "4.0.3" + version: "4.0.4" at_lookup: dependency: transitive description: @@ -125,8 +123,8 @@ packages: dependency: "direct main" description: path: at_onboarding_flutter - ref: "fix/missing-fontweight" - resolved-ref: da2090e4fd06567e872f4b5ee791d239642852fe + ref: trunk + resolved-ref: a30bad49fd2825865b9545dd080081b5c0641e65 url: "https://github.com/atsign-foundation/at_widgets" source: git version: "4.0.2" @@ -234,7 +232,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" convert: dependency: transitive description: @@ -332,7 +330,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" ffi: dependency: transitive description: @@ -355,11 +353,13 @@ packages: source: hosted version: "4.5.1" file_saver: - dependency: transitive + dependency: "direct overridden" description: - name: file_saver - url: "https://pub.dartlang.org" - source: hosted + path: "." + ref: main + resolved-ref: "877b25c6088491037be79e426a7c9c1598d17142" + url: "https://github.com/incrediblezayed/file_saver.git" + source: git version: "0.1.0" file_selector: dependency: "direct main" @@ -592,7 +592,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.4" lints: dependency: transitive description: @@ -627,7 +627,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -746,7 +746,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" path_provider: dependency: transitive description: @@ -1080,7 +1080,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -1115,21 +1115,21 @@ packages: name: test url: "https://pub.dartlang.org" source: hosted - version: "1.19.5" + version: "1.21.1" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" + version: "0.4.9" test_core: dependency: transitive description: name: test_core url: "https://pub.dartlang.org" source: hosted - version: "0.4.9" + version: "0.4.13" timezone: dependency: transitive description: @@ -1213,7 +1213,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" video_compress: dependency: "direct main" description: @@ -1320,5 +1320,5 @@ packages: source: hosted version: "0.1.0" sdks: - dart: ">=2.16.0 <3.0.0" + dart: ">=2.17.0-0 <3.0.0" flutter: ">=2.10.0" diff --git a/pubspec.yaml b/pubspec.yaml index 37e606df..f55263b1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,7 +17,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # Mobile version -version: 1.0.6+40 +version: 1.0.7+41 # Desktop version macos # version: 1.0.1+19 @@ -65,42 +65,41 @@ dependencies: at_commons: ^3.0.14 at_contact: ^3.0.5 - at_common_flutter: ^2.0.6 + at_common_flutter: ^2.0.7 - at_client_mobile: ^3.1.13 - at_onboarding_flutter: ^4.0.1 + at_client_mobile: ^3.1.15 + at_onboarding_flutter: ^4.0.2 at_backupkey_flutter: ^4.0.1 - at_contacts_flutter: ^4.0.3 - at_contacts_group_flutter: ^4.0.3 + at_contacts_flutter: ^4.0.4 + at_contacts_group_flutter: ^4.0.4 local_notifier: ^0.1.1 at_sync_ui_flutter: ^1.0.2 dependency_overrides: - at_client: - git: - url: https://github.com/atsign-foundation/at_client_sdk - ref: get_keys_bugfix - path: at_client at_contacts_flutter: git: url: https://github.com/atsign-foundation/at_widgets - ref: feat/598 + ref: trunk path: at_contacts_flutter at_common_flutter: git: url: https://github.com/atsign-foundation/at_widgets - ref: fix/missing-fontweight + ref: trunk path: at_common_flutter at_onboarding_flutter: git: url: https://github.com/atsign-foundation/at_widgets - ref: fix/missing-fontweight + ref: trunk path: at_onboarding_flutter at_contacts_group_flutter: git: url: https://github.com/atsign-foundation/at_widgets - ref: feat/598 + ref: trunk path: at_contacts_group_flutter + file_saver: + git: + url: https://github.com/incrediblezayed/file_saver.git + ref: main dev_dependencies: flutter_test: diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 8c98f746..6cbff421 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -11,6 +11,9 @@ list(APPEND FLUTTER_PLUGIN_LIST url_launcher_windows ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -19,3 +22,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin)