diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 2459d853..9ceeaa2f 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -23,7 +23,7 @@ android:icon="@mipmap/ic_launcher"> CFBundleVersion 1.0 MinimumOSVersion - 9.0 + 13.0 diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 18b6777e..17eac80f 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -57,8 +57,6 @@ PODS: - Flutter - flutter_local_notifications (0.0.1): - Flutter - - flutter_qr_reader (0.0.1): - - Flutter - fluttertoast (0.0.2): - Flutter - Toast @@ -123,7 +121,6 @@ DEPENDENCIES: - flutter_image_compress (from `.symlinks/plugins/flutter_image_compress/ios`) - flutter_keychain (from `.symlinks/plugins/flutter_keychain/ios`) - flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`) - - flutter_qr_reader (from `.symlinks/plugins/flutter_qr_reader/ios`) - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`) - open_file (from `.symlinks/plugins/open_file/ios`) - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) @@ -175,8 +172,6 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/flutter_keychain/ios" flutter_local_notifications: :path: ".symlinks/plugins/flutter_local_notifications/ios" - flutter_qr_reader: - :path: ".symlinks/plugins/flutter_qr_reader/ios" fluttertoast: :path: ".symlinks/plugins/fluttertoast/ios" open_file: @@ -215,11 +210,10 @@ SPEC CHECKSUMS: DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179 emoji_picker_flutter: df19dac03a2b39ac667dc8d1da939ef3a9e21347 file_picker: 817ab1d8cd2da9d2da412a417162deee3500fc95 - Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a + Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 flutter_image_compress: 5a5e9aee05b6553048b8df1c3bc456d0afaac433 flutter_keychain: 01aabf894ffe8b01adfda1d9df21c210c1b4b452 flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743 - flutter_qr_reader: d930dde3b2cfe2b3d0bb7d66e5ff3e514300a5e5 fluttertoast: 16fbe6039d06a763f3533670197d01fc73459037 libwebp: 98a37e597e40bfdb4c911fc98f2c53d0b12d05fc Mantle: c5aa8794a29a022dfbbfc9799af95f477a69b62d @@ -241,6 +235,6 @@ SPEC CHECKSUMS: video_thumbnail: c4e2a3c539e247d4de13cd545344fd2d26ffafd1 webview_flutter_wkwebview: b7e70ef1ddded7e69c796c7390ee74180182971f -PODFILE CHECKSUM: db8a7794fb1b0bee1e3803fed876c7cf9577099b +PODFILE CHECKSUM: db1b3d34103b9bca35e1d0bca266af8024bec0bc COCOAPODS: 1.11.3 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index fc1e35ee..269ef122 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -415,7 +415,7 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_ENTITLEMENTS = "Share Extension/Share Extension.entitlements"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 48; + CURRENT_PROJECT_VERSION = 49; DEVELOPMENT_TEAM = 5XUSS6C2DF; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "Share Extension/Info.plist"; @@ -448,7 +448,7 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_ENTITLEMENTS = "Share Extension/Share Extension.entitlements"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 48; + CURRENT_PROJECT_VERSION = 49; DEVELOPMENT_TEAM = 5XUSS6C2DF; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "Share Extension/Info.plist"; @@ -478,7 +478,7 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_ENTITLEMENTS = "Share Extension/Share Extension.entitlements"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 48; + CURRENT_PROJECT_VERSION = 49; DEVELOPMENT_TEAM = 5XUSS6C2DF; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "Share Extension/Info.plist"; @@ -560,7 +560,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 48; + CURRENT_PROJECT_VERSION = 49; DEVELOPMENT_TEAM = 5XUSS6C2DF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -708,7 +708,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 48; + CURRENT_PROJECT_VERSION = 49; DEVELOPMENT_TEAM = 5XUSS6C2DF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -747,7 +747,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 48; + CURRENT_PROJECT_VERSION = 49; DEVELOPMENT_TEAM = 5XUSS6C2DF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( diff --git a/lib/app.dart b/lib/app.dart index b553c55c..86a75545 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -14,6 +14,7 @@ import 'package:atsign_atmosphere_pro/view_models/file_transfer_provider.dart'; import 'package:atsign_atmosphere_pro/view_models/history_provider.dart'; import 'dart:io'; import 'routes/routes.dart'; +import 'utils/colors.dart'; class MyApp extends StatefulWidget { MyApp({Key? key}) : super(key: key); @@ -79,17 +80,26 @@ class _MyAppState extends State { initialRoute: initialRoute, navigatorKey: NavService.navKey, theme: ThemeData( - fontFamily: 'Inter', - scaffoldBackgroundColor: Colors.white, - primaryColor: Color.fromARGB(255, 240, 94, 62), - appBarTheme: AppBarTheme( - color: Colors.white, - elevation: 0, - iconTheme: IconThemeData(color: Colors.black), - ), - buttonBarTheme: ButtonBarThemeData( - alignment: MainAxisAlignment.center, - )), + fontFamily: 'Inter', + scaffoldBackgroundColor: Colors.white, + primaryColor: Color.fromARGB(255, 240, 94, 62), + appBarTheme: AppBarTheme( + color: Colors.white, + elevation: 0, + iconTheme: IconThemeData(color: Colors.black), + ), + buttonBarTheme: ButtonBarThemeData( + alignment: MainAxisAlignment.center, + ), + scrollbarTheme: ScrollbarThemeData( + minThumbLength: 330, + radius: Radius.circular(11), + thumbColor: MaterialStateProperty.all(ColorConstants.mildGrey), + trackColor: MaterialStateProperty.all(ColorConstants.textBoxBg), + mainAxisMargin: 18, + trackBorderColor: MaterialStateProperty.all(Colors.transparent), + ), + ), routes: routes, ), ); diff --git a/lib/desktop_screens/desktop_history/widgets/desktop_received_file_list_tile.dart b/lib/desktop_screens/desktop_history/widgets/desktop_received_file_list_tile.dart index ae98b179..e1d02530 100644 --- a/lib/desktop_screens/desktop_history/widgets/desktop_received_file_list_tile.dart +++ b/lib/desktop_screens/desktop_history/widgets/desktop_received_file_list_tile.dart @@ -637,7 +637,13 @@ class _DesktopReceivedFilesListTileState ? ImageConstants.exelLogo : FileTypes.TEXT_TYPES.contains(extension) ? ImageConstants.txtLogo - : ImageConstants.unknownLogo, + : FileTypes.ARCHIVE_TYPES + .contains(extension) + ? ImageConstants.archiveLogo + : FileTypes.WEB_IMAGE_TYPES + .contains(extension) + ? ImageConstants.svgLogo + : ImageConstants.otherFileLogo, fit: BoxFit.cover, ), ), diff --git a/lib/desktop_screens/desktop_history/widgets/desktop_sent_file_list_tile.dart b/lib/desktop_screens/desktop_history/widgets/desktop_sent_file_list_tile.dart index 312d6578..3c4e99f7 100644 --- a/lib/desktop_screens/desktop_history/widgets/desktop_sent_file_list_tile.dart +++ b/lib/desktop_screens/desktop_history/widgets/desktop_sent_file_list_tile.dart @@ -564,7 +564,13 @@ class _DesktopSentFilesListTileState extends State { ? ImageConstants.exelLogo : FileTypes.TEXT_TYPES.contains(extension) ? ImageConstants.txtLogo - : ImageConstants.unknownLogo, + : FileTypes.ARCHIVE_TYPES + .contains(extension) + ? ImageConstants.archiveLogo + : FileTypes.WEB_IMAGE_TYPES + .contains(extension) + ? ImageConstants.svgLogo + : ImageConstants.otherFileLogo, fit: BoxFit.cover, ), ), diff --git a/lib/screens/common_widgets/add_contact.dart b/lib/screens/common_widgets/add_contact.dart index 947877ca..90b59b0f 100644 --- a/lib/screens/common_widgets/add_contact.dart +++ b/lib/screens/common_widgets/add_contact.dart @@ -48,7 +48,8 @@ class _AddContactState extends State { ) ], ), - content: ConstrainedBox( + content: Container( + width: 495, constraints: BoxConstraints( maxHeight: (widget.name != null) ? 190.toHeight : 150.toHeight, ), @@ -106,15 +107,18 @@ class _AddContactState extends State { height: 10.toHeight, ), isContactAdding - ? Center( - child: CircularProgressIndicator(), + ? Container( + padding: EdgeInsets.all(32), + child: Center( + child: CircularProgressIndicator(), + ), ) : Container( alignment: Alignment.center, child: SizedBox( width: (Platform.isAndroid || Platform.isIOS) ? SizeConfig().screenWidth - : 150.toWidth, + : 150, child: CustomButton( buttonText: 'Yes', fontColor: Colors.white, @@ -144,7 +148,7 @@ class _AddContactState extends State { child: SizedBox( width: (Platform.isAndroid || Platform.isIOS) ? SizeConfig().screenWidth - : 150.toWidth, + : 150, child: CustomButton( buttonColor: Colors.white, buttonText: 'No', @@ -153,6 +157,9 @@ class _AddContactState extends State { }, )), ), + SizedBox( + height: 10.toHeight, + ), ], ), ); diff --git a/lib/screens/common_widgets/app_bar.dart b/lib/screens/common_widgets/app_bar.dart index b2721275..80de05ed 100644 --- a/lib/screens/common_widgets/app_bar.dart +++ b/lib/screens/common_widgets/app_bar.dart @@ -36,6 +36,7 @@ class CustomAppBar extends StatefulWidget implements PreferredSizeWidget { final onActionpressed; final bool isTrustedContactScreen; final double elevation; + final int? badgeNumber; const CustomAppBar( {Key? key, this.title, @@ -49,11 +50,12 @@ class CustomAppBar extends StatefulWidget implements PreferredSizeWidget { this.isHistory = false, this.elevation = 0, this.onActionpressed, - this.isTrustedContactScreen = false}) + this.isTrustedContactScreen = false, + this.badgeNumber}) : super(key: key); @override - Size get preferredSize => Size.fromHeight(70.toHeight); + Size get preferredSize => Size.fromHeight(110.toHeight); @override _CustomAppBarState createState() => _CustomAppBarState(); @@ -62,139 +64,156 @@ class CustomAppBar extends StatefulWidget implements PreferredSizeWidget { class _CustomAppBarState extends State { @override Widget build(BuildContext context) { - return AppBar( - elevation: widget.elevation, - centerTitle: false, - leading: (widget.showLeadingicon) - ? Image.asset(ImageConstants.logoIcon) - : (widget.showBackButton) - ? IconButton( - icon: Icon( - Icons.arrow_back, - color: ColorConstants.fontPrimary, - size: 25.toFont, - ), - onPressed: () { - if (Navigator.of(context).canPop()) { - Navigator.pop(context); - } - }) - : null, - title: Row( - children: [ - Container( - height: 40.toHeight, - margin: EdgeInsets.only(top: 5.toHeight), - child: (!widget.showBackButton && - !widget.showLeadingicon && - widget.showClosedBtnText) - ? Center( - child: GestureDetector( - child: Text( - TextStrings().buttonClose, - style: CustomTextStyles.blueRegular18, - ), - onTap: () { - if (Navigator.of(context).canPop()) { - Navigator.pop(context); - } - }, + return Padding( + padding: EdgeInsets.only(top: 40.toHeight), + child: AppBar( + elevation: widget.elevation, + centerTitle: true, + leadingWidth: 78.toWidth, + leading: (widget.showLeadingicon) + ? Padding( + padding: EdgeInsets.only(left: 38.toWidth), + child: Image.asset(ImageConstants.logoIcon), + ) + : (widget.showBackButton) + ? IconButton( + icon: Icon( + Icons.arrow_back, + color: ColorConstants.fontPrimary, + size: 25.toFont, ), - ) - : Container(), - ), - Expanded( - child: (widget.showTitle) + onPressed: () { + if (Navigator.of(context).canPop()) { + Navigator.pop(context); + } + }) + : null, + title: Row( + children: [ + Container( + height: 40.toHeight, + margin: EdgeInsets.only(top: 5.toHeight), + child: (!widget.showBackButton && + !widget.showLeadingicon && + widget.showClosedBtnText) + ? Center( + child: GestureDetector( + child: Text( + TextStrings().buttonClose, + style: CustomTextStyles.blueRegular18, + ), + onTap: () { + if (Navigator.of(context).canPop()) { + Navigator.pop(context); + } + }, + ), + ) + : Container(), + ), + widget.showTitle ? Text( widget.title!, - style: CustomTextStyles.blackBold25, + style: CustomTextStyles.primaryBold25, ) : Container(), - ), + widget.badgeNumber != null + ? Padding( + padding: EdgeInsets.only(left: 12.toWidth), + child: Text( + '${widget.badgeNumber ?? 0}', + style: CustomTextStyles.primaryBold15, + ), + ) + : Container(), + ], + ), + actions: [ + Container( + height: 40.toWidth, + width: 40.toWidth, + margin: EdgeInsets.only(right: 30.toWidth, top: 8.5, bottom: 8.5), + child: (widget.showTitle) + ? ((widget.showTrailingButton) + ? widget.showMenu + ? menuBar(context) + : Container( + child: IconButton( + icon: Icon( + widget.trailingIcon, + size: 25.toFont, + color: ColorConstants.blueText, + ), + onPressed: () async { + if (widget.isHistory) { + // 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'; + } + } + } else if (widget.isTrustedContactScreen) { + await Navigator.push( + context, + MaterialPageRoute( + builder: (context) => ContactsScreen( + asSelectionScreen: true, + selectedContactsHistory: [], + selectedList: (s) async { + for (var element in s) { + await Provider.of< + TrustedContactProvider>( + context, + listen: false) + .addTrustedContacts(element!); + } + }, + ), + ), + ); + } else { + await showDialog( + context: context, + barrierDismissible: true, + builder: (context) => AddContactDialog( + // onYesTap: (value) { + // onActionpressed(value); + // }, + ), + ); + } + }), + ) + : Container()) + : menuBar(context), + ) ], + automaticallyImplyLeading: false, + backgroundColor: ColorConstants.appBarColor, ), - actions: [ - Container( - height: 22.toHeight, - width: 22.toWidth, - margin: EdgeInsets.only(right: 30), - child: (widget.showTitle) - ? ((widget.showTrailingButton) - ? widget.showMenu - ? menuBar(context) - : IconButton( - icon: Icon( - widget.trailingIcon, - size: 25.toFont, - color: ColorConstants.blueText, - ), - onPressed: () async { - if (widget.isHistory) { - // 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'; - } - } - } else if (widget.isTrustedContactScreen) { - await Navigator.push( - context, - MaterialPageRoute( - builder: (context) => ContactsScreen( - asSelectionScreen: true, - selectedContactsHistory: [], - selectedList: (s) async { - for (var element in s) { - await Provider.of< - TrustedContactProvider>( - context, - listen: false) - .addTrustedContacts(element!); - } - }, - ), - ), - ); - } else { - await showDialog( - context: context, - barrierDismissible: true, - builder: (context) => AddContactDialog( - // onYesTap: (value) { - // onActionpressed(value); - // }, - ), - ); - } - }) - : Container()) - : menuBar(context), - ) - ], - automaticallyImplyLeading: false, - backgroundColor: Colors.transparent, ); } diff --git a/lib/screens/common_widgets/custom_divider.dart b/lib/screens/common_widgets/custom_divider.dart new file mode 100644 index 00000000..5a40f6e9 --- /dev/null +++ b/lib/screens/common_widgets/custom_divider.dart @@ -0,0 +1,38 @@ +// ignore_for_file: public_member_api_docs, sort_constructors_first +import 'package:at_common_flutter/at_common_flutter.dart'; +import 'package:atsign_atmosphere_pro/utils/colors.dart'; +import 'package:atsign_atmosphere_pro/utils/text_styles.dart'; +import 'package:flutter/material.dart'; + +/// Divider for list view in Contact and my files screen. +/// Having the initial letter in the start. +class CustomDivider extends StatelessWidget { + const CustomDivider({ + Key? key, + required this.initialLetter, + this.padRight = false, + }) : super(key: key); + + final String initialLetter; + final bool padRight; + + @override + Widget build(BuildContext context) { + return Row( + children: [ + Text( + initialLetter, + style: CustomTextStyles.blackBold(size: 20), + ), + SizedBox(width: 20.toWidth), + Expanded( + child: Container( + color: ColorConstants.myFilesBtn, + height: 1, + ), + ), + if (padRight) SizedBox(width: 16.toWidth) + ], + ); + } +} diff --git a/lib/screens/common_widgets/first_letter_placeholder.dart b/lib/screens/common_widgets/first_letter_placeholder.dart new file mode 100644 index 00000000..b9659b33 --- /dev/null +++ b/lib/screens/common_widgets/first_letter_placeholder.dart @@ -0,0 +1,34 @@ +import 'package:at_backupkey_flutter/utils/size_config.dart'; +import 'package:flutter/material.dart'; + +import '../../utils/colors.dart'; +import '../../utils/text_styles.dart'; + +class FirstLetterPlaceholder extends StatelessWidget { + const FirstLetterPlaceholder({ + Key? key, + required this.letter, + }) : super(key: key); + + final String letter; + @override + Widget build(BuildContext context) { + return Padding( + padding: EdgeInsets.symmetric(horizontal: 28.toWidth), + child: Row( + children: [ + Text( + letter, + style: CustomTextStyles.blackBold(size: 20), + ), + SizedBox(width: 20.toWidth), + Expanded( + child: Container( + height: 1, + ), + ) + ], + ), + ); + } +} diff --git a/lib/screens/contacts/contacts_screen.dart b/lib/screens/contacts/contacts_screen.dart new file mode 100644 index 00000000..6488b768 --- /dev/null +++ b/lib/screens/contacts/contacts_screen.dart @@ -0,0 +1,23 @@ +import 'package:atsign_atmosphere_pro/screens/common_widgets/app_bar.dart'; +import 'package:flutter/material.dart'; + +class ContactsScreen extends StatelessWidget { + const ContactsScreen({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return SafeArea( + child: Scaffold( + appBar: CustomAppBar( + showLeadingicon: true, + title: 'Contacts', + showTitle: true, + showTrailingButton: true, + trailingIcon: Icons.add_circle_outline_sharp, + isContactScreen: true, + numberOfContacts: 3, + ), + ), + ); + } +} diff --git a/lib/screens/my_files/my_files.dart b/lib/screens/my_files/my_files.dart index e683b666..96837f25 100644 --- a/lib/screens/my_files/my_files.dart +++ b/lib/screens/my_files/my_files.dart @@ -1,17 +1,26 @@ +// ignore_for_file: public_member_api_docs, sort_constructors_first +import 'dart:developer'; + +import 'package:at_common_flutter/services/size_config.dart'; +import 'package:atsign_atmosphere_pro/screens/my_files/widgets/file_format_dropdown_button.dart'; +import 'package:atsign_atmosphere_pro/utils/images.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + import 'package:atsign_atmosphere_pro/screens/common_widgets/provider_callback.dart'; -import 'package:atsign_atmosphere_pro/screens/my_files/widgets/photos.dart'; -import 'package:atsign_atmosphere_pro/screens/my_files/widgets/videos.dart'; -import 'package:atsign_atmosphere_pro/screens/my_files/widgets/audios.dart'; import 'package:atsign_atmosphere_pro/screens/my_files/widgets/apk.dart'; +import 'package:atsign_atmosphere_pro/screens/my_files/widgets/audios.dart'; import 'package:atsign_atmosphere_pro/screens/my_files/widgets/documents.dart'; +import 'package:atsign_atmosphere_pro/screens/my_files/widgets/photos.dart'; +import 'package:atsign_atmosphere_pro/screens/my_files/widgets/videos.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'; -import 'package:at_common_flutter/services/size_config.dart'; -import 'package:at_common_flutter/widgets/custom_app_bar.dart'; import 'package:atsign_atmosphere_pro/view_models/my_files_provider.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; + +import '../common_widgets/app_bar.dart'; +import 'widgets/files_list_view.dart'; +import 'widgets/my_files_toolbox.dart'; class MyFiles extends StatefulWidget { @override @@ -45,143 +54,171 @@ class _MyFilesState extends State with TickerProviderStateMixin { Widget build(BuildContext context) { getTabsInformation(); SizeConfig().init(context); - return Scaffold( - appBar: CustomAppBar( - showBackButton: true, - showTrailingIcon: true, - showTitle: true, - showLeadingIcon: true, - titleText: TextStrings().myFiles, - trailingIcon: (tabs.length > 1 && - (runtimeType == Videos || - runtimeType == Documents || - runtimeType == APK || - runtimeType == Audios)) - ? PopupMenuButton( - icon: Icon(Icons.more_vert), - onSelected: (dynamic s) { - switch (s) { - case TextStrings.SORT_NAME: - providerCallback(context, - task: (provider) { - if (runtimeType == Photos) { - provider.sortByName(provider.receivedPhotos); - } else if (runtimeType == Videos) { - provider.sortByName(provider.receivedVideos); - } else if (runtimeType == APK) { - provider.sortByName(provider.receivedApk); - } else if (runtimeType == Audios) { - provider.sortByName(provider.receivedAudio); - } else if (runtimeType == Documents) { - provider.sortByName(provider.receivedDocument); - } - }, - taskName: (provider) => provider.SORT_LIST, - onSuccess: (provider) {}); - break; - case TextStrings.SORT_SIZE: - providerCallback(context, - task: (provider) { - if (runtimeType == Photos) { - provider.sortBySize(provider.receivedPhotos); - } else if (runtimeType == Videos) { - provider.sortBySize(provider.receivedVideos); - } else if (runtimeType == APK) { - provider.sortBySize(provider.receivedApk); - } else if (runtimeType == Audios) { - provider.sortBySize(provider.receivedAudio); - } else if (runtimeType == Documents) { - provider.sortBySize(provider.receivedDocument); - } - }, - taskName: (provider) => provider.SORT_LIST, - onSuccess: (provider) {}); - break; - case TextStrings.SORT_DATE: - providerCallback(context, - task: (provider) { - if (runtimeType == Photos) { - provider.sortByDate(provider.receivedPhotos); - } else if (runtimeType == Videos) { - provider.sortByDate(provider.receivedVideos); - } else if (runtimeType == APK) { - provider.sortByDate(provider.receivedApk); - } else if (runtimeType == Audios) { - provider.sortByDate(provider.receivedAudio); - } else if (runtimeType == Documents) { - provider.sortByDate(provider.receivedDocument); - } - }, - taskName: (provider) => provider.SORT_LIST, - onSuccess: (provider) {}); - break; - default: - } - }, - itemBuilder: (context) { - return { - TextStrings.SORT_NAME, - TextStrings.SORT_SIZE, - TextStrings.SORT_DATE - }.map((String choice) { - return PopupMenuItem( - value: choice, - child: Text(choice), - ); - }).toList(); - }) - : Container(), - onTrailingIconPressed: () { - setState(() { - isOpen != isOpen; - }); - }, - ), - body: SingleChildScrollView( - child: (isLoading) - ? Center(child: CircularProgressIndicator()) - : Consumer( - builder: (BuildContext _context, _provider, _) { - if (_provider.tabs.length != tabs.length) { - getTabsInformation(); - } - - return Container( - // reducing size by 120 , so that last list item will be shown - height: SizeConfig().screenHeight - 120.toHeight, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - height: 40, - child: TabBar( - onTap: (index) async {}, - isScrollable: true, - labelColor: ColorConstants.fontPrimary, - indicatorWeight: 5.toHeight, - indicatorColor: Colors.black, - indicatorSize: TabBarIndicatorSize.tab, - labelStyle: CustomTextStyles.primaryBold14, - unselectedLabelStyle: - CustomTextStyles.secondaryRegular14, - controller: _controller, - tabs: List.generate(_provider.tabNames.length, - (index) => Text(_provider.tabNames[index])), - ), - ), - Expanded( - child: TabBarView( - controller: _controller, - physics: AlwaysScrollableScrollPhysics(), - children: _provider.tabs, - ), - ) - ], - ), - ); - }, + return Stack( + children: [ + Container( + width: SizeConfig().screenWidth, + height: SizeConfig().screenHeight, + decoration: BoxDecoration( + image: DecorationImage( + fit: BoxFit.fill, + image: AssetImage( + ImageConstants.appBackground, ), - ), + ), + ), + ), + Scaffold( + backgroundColor: Colors.transparent, + appBar: CustomAppBar( + // showBackButton: true, + showTitle: true, + showLeadingicon: true, + badgeNumber: 2, + title: TextStrings().myFiles, + // trailingIcon: (tabs.length > 1 && + // (runtimeType == Videos || + // runtimeType == Documents || + // runtimeType == APK || + // runtimeType == Audios)) + // ? PopupMenuButton( + // icon: Icon(Icons.more_vert), + // onSelected: (dynamic s) { + // switch (s) { + // case TextStrings.SORT_NAME: + // providerCallback(context, + // task: (provider) { + // if (runtimeType == Photos) { + // provider.sortByName(provider.receivedPhotos); + // } else if (runtimeType == Videos) { + // provider.sortByName(provider.receivedVideos); + // } else if (runtimeType == APK) { + // provider.sortByName(provider.receivedApk); + // } else if (runtimeType == Audios) { + // provider.sortByName(provider.receivedAudio); + // } else if (runtimeType == Documents) { + // provider.sortByName(provider.receivedDocument); + // } + // }, + // taskName: (provider) => provider.SORT_LIST, + // onSuccess: (provider) {}); + // break; + // case TextStrings.SORT_SIZE: + // providerCallback(context, + // task: (provider) { + // if (runtimeType == Photos) { + // provider.sortBySize(provider.receivedPhotos); + // } else if (runtimeType == Videos) { + // provider.sortBySize(provider.receivedVideos); + // } else if (runtimeType == APK) { + // provider.sortBySize(provider.receivedApk); + // } else if (runtimeType == Audios) { + // provider.sortBySize(provider.receivedAudio); + // } else if (runtimeType == Documents) { + // provider.sortBySize(provider.receivedDocument); + // } + // }, + // taskName: (provider) => provider.SORT_LIST, + // onSuccess: (provider) {}); + // break; + // case TextStrings.SORT_DATE: + // providerCallback(context, + // task: (provider) { + // if (runtimeType == Photos) { + // provider.sortByDate(provider.receivedPhotos); + // } else if (runtimeType == Videos) { + // provider.sortByDate(provider.receivedVideos); + // } else if (runtimeType == APK) { + // provider.sortByDate(provider.receivedApk); + // } else if (runtimeType == Audios) { + // provider.sortByDate(provider.receivedAudio); + // } else if (runtimeType == Documents) { + // provider.sortByDate(provider.receivedDocument); + // } + // }, + // taskName: (provider) => provider.SORT_LIST, + // onSuccess: (provider) {}); + // break; + // default: + // } + // }, + // itemBuilder: (context) { + // return { + // TextStrings.SORT_NAME, + // TextStrings.SORT_SIZE, + // TextStrings.SORT_DATE + // }.map((String choice) { + // return PopupMenuItem( + // value: choice, + // child: Text(choice), + // ); + // }).toList(); + // }) + // : Container(), + // onTrailingIconPressed: () { + // setState(() { + // isOpen != isOpen; + // }); + // }, + ), + body: Padding( + padding: EdgeInsets.symmetric(horizontal: 26.toWidth), + child: Column( + children: [ + SizedBox(height: 32.toHeight), + MyFilesToolbox(), + SizedBox(height: 8.toHeight), + Expanded(child: FilesListView()), + ], + ), + ), + // SingleChildScrollView( + // child: (isLoading) + // ? Center(child: CircularProgressIndicator()) + // : Consumer( + // builder: (BuildContext _context, _provider, _) { + // if (_provider.tabs.length != tabs.length) { + // getTabsInformation(); + // } + + // return Container( + // // reducing size by 120 , so that last list item will be shown + // height: SizeConfig().screenHeight - 120.toHeight, + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Container( + // height: 40, + // child: TabBar( + // onTap: (index) async {}, + // isScrollable: true, + // labelColor: ColorConstants.fontPrimary, + // indicatorWeight: 5.toHeight, + // indicatorColor: Colors.black, + // indicatorSize: TabBarIndicatorSize.tab, + // labelStyle: CustomTextStyles.primaryBold14, + // unselectedLabelStyle: + // CustomTextStyles.secondaryRegular14, + // controller: _controller, + // tabs: List.generate(_provider.tabNames.length, + // (index) => Text(_provider.tabNames[index])), + // ), + // ), + // Expanded( + // child: TabBarView( + // controller: _controller, + // physics: AlwaysScrollableScrollPhysics(), + // children: _provider.tabs, + // ), + // ) + // ], + // ), + // ); + // }, + // ), + // ), + ), + ], ); } } diff --git a/lib/screens/my_files/widgets/documents.dart b/lib/screens/my_files/widgets/documents.dart index ae2cfb17..b8e4bb29 100644 --- a/lib/screens/my_files/widgets/documents.dart +++ b/lib/screens/my_files/widgets/documents.dart @@ -67,8 +67,7 @@ class _DocumentsState extends State { height: 50.toHeight, width: 50.toWidth, child: Image.asset( - FileTypes.PDF_TYPES.contains(provider - .receivedDocument[index].fileName! + FileTypes.PDF_TYPES.contains(provider.receivedDocument[index].fileName! .split('.') .last) ? ImageConstants.pdfLogo @@ -83,12 +82,20 @@ class _DocumentsState extends State { .last) ? ImageConstants.exelLogo : FileTypes.TEXT_TYPES.contains(provider - .receivedDocument[index] + .receivedUnknown[index] .fileName! .split('.') .last) ? ImageConstants.txtLogo - : ImageConstants.unknownLogo, + : FileTypes.ARCHIVE_TYPES.contains(provider + .receivedUnknown[index] + .fileName! + .split('.') + .last) + ? ImageConstants.archiveLogo + : FileTypes.WEB_IMAGE_TYPES.contains(provider.receivedUnknown[index].fileName!.split('.').last) + ? ImageConstants.svgLogo + : ImageConstants.otherFileLogo, fit: BoxFit.cover, ), ), diff --git a/lib/screens/my_files/widgets/file_format_dropdown_button.dart b/lib/screens/my_files/widgets/file_format_dropdown_button.dart new file mode 100644 index 00000000..5f02174a --- /dev/null +++ b/lib/screens/my_files/widgets/file_format_dropdown_button.dart @@ -0,0 +1,304 @@ +import 'dart:developer'; + +import 'package:at_common_flutter/at_common_flutter.dart'; +import 'package:atsign_atmosphere_pro/utils/images.dart'; +import 'package:flutter/material.dart'; + +import '../../../utils/colors.dart'; +import '../../../utils/text_strings.dart'; +import '../../../utils/text_styles.dart'; + +enum FileType { + docx, + ppt, + pdf, + excel, + txt, + psd, + html, + png, +} + +extension FileTypeX on FileType { + String name() { + switch (this) { + case FileType.docx: + return 'Docx'; + case FileType.ppt: + return 'PPT'; + case FileType.pdf: + return 'PDF'; + case FileType.excel: + return 'Excel'; + case FileType.txt: + return 'Txt File'; + case FileType.psd: + return 'PSD'; + case FileType.html: + return 'HTML'; + case FileType.png: + return 'PNG'; + default: + throw Exception('Invalid filetype'); + } + } + + String getIconPath() { + // few logos are not yet added so default is word logo for now. + switch (this) { + case FileType.docx: + return ImageConstants.wordLogo; + case FileType.ppt: + return ImageConstants.pptLogo; + case FileType.pdf: + return ImageConstants.pdfLogo; + case FileType.excel: + return ImageConstants.exelLogo; + case FileType.txt: + return ImageConstants.txtLogo; + case FileType.psd: + return ImageConstants.psdLogo; + case FileType.html: + return ImageConstants.htmlLogo; + case FileType.png: + return ImageConstants.pngLogo; + default: + throw Exception('Invalid filetype'); + } + } +} + +class FileFormatDropDownButton extends StatefulWidget { + const FileFormatDropDownButton({Key? key}) : super(key: key); + + @override + State createState() => + _FileFormatDropDownButtonState(); +} + +class _FileFormatDropDownButtonState extends State + with FileTypeOverlayMixin { + // for all different file types. + // initially none will be selected as it will default to [All] + + @override + void dispose() { + removeOverlay(); + super.dispose(); + } + + @override + void didChangeDependencies() { + removeOverlay(); + setState(() {}); + super.didChangeDependencies(); + } + + @override + Widget build(BuildContext context) { + return Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TextStrings().deliveryType, + style: CustomTextStyles.primaryBold14 + .copyWith(color: ColorConstants.checkboxBorder), + ), + const SizedBox(height: 5), + InkWell( + onTap: toggleOverlay, + child: Container( + padding: EdgeInsets.symmetric(horizontal: 15.toWidth), + height: 48.toHeight, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(10), + border: Border.all(color: ColorConstants.light_grey2), + ), + child: Row( + children: [ + Expanded( + child: Text( + selectedFileTypes, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: CustomTextStyles.primaryBold16.copyWith( + color: ColorConstants.light_grey2, + ), + ), + ), + Image.asset( + ImageConstants.arrowDown, + width: 12.toWidth, + ), + ], + ), + ), + ), + ], + ); + } +} + +mixin FileTypeOverlayMixin on State { + OverlayEntry? _entry; + + bool get isOverlayShown => _entry != null; + + String selectedFileTypes = 'All'; + + List selectedList = List.generate(8, (index) => false); + + void toggleOverlay() => isOverlayShown + ? removeOverlay() + : _insert( + FileTypeCheckboxListOverlay(selectedList: selectedList), + ); + + removeOverlay() { + _entry?.remove(); + _entry = null; + if (selectedList.every((element) => !element)) { + selectedFileTypes = 'All'; + } else { + selectedFileTypes = ''; + for (int i = 0; i < 8; i++) { + if (selectedList[i]) { + selectedFileTypes += FileType.values[i].name() + ', '; + } + } + selectedFileTypes = + selectedFileTypes.substring(0, selectedFileTypes.length - 2); + } + setState(() {}); + } + + Widget _dismissableOverlay(Widget child, double dx, double dy, double width) { + return Stack( + children: [ + Positioned.fill( + child: GestureDetector( + onTap: removeOverlay, + child: Container( + color: Colors.transparent, + ), + ), + ), + Positioned(top: dy, left: dx, width: width, child: child), + ], + ); + } + + void _insert(Widget child) { + final renderBox = context.findRenderObject() as RenderBox; + final offset = renderBox.localToGlobal(Offset.zero); + final dx = offset.dx; + final dy = offset.dy + renderBox.size.height; + final w = renderBox.size.width; + + _entry = OverlayEntry( + builder: (context) => _dismissableOverlay(child, dx, dy, w), + ); + + Overlay.of(context)?.insert(_entry!); + } +} + +class FileTypeCheckboxListOverlay extends StatefulWidget { + const FileTypeCheckboxListOverlay({ + Key? key, + required this.selectedList, + }) : super(key: key); + + final List selectedList; + + @override + State createState() => + _FileTypeCheckboxListOverlayState(); +} + +class _FileTypeCheckboxListOverlayState + extends State { + @override + Widget build(BuildContext context) { + return Material( + color: Colors.transparent, + elevation: 0, + child: Theme( + data: Theme.of(context).copyWith( + unselectedWidgetColor: ColorConstants.checkboxFill, + checkboxTheme: CheckboxThemeData( + fillColor: MaterialStateProperty.all(ColorConstants.checkboxFill), + side: MaterialStateBorderSide.resolveWith( + (states) => + BorderSide(width: 1.0, color: ColorConstants.checkboxBorder), + ), + checkColor: MaterialStateProperty.all(Colors.black), + shape: RoundedRectangleBorder( + side: BorderSide( + color: ColorConstants.checkboxBorder, + width: 1, + ), + borderRadius: BorderRadius.circular(2), + ), + ), + ), + child: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.vertical( + bottom: Radius.circular(10), + ), + boxShadow: [ + BoxShadow( + blurRadius: 15, + offset: Offset(0, 4), + color: Colors.black.withOpacity(0.25), + ), + ], + ), + height: 255.toHeight, + child: ListView.separated( + itemBuilder: (context, index) { + if (index == 0) { + return CheckboxListTile( + dense: true, + title: Text( + 'ALL', + style: CustomTextStyles.fileTypeDropdown, + ), + value: widget.selectedList.every((element) => !element), + onChanged: (val) { + widget.selectedList + .setAll(0, List.generate(8, (index) => false)); + log(widget.selectedList.toString()); + setState(() {}); + }, + ); + } + return CheckboxListTile( + dense: true, + title: Text( + FileType.values[index - 1].name(), + style: CustomTextStyles.fileTypeDropdown, + ), + value: widget.selectedList[index - 1], + onChanged: (val) { + widget.selectedList[index - 1] = val!; + setState(() {}); + }, + ); + }, + separatorBuilder: (context, index) => Container( + height: 1, + color: ColorConstants.textBoxBg, + ), + padding: EdgeInsets.zero, + itemCount: FileType.values.length + 1, + ), + ), + ), + ); + } +} diff --git a/lib/screens/my_files/widgets/files_list_view.dart b/lib/screens/my_files/widgets/files_list_view.dart new file mode 100644 index 00000000..90df1cfe --- /dev/null +++ b/lib/screens/my_files/widgets/files_list_view.dart @@ -0,0 +1,114 @@ +// ignore_for_file: public_member_api_docs, sort_constructors_first +import 'package:at_common_flutter/at_common_flutter.dart'; +import 'package:atsign_atmosphere_pro/data_models/file_modal.dart'; +import 'package:atsign_atmosphere_pro/utils/colors.dart'; +import 'package:atsign_atmosphere_pro/utils/text_styles.dart'; +import 'package:flutter/material.dart'; + +import 'package:atsign_atmosphere_pro/screens/common_widgets/custom_divider.dart'; +import 'package:atsign_atmosphere_pro/screens/my_files/widgets/file_format_dropdown_button.dart'; + +class FilesListView extends StatefulWidget { + const FilesListView({Key? key}) : super(key: key); + + @override + State createState() => _FilesListViewState(); +} + +class _FilesListViewState extends State { + // List files; + @override + Widget build(BuildContext context) { + return Scrollbar( + thumbVisibility: true, + radius: Radius.circular(11), + thickness: 5, + trackVisibility: true, + child: NestedScrollView( + headerSliverBuilder: (context, innerBoxIsScrolled) { + return [ + SliverAppBar( + pinned: true, + automaticallyImplyLeading: false, + primary: false, + titleSpacing: 0, + title: CustomDivider(initialLetter: 'A', padRight: true), + ), + ]; + }, + body: ListView.builder( + itemCount: 1, //this should be number of files / 2 + padding: EdgeInsets.symmetric(horizontal: 18.toWidth), + + itemBuilder: (context, index) { + return Padding( + padding: EdgeInsets.only(bottom: 8.toHeight), + child: Row( + children: [ + Expanded( + child: FileListTile( + type: FileType.ppt, + title: 'Qna.docx', + fileSize: '2 Mb', + ), + ), + SizedBox(width: 8.toWidth), + // if(index*2 + 1 < numberOfFiles) + Expanded( + child: FileListTile( + type: FileType.docx, + title: 'Qna.docx', + fileSize: '2 Mb', + ), + ), + ], + ), + ); + }, + ), + ), + ); + } +} + +class FileListTile extends StatelessWidget { + const FileListTile({ + Key? key, + required this.type, + required this.title, + required this.fileSize, + }) : super(key: key); + + final FileType type; + final String title; + final String fileSize; + + @override + Widget build(BuildContext context) { + return ListTile( + onTap: () { + // TODO: Interact with file + }, + contentPadding: EdgeInsets.symmetric(horizontal: 10.toWidth), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(6), + side: BorderSide(color: ColorConstants.textBoxBg)), + leading: Image.asset( + type.getIconPath(), + height: 24.toHeight, + ), + minLeadingWidth: 0, + dense: true, + horizontalTitleGap: 9.toWidth, + visualDensity: VisualDensity.compact, + title: Text( + title, + style: CustomTextStyles.fileTitle, + ), + subtitle: Text( + fileSize, + style: CustomTextStyles.fileSubtitle, + ), + ); + } +} diff --git a/lib/screens/my_files/widgets/my_files_toolbox.dart b/lib/screens/my_files/widgets/my_files_toolbox.dart new file mode 100644 index 00000000..160242d6 --- /dev/null +++ b/lib/screens/my_files/widgets/my_files_toolbox.dart @@ -0,0 +1,130 @@ +import 'dart:developer'; + +import 'package:at_common_flutter/at_common_flutter.dart'; +import 'package:flutter/material.dart'; + +import '../../../utils/colors.dart'; +import '../../../utils/images.dart'; +import '../../../utils/text_strings.dart'; +import '../../../utils/text_styles.dart'; +import 'file_format_dropdown_button.dart'; + +class MyFilesToolbox extends StatelessWidget { + const MyFilesToolbox({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.all(14.toWidth), + decoration: BoxDecoration( + color: ColorConstants.textBoxBg, + borderRadius: BorderRadius.circular(8), + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded(child: RefreshButton()), + SizedBox(width: 10.toWidth), + Expanded(child: SearchButton()), + SizedBox(width: 10.toWidth), + Expanded( + flex: SizeConfig().screenWidth > 400 ? 4 : 3, + child: FileFormatDropDownButton(), + ), + ], + ), + ); + } +} + +class RefreshButton extends StatelessWidget { + const RefreshButton({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + FittedBox( + fit: BoxFit.fitWidth, + child: Text( + TextStrings().refresh, + style: CustomTextStyles.primaryBold14 + .copyWith(color: ColorConstants.checkboxBorder), + ), + ), + const SizedBox(height: 5), + SquareRoundedIconButton( + onTap: () { + log('refresh button tapped'); + }, + icon: ImageConstants.refreshIcon, + ), + ], + ); + } +} + +class SearchButton extends StatelessWidget { + const SearchButton({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + FittedBox( + fit: BoxFit.fitWidth, + child: Text( + TextStrings().searchFile, + style: CustomTextStyles.primaryBold14 + .copyWith(color: ColorConstants.checkboxBorder), + ), + ), + const SizedBox(height: 5), + SquareRoundedIconButton( + onTap: () { + log('Search button tapped'); + }, + icon: ImageConstants.searchIcon, + ), + ], + ); + } +} + +class SquareRoundedIconButton extends StatelessWidget { + const SquareRoundedIconButton({ + Key? key, + required this.onTap, + required this.icon, + }) : super(key: key); + + final Function() onTap; + final String icon; + + @override + Widget build(BuildContext context) { + return Container( + height: 48.toHeight, + child: RawMaterialButton( + onPressed: onTap, + fillColor: Colors.white, + elevation: 0, + focusElevation: 0, + hoverElevation: 0, + highlightElevation: 0, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + side: BorderSide(color: ColorConstants.light_grey2), + ), + child: Image.asset( + icon, + width: 16.toWidth, + ), + ), + ); + } +} diff --git a/lib/screens/my_files/widgets/recents.dart b/lib/screens/my_files/widgets/recents.dart index 56e7b90b..dbb36f94 100644 --- a/lib/screens/my_files/widgets/recents.dart +++ b/lib/screens/my_files/widgets/recents.dart @@ -212,7 +212,14 @@ Widget thumbnail(String extension, String path) { ? ImageConstants.exelLogo : FileTypes.TEXT_TYPES.contains(extension) ? ImageConstants.txtLogo - : ImageConstants.unknownLogo, + : FileTypes.ARCHIVE_TYPES + .contains(extension) + ? ImageConstants.archiveLogo + : FileTypes.WEB_IMAGE_TYPES + .contains(extension) + ? ImageConstants.svgLogo + : ImageConstants + .otherFileLogo, fit: BoxFit.cover, ), ), diff --git a/lib/screens/my_files/widgets/unknowns.dart b/lib/screens/my_files/widgets/unknowns.dart index 9be87b3a..8e46e284 100644 --- a/lib/screens/my_files/widgets/unknowns.dart +++ b/lib/screens/my_files/widgets/unknowns.dart @@ -66,8 +66,7 @@ class _UnknownsState extends State { height: 50.toHeight, width: 50.toWidth, child: Image.asset( - FileTypes.PDF_TYPES.contains(provider - .receivedUnknown[index].fileName! + FileTypes.PDF_TYPES.contains(provider.receivedUnknown[index].fileName! .split('.') .last) ? ImageConstants.pdfLogo @@ -87,7 +86,15 @@ class _UnknownsState extends State { .split('.') .last) ? ImageConstants.txtLogo - : ImageConstants.unknownLogo, + : FileTypes.ARCHIVE_TYPES.contains(provider + .receivedUnknown[index] + .fileName! + .split('.') + .last) + ? ImageConstants.archiveLogo + : FileTypes.WEB_IMAGE_TYPES.contains(provider.receivedUnknown[index].fileName!.split('.').last) + ? ImageConstants.svgLogo + : ImageConstants.otherFileLogo, fit: BoxFit.cover, ), ), diff --git a/lib/services/common_utility_functions.dart b/lib/services/common_utility_functions.dart index 67334024..0edce445 100644 --- a/lib/services/common_utility_functions.dart +++ b/lib/services/common_utility_functions.dart @@ -386,7 +386,13 @@ class CommonUtilityFunctions { ? ImageConstants.exelLogo : FileTypes.TEXT_TYPES.contains(extension) ? ImageConstants.txtLogo - : ImageConstants.unknownLogo, + : FileTypes.ARCHIVE_TYPES + .contains(extension) + ? ImageConstants.archiveLogo + : FileTypes.WEB_IMAGE_TYPES + .contains(extension) + ? ImageConstants.svgLogo + : ImageConstants.otherFileLogo, fit: BoxFit.cover, ), ), diff --git a/lib/utils/colors.dart b/lib/utils/colors.dart index 9486654b..a1df963f 100644 --- a/lib/utils/colors.dart +++ b/lib/utils/colors.dart @@ -29,9 +29,15 @@ class ColorConstants { static const Color dark_red = Color(0xFFB00021); static const Color receivedSelectedTileColor = Color(0xFFF0EFFF); static const Color light_grey = Color(0xFFBFBFBF); + static const Color light_grey2 = Color(0xFF939393); static const Color light_border_color = Color(0xFFEEF1F4); static const Color textBoxBg = Color(0xFFF2F2F2); static const Color lightBlueBg = Color(0xFFF8FBFF); + static const Color addButtonBg = Color(0xff212121); + static const Color myFilesBtn = Color(0xffd9d9d9); + static const Color checkboxBorder = Color(0xffA4A4A5); + static const Color checkboxFill = Color(0xFFF5F5F5); + static const Color fileTitle = Color(0xFF424242); //NEW UI COLORS static const Color fadedGreyN = Color(0xFFF1F1F1); diff --git a/lib/utils/file_types.dart b/lib/utils/file_types.dart index 01818a18..e68177a2 100644 --- a/lib/utils/file_types.dart +++ b/lib/utils/file_types.dart @@ -22,6 +22,8 @@ class FileTypes { ]; static List APK_TYPES = ['apk', 'APK']; static List PDF_TYPES = ['pdf', 'PDF']; + static List ARCHIVE_TYPES = ['rar', 'RAR', 'zip', 'ZIP']; + static List WEB_IMAGE_TYPES = ['svg', 'SVG']; static List WORD_TYPES = ['doc', 'docx', 'DOC', 'DOCX']; static List EXEL_TYPES = ['xls', 'xlsx', 'XLS', 'XLSX']; static List TEXT_TYPES = ['txt', 'TXT']; diff --git a/lib/utils/images.dart b/lib/utils/images.dart index 5dcfc9cd..c14c17ff 100644 --- a/lib/utils/images.dart +++ b/lib/utils/images.dart @@ -1,14 +1,18 @@ class ImageConstants { static String _basePath = 'assets/images'; + // static String welcomeBackground = '$_basePath/welcome_bg.png'; + static String appBackground = '$_basePath/app_bg.png'; static String welcomeBackground = '$_basePath/new_welcome_bg.png'; static String logoIcon = '$_basePath/logo.png'; // static String myFiles = '$_basePath/myfiles.png'; static String group = '$_basePath/group.png'; + static String groupNew = '$_basePath/groupNew.png'; static String trustedsenders = '$_basePath/trustedsenders.png'; static String drawerIcon = '$_basePath/menu.png'; static String contactsIcon = '$_basePath/contacts.png'; static String blockedIcon = '$_basePath/blocked.png'; + static String blockedIconNew = '$_basePath/blockedNew.png'; static String faqsIcon = '$_basePath/faqs.png'; static String termsAndConditionsIcon = '$_basePath/termsAndConditions.png'; static String transferHistoryIcon = '$_basePath/transferHistory.png'; @@ -23,6 +27,11 @@ class ImageConstants { static String txtLogo = '$_basePath/txtLogo.png'; static String unknownLogo = '$_basePath/unknown.png'; static String videoLogo = '$_basePath/video-camera.png'; + + static String otherFileLogo = '$_basePath/other_type_icon.png'; + static String archiveLogo = '$_basePath/archive_icon.png'; + static String svgLogo = '$_basePath/svg_icon.png'; + static String emptyTrustedSenders = '$_basePath/emptyTrustedSenders.png'; static String emptyGroup = '$_basePath/empty_group.png'; static String profileImage = '$_basePath/profile.png'; @@ -37,12 +46,20 @@ class ImageConstants { static String exclamation = '$_basePath/exclamation.png'; static String close = '$_basePath/close.png'; static String trustedSender = '$_basePath/trustedSendersIcon.png'; + static String trustedSenderNew = '$_basePath/trustedSender.png'; static String myFiles = '$_basePath/my_files.png'; static String groups = '$_basePath/groups.png'; static String contactUs = '$_basePath/contactUs.png'; + static String searchIcon = '$_basePath/search.png'; + static String refreshIcon = '$_basePath/refresh.png'; + static String arrowDown = '$_basePath/arrow_down.png'; static String settings = '$_basePath/settings.png'; // TEST FILE DELETE WHEN IN PRODUCTION static String test = '$_basePath/test.jpg'; + static String pptLogo = '$_basePath/ppt_logo.png'; + static String psdLogo = '$_basePath/psd_logo.png'; + static String htmlLogo = '$_basePath/html_logo.png'; + static String pngLogo = '$_basePath/png_logo.png'; // New UI Settings Screen static String switchAtSign = '$_basePath/switch_atsign.png'; diff --git a/lib/utils/text_strings.dart b/lib/utils/text_strings.dart index a8a83f9f..6e36fa43 100644 --- a/lib/utils/text_strings.dart +++ b/lib/utils/text_strings.dart @@ -74,6 +74,7 @@ class TextStrings { String contactSearchResults = 'Search Results'; String addContact = 'Add Contact'; String addtoContact = 'Add to Contacts'; + String searchContactNew = 'Search by atSign or nickname'; // buttons text String buttonStart = 'Start'; String buttonSend = 'Send'; @@ -135,6 +136,9 @@ class TextStrings { String apk = 'APK'; String documents = 'Documents'; String openFileLocation = 'Open file location'; + String refresh = 'Refresh'; + String searchFile = 'Search'; + String deliveryType = 'Delivery Type'; // trusted sender screens String trustedSenders = 'Trusted Senders'; diff --git a/lib/utils/text_styles.dart b/lib/utils/text_styles.dart index 2918f196..fec4dbbe 100644 --- a/lib/utils/text_styles.dart +++ b/lib/utils/text_styles.dart @@ -100,6 +100,28 @@ class CustomTextStyles { letterSpacing: 0.1, fontWeight: FontWeight.normal); + static TextStyle greyRegularItalic14 = TextStyle( + color: ColorConstants.light_grey2, + fontSize: 14.toFont, + letterSpacing: 0.1, + fontWeight: FontWeight.w400, + fontStyle: FontStyle.italic, + ); + + static TextStyle fileTitle = TextStyle( + color: ColorConstants.fileTitle, + fontSize: 8.toFont, + letterSpacing: 0.1, + fontWeight: FontWeight.w500, + ); + + static TextStyle fileSubtitle = TextStyle( + color: ColorConstants.checkboxBorder, + fontSize: 7.toFont, + letterSpacing: 0.1, + fontWeight: FontWeight.w500, + ); + //BOLD FONTS static TextStyle blackBold25 = TextStyle( color: Colors.black, @@ -127,6 +149,13 @@ class CustomTextStyles { fontWeight: FontWeight.w700, ); + static TextStyle primaryBold25 = TextStyle( + color: ColorConstants.fontPrimary, + fontWeight: FontWeight.w700, + fontSize: 25.toFont, + letterSpacing: 0.1, + ); + static TextStyle primaryBold18 = TextStyle( color: ColorConstants.fontPrimary, fontWeight: FontWeight.w700, @@ -155,7 +184,13 @@ class CustomTextStyles { fontWeight: FontWeight.w700, ); - //SEMIBOLD FONTS + static TextStyle fileTypeDropdown = TextStyle( + color: ColorConstants.light_grey2, + fontSize: 12.toFont, + letterSpacing: 0.1, + fontWeight: FontWeight.w600, + ); + static TextStyle greySemiBold18 = TextStyle( color: Color(0xFF939393), fontSize: 18.toFont, @@ -164,6 +199,12 @@ class CustomTextStyles { ); //MEDIUM FONTS + static TextStyle primaryBold15 = TextStyle( + color: ColorConstants.fontPrimary, + fontSize: 16.toFont, + letterSpacing: 0.1, + fontWeight: FontWeight.w500, + ); static TextStyle primaryMedium14 = TextStyle( color: ColorConstants.fontPrimary, @@ -172,6 +213,13 @@ class CustomTextStyles { fontWeight: FontWeight.w500, ); + static TextStyle greyMedium13 = TextStyle( + color: ColorConstants.light_grey2, + fontSize: 13.toFont, + letterSpacing: 0.1, + fontWeight: FontWeight.w500, + ); + static TextStyle blueMedium16 = TextStyle( color: ColorConstants.appBarCloseColor, fontSize: 16.toFont, diff --git a/macos/Podfile.lock b/macos/Podfile.lock index 33194a54..f4d223e8 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -80,7 +80,7 @@ SPEC CHECKSUMS: emoji_picker_flutter: 533634326b1c5de9a181ba14b9758e6dfe967a20 file_selector_macos: f1b08a781e66103e3ba279fd5d4024a2478b3af6 flutter_local_notifications: 3805ca215b2fb7f397d78b66db91f6a747af52e4 - FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424 + FlutterMacOS: ae6af50a8ea7d6103d888583d46bd8328a7e9811 local_notifier: e9506bc66fc70311e8bc7291fb70f743c081e4ff package_info_plus_macos: f010621b07802a241d96d01876d6705f15e77c1c path_provider_macos: 3c0c3b4b0d4a76d2bf989a913c2de869c5641a19 diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index b1a52ede..8a1bfdfb 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -423,7 +423,7 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 48; + CURRENT_PROJECT_VERSION = 49; DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = Runner/Info.plist; @@ -558,7 +558,7 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 48; + CURRENT_PROJECT_VERSION = 49; DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = Runner/Info.plist; @@ -585,7 +585,7 @@ CODE_SIGN_IDENTITY = "Mac Developer"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 48; + CURRENT_PROJECT_VERSION = 49; DEVELOPMENT_TEAM = 5XUSS6C2DF; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = Runner/Info.plist; diff --git a/pubspec.lock b/pubspec.lock index 3d613a8c..dc4029fa 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -116,7 +116,7 @@ packages: name: at_file_saver url: "https://pub.dartlang.org" source: hosted - version: "0.1.1" + version: "0.1.2" at_lookup: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index d455844d..cb18b153 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.8+48 +version: 1.0.8+49 # Desktop version macos # version: 1.0.1+19 @@ -67,8 +67,8 @@ dependencies: at_common_flutter: ^2.0.10 at_client_mobile: ^3.2.5 - at_onboarding_flutter: ^5.0.2 - at_backupkey_flutter: ^4.0.5 + at_onboarding_flutter: ^5.0.3 + at_backupkey_flutter: ^4.0.6 at_contacts_flutter: ^4.0.7 at_contacts_group_flutter: ^4.0.9 local_notifier: ^0.1.1 @@ -149,6 +149,10 @@ flutter: weight: 600 - asset: assets/fonts/Inter/Inter-Bold.ttf weight: 700 + - family: Montserrat + fonts: + - asset: assets/fonts/Montserrat-Regular.ttf + # - asset: fonts/TrajanPro_Bold.ttf # weight: 700 #