From 558cca1b57740d71bd7268a360d60b81811c5546 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Thu, 21 Dec 2023 16:55:07 -0300 Subject: [PATCH 01/24] feat(sharing intent) implement sharing intent feature --- .vscode/settings.json | 2 +- android/app/src/main/AndroidManifest.xml | 10 + ios/Runner.xcodeproj/project.pbxproj | 1235 ++++++++++++++--- ios/Runner/AppDelegate.swift | 7 + ios/Runner/Info.plist | 13 + ios/Runner/Runner.entitlements | 10 + .../Base.lproj/MainInterface.storyboard | 24 + ios/Share Extension/Info.plist | 5 + .../Share Extension.entitlements | 10 + ios/Share Extension/ShareViewController.swift | 363 +++++ ios/Share Extension/SharingFile.swift | 26 + ios/Share Extension/SharingFileType.swift | 8 + .../drive_detail/drive_detail_cubit.dart | 3 +- lib/blocs/sync/sync_cubit.dart | 9 + lib/components/upload_form.dart | 54 +- lib/main.dart | 2 + lib/models/daos/drive_dao/folder_node.dart | 9 + .../components/drive_explorer_item_tile.dart | 7 +- lib/pages/drive_detail/drive_detail_page.dart | 159 +-- lib/sharing/blocs/sharing_file_bloc.dart | 45 + lib/sharing/blocs/sharing_file_event.dart | 21 + lib/sharing/blocs/sharing_file_state.dart | 21 + .../folder_selector/folder_selector.dart | 246 ++++ .../folder_selector/folder_selector_bloc.dart | 47 + .../folder_selector_event.dart | 46 + .../folder_selector_state.dart | 38 + lib/sharing/sharing_file_listener.dart | 99 ++ pubspec.lock | 8 + pubspec.yaml | 1 + 29 files changed, 2236 insertions(+), 292 deletions(-) create mode 100644 ios/Runner/Runner.entitlements create mode 100644 ios/Share Extension/Base.lproj/MainInterface.storyboard create mode 100644 ios/Share Extension/Info.plist create mode 100644 ios/Share Extension/Share Extension.entitlements create mode 100644 ios/Share Extension/ShareViewController.swift create mode 100644 ios/Share Extension/SharingFile.swift create mode 100644 ios/Share Extension/SharingFileType.swift create mode 100644 lib/sharing/blocs/sharing_file_bloc.dart create mode 100644 lib/sharing/blocs/sharing_file_event.dart create mode 100644 lib/sharing/blocs/sharing_file_state.dart create mode 100644 lib/sharing/folder_selector/folder_selector.dart create mode 100644 lib/sharing/folder_selector/folder_selector_bloc.dart create mode 100644 lib/sharing/folder_selector/folder_selector_event.dart create mode 100644 lib/sharing/folder_selector/folder_selector_state.dart create mode 100644 lib/sharing/sharing_file_listener.dart diff --git a/.vscode/settings.json b/.vscode/settings.json index fdfe3b0268..8c4ccf2184 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,6 @@ { "editor.codeActionsOnSave": { - "source.organizeImports": true + "source.organizeImports": "explicit" }, "bloc.newBlocTemplate": "equatable", "bloc.newCubitTemplate": "equatable", diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index c31c1ee74d..4daf2e9c7e 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -42,6 +42,16 @@ + + + + + + + + + + diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 9e5a6772ef..e44aa7895d 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -7,6 +7,9 @@ objects = { /* Begin PBXBuildFile section */ + 064460FF2B34C5B1001CD384 /* ShareViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 064460FE2B34C5B1001CD384 /* ShareViewController.swift */; }; + 064461022B34C5B1001CD384 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 064461002B34C5B1001CD384 /* MainInterface.storyboard */; }; + 064461062B34C5B1001CD384 /* Share Extension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 064460FC2B34C5B1001CD384 /* Share Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 479124AD9A741A973A4E5A5B /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5A6BE94BEB89CFAF4EA84AA5 /* Pods_Runner.framework */; }; @@ -16,7 +19,28 @@ 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + 064461042B34C5B1001CD384 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 97C146E61CF9000F007C117D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 064460FB2B34C5B1001CD384; + remoteInfo = "Share Extension"; + }; +/* End PBXContainerItemProxy section */ + /* Begin PBXCopyFilesBuildPhase section */ + 064461112B34C5B1001CD384 /* Embed Foundation Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + 064461062B34C5B1001CD384 /* Share Extension.appex in Embed Foundation Extensions */, + ); + name = "Embed Foundation Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; 9705A1C41CF9048500538489 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -30,6 +54,12 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 064460FC2B34C5B1001CD384 /* Share Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "Share Extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; }; + 064460FE2B34C5B1001CD384 /* ShareViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareViewController.swift; sourceTree = ""; }; + 064461012B34C5B1001CD384 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/MainInterface.storyboard; sourceTree = ""; }; + 064461032B34C5B1001CD384 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 064461122B34C84D001CD384 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = ""; }; + 064461132B34C8E2001CD384 /* Share Extension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Share Extension.entitlements"; sourceTree = ""; }; 083F200B2442CBC394622591 /* GoogleService-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "Runner/GoogleService-Info.plist"; 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 = ""; }; @@ -60,6 +90,13 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 064460F92B34C5B1001CD384 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 97C146EB1CF9000F007C117D /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -71,6 +108,17 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 064460FD2B34C5B1001CD384 /* Share Extension */ = { + isa = PBXGroup; + children = ( + 064461132B34C8E2001CD384 /* Share Extension.entitlements */, + 064460FE2B34C5B1001CD384 /* ShareViewController.swift */, + 064461002B34C5B1001CD384 /* MainInterface.storyboard */, + 064461032B34C5B1001CD384 /* Info.plist */, + ); + path = "Share Extension"; + sourceTree = ""; + }; 4AE77E3B8B569173EB906841 /* Pods */ = { isa = PBXGroup; children = ( @@ -106,6 +154,7 @@ children = ( 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, + 064460FD2B34C5B1001CD384 /* Share Extension */, 97C146EF1CF9000F007C117D /* Products */, 4AE77E3B8B569173EB906841 /* Pods */, A18FF83CA95D0DA444D9F358 /* Frameworks */, @@ -117,6 +166,7 @@ isa = PBXGroup; children = ( 97C146EE1CF9000F007C117D /* Runner.app */, + 064460FC2B34C5B1001CD384 /* Share Extension.appex */, ); name = Products; sourceTree = ""; @@ -124,6 +174,7 @@ 97C146F01CF9000F007C117D /* Runner */ = { isa = PBXGroup; children = ( + 064461122B34C84D001CD384 /* Runner.entitlements */, 97C146FA1CF9000F007C117D /* Main.storyboard */, 97C146FD1CF9000F007C117D /* Assets.xcassets */, 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, @@ -147,6 +198,23 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ + 064460FB2B34C5B1001CD384 /* Share Extension */ = { + isa = PBXNativeTarget; + buildConfigurationList = 064461072B34C5B1001CD384 /* Build configuration list for PBXNativeTarget "Share Extension" */; + buildPhases = ( + 064460F82B34C5B1001CD384 /* Sources */, + 064460F92B34C5B1001CD384 /* Frameworks */, + 064460FA2B34C5B1001CD384 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Share Extension"; + productName = "Share Extension"; + productReference = 064460FC2B34C5B1001CD384 /* Share Extension.appex */; + productType = "com.apple.product-type.app-extension"; + }; 97C146ED1CF9000F007C117D /* Runner */ = { isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; @@ -160,10 +228,12 @@ 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 3FC8EE2900AF561F89C2BCF1 /* [CP] Embed Pods Frameworks */, 1E16CAB6A2BF5BDB4E80A915 /* [firebase_crashlytics] Crashlytics Upload Symbols */, + 064461112B34C5B1001CD384 /* Embed Foundation Extensions */, ); buildRules = ( ); dependencies = ( + 064461052B34C5B1001CD384 /* PBXTargetDependency */, ); name = Runner; productName = Runner; @@ -176,9 +246,13 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { + LastSwiftUpdateCheck = 1500; LastUpgradeCheck = 1300; ORGANIZATIONNAME = ""; TargetAttributes = { + 064460FB2B34C5B1001CD384 = { + CreatedOnToolsVersion = 15.0.1; + }; 97C146ED1CF9000F007C117D = { CreatedOnToolsVersion = 7.3.1; LastSwiftMigration = 1100; @@ -199,11 +273,20 @@ projectRoot = ""; targets = ( 97C146ED1CF9000F007C117D /* Runner */, + 064460FB2B34C5B1001CD384 /* Share Extension */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + 064460FA2B34C5B1001CD384 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 064461022B34C5B1001CD384 /* MainInterface.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 97C146EC1CF9000F007C117D /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -311,6 +394,14 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 064460F82B34C5B1001CD384 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 064460FF2B34C5B1001CD384 /* ShareViewController.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 97C146EA1CF9000F007C117D /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -322,7 +413,23 @@ }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + 064461052B34C5B1001CD384 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 064460FB2B34C5B1001CD384 /* Share Extension */; + targetProxy = 064461042B34C5B1001CD384 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin PBXVariantGroup section */ + 064461002B34C5B1001CD384 /* MainInterface.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 064461012B34C5B1001CD384 /* Base */, + ); + name = MainInterface.storyboard; + sourceTree = ""; + }; 97C146FA1CF9000F007C117D /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( @@ -402,13 +509,15 @@ isa = XCBuildConfiguration; baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; APP_FLAVOR = staging; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = X7A4X25YGP; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -423,7 +532,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = io.ardrive.app1; + PRODUCT_BUNDLE_IDENTIFIER = io.ardrive.app.test; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -490,13 +599,15 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; APP_FLAVOR = staging; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = X7A4X25YGP; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -511,7 +622,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = io.ardrive.app1; + PRODUCT_BUNDLE_IDENTIFIER = io.ardrive.app.test; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -575,13 +686,15 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; APP_FLAVOR = staging; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = X7A4X25YGP; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -596,7 +709,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = io.ardrive.app1; + PRODUCT_BUNDLE_IDENTIFIER = io.ardrive.app.test; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -605,21 +718,24 @@ }; name = "Profile-staging"; }; - 249021D3217E4FDB00AE95B9 /* Profile-development */ = { + 064461082B34C5B1001CD384 /* Debug-development */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; @@ -632,79 +748,78 @@ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_ENTITLEMENTS = "Share Extension/Share Extension.entitlements"; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = X7A4X25YGP; ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = "Profile-development"; - }; - 249021D4217E4FDB00AE95B9 /* Profile-development */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - APP_FLAVOR = development; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "Share Extension/Info.plist"; + INFOPLIST_KEY_CFBundleDisplayName = "Share Extension"; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", + "@executable_path/../../Frameworks", ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.ardrive.app; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "io.ardrive.app.test.Share-Extension"; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; + TARGETED_DEVICE_FAMILY = "1,2"; }; - name = "Profile-development"; + name = "Debug-development"; }; - 753BD7B528F5D82600774C8B /* Debug-production */ = { + 064461092B34C5B1001CD384 /* Debug-staging */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; @@ -717,14 +832,20 @@ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_ENTITLEMENTS = "Share Extension/Share Extension.entitlements"; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = X7A4X25YGP; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -738,64 +859,51 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = "Debug-production"; - }; - 753BD7B628F5D82600774C8B /* Debug-production */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - APP_FLAVOR = production; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "iPhone Distribution"; - CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = CYW22YFP67; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "Share Extension/Info.plist"; + INFOPLIST_KEY_CFBundleDisplayName = "Share Extension"; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", + "@executable_path/../../Frameworks", ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.ardrive.app; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "io.ardrive.app.test.Share-Extension"; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = "match AdHoc io.ardrive.app"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; + TARGETED_DEVICE_FAMILY = "1,2"; }; - name = "Debug-production"; + name = "Debug-staging"; }; - 753BD7B728F5D82A00774C8B /* Release-production */ = { + 0644610A2B34C5B1001CD384 /* Debug-production */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; @@ -808,81 +916,78 @@ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_ENTITLEMENTS = "Share Extension/Share Extension.entitlements"; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = X7A4X25YGP; ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = "Release-production"; - }; - 753BD7B828F5D82A00774C8B /* Release-production */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - APP_FLAVOR = production; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "iPhone Distribution"; - CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = CYW22YFP67; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "Share Extension/Info.plist"; + INFOPLIST_KEY_CFBundleDisplayName = "Share Extension"; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", + "@executable_path/../../Frameworks", ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.ardrive.app; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "io.ardrive.app.test.Share-Extension"; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = "match AdHoc io.ardrive.app"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; + TARGETED_DEVICE_FAMILY = "1,2"; }; - name = "Release-production"; + name = "Debug-production"; }; - 753BD7B928F5D82E00774C8B /* Profile-production */ = { + 0644610B2B34C5B1001CD384 /* Release-development */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; @@ -895,14 +1000,20 @@ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_ENTITLEMENTS = "Share Extension/Share Extension.entitlements"; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = X7A4X25YGP; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; @@ -910,64 +1021,50 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = "Profile-production"; - }; - 753BD7BA28F5D82E00774C8B /* Profile-production */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - APP_FLAVOR = production; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "Share Extension/Info.plist"; + INFOPLIST_KEY_CFBundleDisplayName = "Share Extension"; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", + "@executable_path/../../Frameworks", ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.ardrive.app; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "io.ardrive.app.test.Share-Extension"; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; }; - name = "Profile-production"; + name = "Release-development"; }; - 97C147031CF9000F007C117D /* Debug-development */ = { + 0644610C2B34C5B1001CD384 /* Release-staging */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; @@ -980,13 +1077,751 @@ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_ENTITLEMENTS = "Share Extension/Share Extension.entitlements"; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = X7A4X25YGP; + ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "Share Extension/Info.plist"; + INFOPLIST_KEY_CFBundleDisplayName = "Share Extension"; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "io.ardrive.app.test.Share-Extension"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = "Release-staging"; + }; + 0644610D2B34C5B1001CD384 /* Release-production */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_ENTITLEMENTS = "Share Extension/Share Extension.entitlements"; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = X7A4X25YGP; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "Share Extension/Info.plist"; + INFOPLIST_KEY_CFBundleDisplayName = "Share Extension"; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "io.ardrive.app.test.Share-Extension"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = "Release-production"; + }; + 0644610E2B34C5B1001CD384 /* Profile-development */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_ENTITLEMENTS = "Share Extension/Share Extension.entitlements"; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = X7A4X25YGP; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "Share Extension/Info.plist"; + INFOPLIST_KEY_CFBundleDisplayName = "Share Extension"; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "io.ardrive.app.test.Share-Extension"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = "Profile-development"; + }; + 0644610F2B34C5B1001CD384 /* Profile-staging */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_ENTITLEMENTS = "Share Extension/Share Extension.entitlements"; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = X7A4X25YGP; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "Share Extension/Info.plist"; + INFOPLIST_KEY_CFBundleDisplayName = "Share Extension"; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "io.ardrive.app.test.Share-Extension"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = "Profile-staging"; + }; + 064461102B34C5B1001CD384 /* Profile-production */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_ENTITLEMENTS = "Share Extension/Share Extension.entitlements"; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = X7A4X25YGP; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "Share Extension/Info.plist"; + INFOPLIST_KEY_CFBundleDisplayName = "Share Extension"; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "io.ardrive.app.test.Share-Extension"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = "Profile-production"; + }; + 249021D3217E4FDB00AE95B9 /* Profile-development */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = "Profile-development"; + }; + 249021D4217E4FDB00AE95B9 /* Profile-development */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + APP_FLAVOR = development; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = X7A4X25YGP; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = io.ardrive.app.test; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = "Profile-development"; + }; + 753BD7B528F5D82600774C8B /* Debug-production */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = "Debug-production"; + }; + 753BD7B628F5D82600774C8B /* Debug-production */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + APP_FLAVOR = production; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = X7A4X25YGP; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = io.ardrive.app.test; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = "Debug-production"; + }; + 753BD7B728F5D82A00774C8B /* Release-production */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = "Release-production"; + }; + 753BD7B828F5D82A00774C8B /* Release-production */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + APP_FLAVOR = production; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = X7A4X25YGP; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = io.ardrive.app.test; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = "Release-production"; + }; + 753BD7B928F5D82E00774C8B /* Profile-production */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = "Profile-production"; + }; + 753BD7BA28F5D82E00774C8B /* Profile-production */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + APP_FLAVOR = production; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = X7A4X25YGP; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = io.ardrive.app.test; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = "Profile-production"; + }; + 97C147031CF9000F007C117D /* Debug-development */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -1066,13 +1901,15 @@ isa = XCBuildConfiguration; baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; APP_FLAVOR = development; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "iPhone Distribution"; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = CYW22YFP67; + DEVELOPMENT_TEAM = X7A4X25YGP; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -1087,9 +1924,9 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = io.ardrive.app; + PRODUCT_BUNDLE_IDENTIFIER = io.ardrive.app.test; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = "match AdHoc io.ardrive.app"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; @@ -1101,13 +1938,15 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; APP_FLAVOR = development; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "iPhone Distribution"; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = CYW22YFP67; + DEVELOPMENT_TEAM = X7A4X25YGP; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -1122,9 +1961,9 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = io.ardrive.app; + PRODUCT_BUNDLE_IDENTIFIER = io.ardrive.app.test; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = "match AdHoc io.ardrive.app"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; @@ -1134,6 +1973,22 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 064461072B34C5B1001CD384 /* Build configuration list for PBXNativeTarget "Share Extension" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 064461082B34C5B1001CD384 /* Debug-development */, + 064461092B34C5B1001CD384 /* Debug-staging */, + 0644610A2B34C5B1001CD384 /* Debug-production */, + 0644610B2B34C5B1001CD384 /* Release-development */, + 0644610C2B34C5B1001CD384 /* Release-staging */, + 0644610D2B34C5B1001CD384 /* Release-production */, + 0644610E2B34C5B1001CD384 /* Profile-development */, + 0644610F2B34C5B1001CD384 /* Profile-staging */, + 064461102B34C5B1001CD384 /* Profile-production */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = "Release-development"; + }; 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift index 36e7207e67..13effb5f1e 100644 --- a/ios/Runner/AppDelegate.swift +++ b/ios/Runner/AppDelegate.swift @@ -24,6 +24,13 @@ import flutter_downloader result(flavor) }) + let sharingIntent = SwiftFlutterSharingIntentPlugin.instance + /// if the url is made from SwiftFlutterSharingIntentPlugin then handle it with plugin [SwiftFlutterSharingIntentPlugin] + if sharingIntent.hasSameSchemePrefix(url: url) { + return sharingIntent.application(app, open: url, options: options) + } + + return super.application(application, didFinishLaunchingWithOptions: launchOptions) } } diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 200a6115c2..2d9a6206ae 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -4,6 +4,8 @@ AppFlavor $(APP_FLAVOR) + AppGroupId + $(CUSTOM_GROUP_ID) CADisableMinimumFrameDurationOnPhone CFBundleDevelopmentRegion @@ -24,6 +26,17 @@ $(FLUTTER_BUILD_NAME) CFBundleSignature ???? + CFBundleURLTypes + + + CFBundleTypeRole + Editor + CFBundleURLSchemes + + SharingMedia-$(PRODUCT_BUNDLE_IDENTIFIER) + + + CFBundleVersion $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS diff --git a/ios/Runner/Runner.entitlements b/ios/Runner/Runner.entitlements new file mode 100644 index 0000000000..ae2d29e2ca --- /dev/null +++ b/ios/Runner/Runner.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.application-groups + + group.io.ardrive.app.test + + + diff --git a/ios/Share Extension/Base.lproj/MainInterface.storyboard b/ios/Share Extension/Base.lproj/MainInterface.storyboard new file mode 100644 index 0000000000..286a50894d --- /dev/null +++ b/ios/Share Extension/Base.lproj/MainInterface.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Share Extension/Info.plist b/ios/Share Extension/Info.plist new file mode 100644 index 0000000000..0c67376eba --- /dev/null +++ b/ios/Share Extension/Info.plist @@ -0,0 +1,5 @@ + + + + + diff --git a/ios/Share Extension/Share Extension.entitlements b/ios/Share Extension/Share Extension.entitlements new file mode 100644 index 0000000000..ae2d29e2ca --- /dev/null +++ b/ios/Share Extension/Share Extension.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.application-groups + + group.io.ardrive.app.test + + + diff --git a/ios/Share Extension/ShareViewController.swift b/ios/Share Extension/ShareViewController.swift new file mode 100644 index 0000000000..cc88569cab --- /dev/null +++ b/ios/Share Extension/ShareViewController.swift @@ -0,0 +1,363 @@ +import UIKit +import Social +import MobileCoreServices +import Photos +import UniformTypeIdentifiers +import AVFoundation +import ImageIO + +@objc(ShareViewController) +class ShareViewController: UIViewController { + // TODO: IMPORTANT: This should be your host app bundle identifier + var hostAppBundleIdentifier = "io.ardrive.app.test" + let sharedKey = "SharingKey" + var appGroupId = "" + var sharedMedia: [SharingFile] = [] + var sharedText: [String] = [] + + let imageContentType = UTType.image.identifier; + let videoContentType = UTType.movie.identifier; + let textContentType = UTType.text.identifier; + let urlContentType = UTType.url.identifier; + let fileURLType = UTType.fileURL.identifier; + + override func viewDidLoad() { + super.viewDidLoad() + // load group and app id from build info + loadIds(); + + } + + private func loadIds() { + + // loading Share extension App Id + let shareExtensionAppBundleIdentifier = Bundle.main.bundleIdentifier!; + + + // convert ShareExtension id to host app id + // By default it is remove last part of id after last point + // For example: com.test.ShareExtension -> com.test + let lastIndexOfPoint = shareExtensionAppBundleIdentifier.lastIndex(of: "."); + hostAppBundleIdentifier = String(shareExtensionAppBundleIdentifier[.. + appGroupId = (Bundle.main.object(forInfoDictionaryKey: "AppGroupId") as? String) ?? "group.\(hostAppBundleIdentifier)"; + } + + override func viewDidAppear(_ animated: Bool) { + + super.viewDidAppear(animated) + // This will called after the user selects app from sharing app list. + handleImageAttachment() + + } + + func handleImageAttachment(){ + if let content = self.extensionContext?.inputItems.first as? NSExtensionItem { + if let contents = content.attachments { + for (index, attachment) in (contents).enumerated() { + if attachment.isImage { + handleImages(content: content, attachment: attachment, index: index) + } else if attachment.isMovie { + handleVideos(content: content, attachment: attachment, index: index) + } + else if attachment.isFile { + handleFiles(content: content, attachment: attachment, index: index) + } + else if attachment.isURL { + handleUrl(content: content, attachment: attachment, index: index) + } + else if attachment.isText { + handleText(content: content, attachment: attachment, index: index) + } else { + print(" \(attachment) File type is not supported by flutter shaing plugin.") + } + + } + } + } + + } + + + private func handleText (content: NSExtensionItem, attachment: NSItemProvider, index: Int) { + attachment.loadItem(forTypeIdentifier: textContentType, options: nil) { [weak self] data, error in + + if error == nil, let item = data as? String, let this = self { + + this.sharedText.append(item) + + // If this is the last item, save imagesData in userDefaults and redirect to host app + if index == (content.attachments?.count)! - 1 { + let userDefaults = UserDefaults(suiteName: this.appGroupId) + userDefaults?.set(this.sharedText, forKey: this.sharedKey) + userDefaults?.synchronize() + this.redirectToHostApp(type: .text) + } + + } else { + self?.dismissWithError() + } + } + } + + private func handleUrl (content: NSExtensionItem, attachment: NSItemProvider, index: Int) { + attachment.loadItem(forTypeIdentifier: urlContentType, options: nil) { [weak self] data, error in + + if error == nil, let item = data as? URL, let this = self { + + this.sharedText.append(item.absoluteString) + + // If this is the last item, save imagesData in userDefaults and redirect to host app + if index == (content.attachments?.count)! - 1 { + let userDefaults = UserDefaults(suiteName: this.appGroupId) + userDefaults?.set(this.sharedText, forKey: this.sharedKey) + userDefaults?.synchronize() + this.redirectToHostApp(type: .url) + } + + } else { + self?.dismissWithError() + } + } + } + + private func handleImages (content: NSExtensionItem, attachment: NSItemProvider, index: Int) { + + attachment.loadItem(forTypeIdentifier: imageContentType, options: nil) { [weak self] data, error in + if error == nil, let url = data as? URL, let this = self { + // Always copy + let fileName = this.getFileName(from: url, type: .image) + let newPath = FileManager.default + .containerURL(forSecurityApplicationGroupIdentifier: this.appGroupId)! + .appendingPathComponent(fileName) + let copied = this.copyFile(at: url, to: newPath) + if(copied) { + this.sharedMedia.append(SharingFile(value: newPath.absoluteString, thumbnail: nil, duration: nil, type: .image)) + } + + // If this is the last item, save imagesData in userDefaults and redirect to host app + if index == (content.attachments?.count)! - 1 { + let userDefaults = UserDefaults(suiteName: this.appGroupId) + userDefaults?.set(this.toData(data: this.sharedMedia), forKey: this.sharedKey) + userDefaults?.synchronize() + this.redirectToHostApp(type: .media) + } + + } else { + self?.dismissWithError() + } + } + } + + private func handleVideos (content: NSExtensionItem, attachment: NSItemProvider, index: Int) { + attachment.loadItem(forTypeIdentifier: videoContentType, options: nil) { [weak self] data, error in + + if error == nil, let url = data as? URL, let this = self { + + // Always copy + let fileName = this.getFileName(from: url, type: .video) + let newPath = FileManager.default + .containerURL(forSecurityApplicationGroupIdentifier:this.appGroupId)! + .appendingPathComponent(fileName) + let copied = this.copyFile(at: url, to: newPath) + if(copied) { + guard let sharedFile = this.getSharedMediaFile(forVideo: newPath) else { + return + } + this.sharedMedia.append(sharedFile) + } + + // If this is the last item, save imagesData in userDefaults and redirect to host app + if index == (content.attachments?.count)! - 1 { + let userDefaults = UserDefaults(suiteName: this.appGroupId) + userDefaults?.set(this.toData(data: this.sharedMedia), forKey: this.sharedKey) + userDefaults?.synchronize() + this.redirectToHostApp(type: .media) + } + + } else { + self?.dismissWithError() + } + } + } + + private func handleFiles (content: NSExtensionItem, attachment: NSItemProvider, index: Int) { + attachment.loadItem(forTypeIdentifier: fileURLType, options: nil) { [weak self] data, error in + + if error == nil, let url = data as? URL, let this = self { + + // Always copy + let fileName = this.getFileName(from :url, type: .file) + let newPath = FileManager.default + .containerURL(forSecurityApplicationGroupIdentifier: this.appGroupId)! + .appendingPathComponent(fileName) + let copied = this.copyFile(at: url, to: newPath) + if (copied) { + this.sharedMedia.append(SharingFile(value: newPath.absoluteString, thumbnail: nil, duration: nil, type: .file)) + } + + if index == (content.attachments?.count)! - 1 { + let userDefaults = UserDefaults(suiteName:this.appGroupId) + userDefaults?.set(this.toData(data: this.sharedMedia), forKey: this.sharedKey) + userDefaults?.synchronize() + this.redirectToHostApp(type: .file) + } + + } else { + self?.dismissWithError() + } + } + } + + private func dismissWithError() { + print("[ERROR] Error loading data!") + let alert = UIAlertController(title: "Error", message: "Error loading data", preferredStyle: .alert) + + let action = UIAlertAction(title: "Error", style: .cancel) { _ in + self.dismiss(animated: true, completion: nil) + } + + alert.addAction(action) + present(alert, animated: true, completion: nil) + extensionContext!.completeRequest(returningItems: [], completionHandler: nil) + } + + private func redirectToHostApp(type: RedirectType) { + // load group and app id from build info + loadIds(); + let url = URL(string: "SharingMedia-\(hostAppBundleIdentifier)://dataUrl=\(sharedKey)#\(type)") + var responder = self as UIResponder? + let selectorOpenURL = sel_registerName("openURL:") + + while (responder != nil) { + if (responder?.responds(to: selectorOpenURL))! { + let _ = responder?.perform(selectorOpenURL, with: url) + } + responder = responder!.next + } + extensionContext!.completeRequest(returningItems: [], completionHandler: nil) + } + + enum RedirectType { + case media + case text + case file + case url + } + + func getExtension(from url: URL, type: SharingFileType) -> String { + let parts = url.lastPathComponent.components(separatedBy: ".") + var ex: String? = nil + if (parts.count > 1) { + ex = parts.last + } + + if (ex == nil) { + switch type { + case .image: + ex = "PNG" + case .video: + ex = "MP4" + case .file: + ex = "TXT" + case .text: + ex = "TXT" + case .url: + ex = "TXT" + } + } + return ex ?? "Unknown" + } + + func getFileName(from url: URL, type: SharingFileType) -> String { + var name = url.lastPathComponent + + if (name.isEmpty) { + name = UUID().uuidString + "." + getExtension(from: url, type: type) + } + + return name + } + + func copyFile(at srcURL: URL, to dstURL: URL) -> Bool { + do { + if FileManager.default.fileExists(atPath: dstURL.path) { + try FileManager.default.removeItem(at: dstURL) + } + try FileManager.default.copyItem(at: srcURL, to: dstURL) + } catch (let error) { + print("Cannot copy item at \(srcURL) to \(dstURL): \(error)") + return false + } + return true + } + + private func getSharedMediaFile(forVideo: URL) -> SharingFile? { + let asset = AVAsset(url: forVideo) + let duration = (CMTimeGetSeconds(asset.duration) * 1000).rounded() + let thumbnailPath = getThumbnailPath(for: forVideo) + + if FileManager.default.fileExists(atPath: thumbnailPath.path) { + return SharingFile(value: forVideo.absoluteString, thumbnail: thumbnailPath.absoluteString, duration: duration, type: .video) + } + + var saved = false + let assetImgGenerate = AVAssetImageGenerator(asset: asset) + assetImgGenerate.appliesPreferredTrackTransform = true + // let scale = UIScreen.main.scale + assetImgGenerate.maximumSize = CGSize(width: 360, height: 360) + do { + let img = try assetImgGenerate.copyCGImage(at: CMTimeMakeWithSeconds(600, preferredTimescale: Int32(1.0)), actualTime: nil) + try UIImage.pngData(UIImage(cgImage: img))()?.write(to: thumbnailPath) + saved = true + } catch { + saved = false + } + + return saved ? SharingFile(value: forVideo.absoluteString, thumbnail: thumbnailPath.absoluteString, duration: duration, type: .video) : nil + + } + + private func getThumbnailPath(for url: URL) -> URL { + let fileName = Data(url.lastPathComponent.utf8).base64EncodedString().replacingOccurrences(of: "==", with: "") + let path = FileManager.default + .containerURL(forSecurityApplicationGroupIdentifier:appGroupId)! + .appendingPathComponent("\(fileName).jpg") + return path + } + + func toData(data: [SharingFile]) -> Data { + let encodedData = try? JSONEncoder().encode(data) + return encodedData! + } + } + + extension Array { + subscript (safe index: UInt) -> Element? { + return Int(index) < count ? self[Int(index)] : nil + } + + } + +// MARK: - Attachment Types +extension NSItemProvider { + var isImage: Bool { + return hasItemConformingToTypeIdentifier(UTType.image.identifier) + } + + var isMovie: Bool { + return hasItemConformingToTypeIdentifier(UTType.movie.identifier) + } + + var isText: Bool { + return hasItemConformingToTypeIdentifier(UTType.text.identifier) + } + + var isURL: Bool { + return hasItemConformingToTypeIdentifier(UTType.url.identifier) + } + var isFile: Bool { + return hasItemConformingToTypeIdentifier(UTType.fileURL.identifier) + } +} \ No newline at end of file diff --git a/ios/Share Extension/SharingFile.swift b/ios/Share Extension/SharingFile.swift new file mode 100644 index 0000000000..1dd36d4487 --- /dev/null +++ b/ios/Share Extension/SharingFile.swift @@ -0,0 +1,26 @@ +import Foundation + +class SharingFile: Codable { + var value: String; + var thumbnail: String?; // video thumbnail + var duration: Double?; // video duration in milliseconds + var type: SharingFileType; + + + init(value: String, thumbnail: String?, duration: Double?, type: SharingFileType) { + self.value = value + self.thumbnail = thumbnail + self.duration = duration + self.type = type + } + + // toString method to print out SharingFile details in the console + func toString() { + print("[SharingFile] \n\tvalue: \(self.value)\n\tthumbnail: \(self.thumbnail ?? "--" )\n\tduration: \(self.duration ?? 0)\n\ttype: \(self.type)") + } + + func toData(data: [SharingFile]) -> Data { + let encodedData = try? JSONEncoder().encode(data) + return encodedData! + } +} \ No newline at end of file diff --git a/ios/Share Extension/SharingFileType.swift b/ios/Share Extension/SharingFileType.swift new file mode 100644 index 0000000000..5138472094 --- /dev/null +++ b/ios/Share Extension/SharingFileType.swift @@ -0,0 +1,8 @@ + +enum SharingFileType: Int, Codable { + case text + case url + case image + case video + case file +} \ No newline at end of file diff --git a/lib/blocs/drive_detail/drive_detail_cubit.dart b/lib/blocs/drive_detail/drive_detail_cubit.dart index f0f7fcc3d8..afa29034b1 100644 --- a/lib/blocs/drive_detail/drive_detail_cubit.dart +++ b/lib/blocs/drive_detail/drive_detail_cubit.dart @@ -120,7 +120,8 @@ class DriveDetailCubit extends Cubit { orderingMode: contentOrderingMode, ), _profileCubit.stream.startWith(ProfileCheckingAvailability()), - (drive, folderContents, _) async { + (drive, + folderContents, _) async { if (_activityTracker.isUploading) { return; } diff --git a/lib/blocs/sync/sync_cubit.dart b/lib/blocs/sync/sync_cubit.dart index ce3d71c798..7fb5384a8b 100644 --- a/lib/blocs/sync/sync_cubit.dart +++ b/lib/blocs/sync/sync_cubit.dart @@ -68,6 +68,8 @@ class SyncCubit extends Cubit { late DateTime _initSync; late SyncProgress _syncProgress; + bool _blockSync = true; + SyncCubit({ required ProfileCubit profileCubit, required ActivityCubit activityCubit, @@ -85,6 +87,13 @@ class SyncCubit extends Cubit { _configService = configService, _tabVisibility = tabVisibility, super(SyncIdle()) { + if (_blockSync) { + Future.delayed(Duration(seconds: 1000), () { + _blockSync = false; + // startSync(); + }); + return; + } // Sync the user's drives on start and periodically. createSyncStream(); restartSyncOnFocus(); diff --git a/lib/components/upload_form.dart b/lib/components/upload_form.dart index 035261b5b7..de8082edba 100644 --- a/lib/components/upload_form.dart +++ b/lib/components/upload_form.dart @@ -43,34 +43,46 @@ Future promptToUpload( required String driveId, required String parentFolderId, required bool isFolderUpload, + List? files, }) async { final selectedFiles = []; final io = ArDriveIO(); IOFolder? ioFolder; - if (isFolderUpload) { - ioFolder = await io.pickFolder(); - final ioFiles = await ioFolder.listFiles(); - final uploadFiles = ioFiles.map((file) { + + if (files == null) { + if (isFolderUpload) { + ioFolder = await io.pickFolder(); + final ioFiles = await ioFolder.listFiles(); + final uploadFiles = ioFiles.map((file) { + return UploadFile( + ioFile: file, + parentFolderId: parentFolderId, + relativeTo: ioFolder!.path.isEmpty ? null : getDirname(ioFolder.path), + ); + }).toList(); + selectedFiles.addAll(uploadFiles); + } else { + // Display multiple options on Mobile + // Open file picker on Web + final ioFiles = kIsWeb + ? await io.pickFiles(fileSource: FileSource.fileSystem) + // ignore: use_build_context_synchronously + : await showMultipleFilesFilePickerModal(context); + + final uploadFiles = ioFiles + .map((file) => + UploadFile(ioFile: file, parentFolderId: parentFolderId)) + .toList(); + + selectedFiles.addAll(uploadFiles); + } + } else { + selectedFiles.addAll(files.map((file) { return UploadFile( ioFile: file, parentFolderId: parentFolderId, - relativeTo: ioFolder!.path.isEmpty ? null : getDirname(ioFolder.path), ); - }).toList(); - selectedFiles.addAll(uploadFiles); - } else { - // Display multiple options on Mobile - // Open file picker on Web - final ioFiles = kIsWeb - ? await io.pickFiles(fileSource: FileSource.fileSystem) - // ignore: use_build_context_synchronously - : await showMultipleFilesFilePickerModal(context); - - final uploadFiles = ioFiles - .map((file) => UploadFile(ioFile: file, parentFolderId: parentFolderId)) - .toList(); - - selectedFiles.addAll(uploadFiles); + })); } // ignore: use_build_context_synchronously @@ -911,7 +923,7 @@ class _UploadFormState extends State { status = 'Complete'; break; case UploadStatus.failed: - status = 'Failed'; + status = ''; break; case UploadStatus.preparationDone: status = 'Preparation done'; diff --git a/lib/main.dart b/lib/main.dart index 257528bfd1..8026ac5eb5 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -11,6 +11,7 @@ import 'package:ardrive/core/crypto/crypto.dart'; import 'package:ardrive/models/database/database_helpers.dart'; import 'package:ardrive/services/authentication/biometric_authentication.dart'; import 'package:ardrive/services/config/config_fetcher.dart'; +import 'package:ardrive/sharing/blocs/sharing_file_bloc.dart'; import 'package:ardrive/theme/theme_switcher_bloc.dart'; import 'package:ardrive/theme/theme_switcher_state.dart'; import 'package:ardrive/turbo/services/payment_service.dart'; @@ -255,6 +256,7 @@ class AppState extends State { themeDetector: ThemeDetector(), ), ), + BlocProvider(create: (_) => SharingFileBloc()), ], child: ArDriveDevToolsShortcuts( child: KeyboardHandler( diff --git a/lib/models/daos/drive_dao/folder_node.dart b/lib/models/daos/drive_dao/folder_node.dart index 509b0171e4..d76640b604 100644 --- a/lib/models/daos/drive_dao/folder_node.dart +++ b/lib/models/daos/drive_dao/folder_node.dart @@ -54,6 +54,15 @@ class FolderNode { return totalSize; } + // recursive FolderEntries + List getRecursiveFolders() { + final totalFolders = [folder]; + for (final subfolder in subfolders) { + totalFolders.addAll(subfolder.getRecursiveFolders()); + } + return totalFolders; + } + // TODO: maxDepth slider in story ticket PE-1069 List getRecursiveFiles(/*{maxDepth = 2000000}*/) { // if (maxDepth == -1) { diff --git a/lib/pages/drive_detail/components/drive_explorer_item_tile.dart b/lib/pages/drive_detail/components/drive_explorer_item_tile.dart index a7ede0094b..fa0138fb51 100644 --- a/lib/pages/drive_detail/components/drive_explorer_item_tile.dart +++ b/lib/pages/drive_detail/components/drive_explorer_item_tile.dart @@ -112,10 +112,15 @@ class DriveExplorerItemTileLeading extends StatelessWidget { } } -ArDriveIcon getIconForContentType(String contentType, {double size = 18}) { +ArDriveIcon getIconForContentType( + String contentType, { + double size = 18, + Color? color, +}) { if (contentType == 'folder') { return ArDriveIcons.folderOutline( size: size, + color: color, ); } else if (FileTypeHelper.isZip(contentType)) { return ArDriveIcons.zip( diff --git a/lib/pages/drive_detail/drive_detail_page.dart b/lib/pages/drive_detail/drive_detail_page.dart index ed4a5a67cf..3bfa1e8bdf 100644 --- a/lib/pages/drive_detail/drive_detail_page.dart +++ b/lib/pages/drive_detail/drive_detail_page.dart @@ -27,6 +27,7 @@ import 'package:ardrive/pages/drive_detail/components/file_icon.dart'; import 'package:ardrive/pages/drive_detail/components/hover_widget.dart'; import 'package:ardrive/pages/drive_detail/components/unpreviewable_content.dart'; import 'package:ardrive/services/services.dart'; +import 'package:ardrive/sharing/sharing_file_listener.dart'; import 'package:ardrive/theme/theme.dart'; import 'package:ardrive/utils/app_localizations_wrapper.dart'; import 'package:ardrive/utils/compare_alphabetically_and_natural.dart'; @@ -89,36 +90,21 @@ class _DriveDetailPageState extends State { @override Widget build(BuildContext context) { - return SizedBox.expand( - child: BlocBuilder( - builder: (context, driveDetailState) { - if (driveDetailState is DriveDetailLoadInProgress) { - return const Center(child: CircularProgressIndicator()); - } else if (driveDetailState is DriveInitialLoading) { - return ScreenTypeLayout.builder( - mobile: (context) { - return Scaffold( - drawerScrimColor: Colors.transparent, - drawer: const AppSideBar(), - appBar: const MobileAppBar(), - body: Padding( - padding: const EdgeInsets.all(8.0), - child: Center( - child: Text( - appLocalizationsOf(context) - .driveDoingInitialSetupMessage, - style: ArDriveTypography.body.buttonLargeBold(), - ), - ), - ), - ); - }, - desktop: (context) => Scaffold( - drawerScrimColor: Colors.transparent, - body: Column( - children: [ - const AppTopBar(), - Expanded( + return SharingFileListener( + child: SizedBox.expand( + child: BlocBuilder( + builder: (context, driveDetailState) { + if (driveDetailState is DriveDetailLoadInProgress) { + return const Center(child: CircularProgressIndicator()); + } else if (driveDetailState is DriveInitialLoading) { + return ScreenTypeLayout.builder( + mobile: (context) { + return Scaffold( + drawerScrimColor: Colors.transparent, + drawer: const AppSideBar(), + appBar: const MobileAppBar(), + body: Padding( + padding: const EdgeInsets.all(8.0), child: Center( child: Text( appLocalizationsOf(context) @@ -127,60 +113,77 @@ class _DriveDetailPageState extends State { ), ), ), - ], + ); + }, + desktop: (context) => Scaffold( + drawerScrimColor: Colors.transparent, + body: Column( + children: [ + const AppTopBar(), + Expanded( + child: Center( + child: Text( + appLocalizationsOf(context) + .driveDoingInitialSetupMessage, + style: ArDriveTypography.body.buttonLargeBold(), + ), + ), + ), + ], + ), ), - ), - ); - } else if (driveDetailState is DriveDetailLoadSuccess) { - final hasSubfolders = - driveDetailState.folderInView.subfolders.isNotEmpty; + ); + } else if (driveDetailState is DriveDetailLoadSuccess) { + final hasSubfolders = + driveDetailState.folderInView.subfolders.isNotEmpty; - final isOwner = isDriveOwner( - context.read(), - driveDetailState.currentDrive.ownerAddress, - ); + final isOwner = isDriveOwner( + context.read(), + driveDetailState.currentDrive.ownerAddress, + ); - final hasFiles = driveDetailState.folderInView.files.isNotEmpty; + final hasFiles = driveDetailState.folderInView.files.isNotEmpty; - final canDownloadMultipleFiles = driveDetailState.multiselect && - context.read().selectedItems.isNotEmpty; + final canDownloadMultipleFiles = driveDetailState.multiselect && + context.read().selectedItems.isNotEmpty; - return ScreenTypeLayout.builder( - desktop: (context) => _desktopView( - isDriveOwner: isOwner, - driveDetailState: driveDetailState, - hasSubfolders: hasSubfolders, - hasFiles: hasFiles, - canDownloadMultipleFiles: canDownloadMultipleFiles, - ), - mobile: (context) => Scaffold( - drawerScrimColor: Colors.transparent, - drawer: const AppSideBar(), - appBar: (driveDetailState.showSelectedItemDetails && - context.read().selectedItem != null) - ? MobileAppBar( - leading: ArDriveIconButton( - icon: ArDriveIcons.arrowLeft(), - onPressed: () { - context - .read() - .toggleSelectedItemDetails(); - }, - ), - ) - : null, - body: _mobileView( - driveDetailState, - hasSubfolders, - hasFiles, - driveDetailState.currentFolderContents, + return ScreenTypeLayout.builder( + desktop: (context) => _desktopView( + isDriveOwner: isOwner, + driveDetailState: driveDetailState, + hasSubfolders: hasSubfolders, + hasFiles: hasFiles, + canDownloadMultipleFiles: canDownloadMultipleFiles, ), - ), - ); - } else { - return const SizedBox(); - } - }, + mobile: (context) => Scaffold( + drawerScrimColor: Colors.transparent, + drawer: const AppSideBar(), + appBar: (driveDetailState.showSelectedItemDetails && + context.read().selectedItem != null) + ? MobileAppBar( + leading: ArDriveIconButton( + icon: ArDriveIcons.arrowLeft(), + onPressed: () { + context + .read() + .toggleSelectedItemDetails(); + }, + ), + ) + : null, + body: _mobileView( + driveDetailState, + hasSubfolders, + hasFiles, + driveDetailState.currentFolderContents, + ), + ), + ); + } else { + return const SizedBox(); + } + }, + ), ), ); } diff --git a/lib/sharing/blocs/sharing_file_bloc.dart b/lib/sharing/blocs/sharing_file_bloc.dart new file mode 100644 index 0000000000..77e5c24093 --- /dev/null +++ b/lib/sharing/blocs/sharing_file_bloc.dart @@ -0,0 +1,45 @@ +import 'package:ardrive_io/ardrive_io.dart'; +import 'package:bloc/bloc.dart'; +import 'package:equatable/equatable.dart'; +import 'package:flutter_sharing_intent/flutter_sharing_intent.dart'; +import 'package:flutter_sharing_intent/model/sharing_file.dart'; +import 'package:share_plus/share_plus.dart'; + +part 'sharing_file_event.dart'; +part 'sharing_file_state.dart'; + +class SharingFileBloc extends Bloc { + List? files; + + SharingFileBloc() : super(SharingFileInitial()) { + // For sharing images coming from outside the app while the app is in the memory + + // For sharing images coming from outside the app while the app is closed + FlutterSharingIntent.instance + .getInitialSharing() + .then((List value) { + if (value.isNotEmpty) { + add(SharingFileReceived(value)); + } + }); + + on((event, emit) async { + if (event is SharingFileReceived) { + files = event.files; + final ioFiles = []; + + IOFileAdapter ioFileAdapter = IOFileAdapter(); + + for (final file in files!) { + ioFiles.add(await ioFileAdapter.fromXFile(XFile(file.value!))); + } + + emit(SharingFileReceivedState(ioFiles)); + } else if (event is SharingFileCleared) { + files = null; + } else if (event is ShowSharingFile) { + // emit(SharingFileReceivedState(files!)); + } + }); + } +} diff --git a/lib/sharing/blocs/sharing_file_event.dart b/lib/sharing/blocs/sharing_file_event.dart new file mode 100644 index 0000000000..9957579202 --- /dev/null +++ b/lib/sharing/blocs/sharing_file_event.dart @@ -0,0 +1,21 @@ +part of 'sharing_file_bloc.dart'; + +sealed class SharingFileEvent extends Equatable { + const SharingFileEvent(); + + @override + List get props => []; +} + +class SharingFileReceived extends SharingFileEvent { + final List files; + + const SharingFileReceived(this.files); + + @override + List get props => [files]; +} + +class ShowSharingFile extends SharingFileEvent {} + +class SharingFileCleared extends SharingFileEvent {} diff --git a/lib/sharing/blocs/sharing_file_state.dart b/lib/sharing/blocs/sharing_file_state.dart new file mode 100644 index 0000000000..4c49f9cc7b --- /dev/null +++ b/lib/sharing/blocs/sharing_file_state.dart @@ -0,0 +1,21 @@ +part of 'sharing_file_bloc.dart'; + +sealed class SharingFileState extends Equatable { + const SharingFileState(); + + @override + List get props => []; +} + +final class SharingFileInitial extends SharingFileState {} + +final class SharingFileReceivedState extends SharingFileState { + final List files; + + const SharingFileReceivedState(this.files); + + @override + List get props => [files]; +} + +final class SharingFileClearedState extends SharingFileState {} diff --git a/lib/sharing/folder_selector/folder_selector.dart b/lib/sharing/folder_selector/folder_selector.dart new file mode 100644 index 0000000000..df7afa342c --- /dev/null +++ b/lib/sharing/folder_selector/folder_selector.dart @@ -0,0 +1,246 @@ +import 'package:ardrive/models/drive.dart'; +import 'package:ardrive/pages/drive_detail/components/drive_explorer_item_tile.dart'; +import 'package:ardrive/sharing/folder_selector/folder_selector_bloc.dart'; +import 'package:ardrive_ui/ardrive_ui.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; + +class FolderSelector extends StatefulWidget { + const FolderSelector({super.key, required this.onSelect}); + + final Function(String driveId, String folderId) onSelect; + + @override + State createState() => _FolderSelectorState(); +} + +class _FolderSelectorState extends State { + @override + void initState() { + super.initState(); + context.read().add(LoadDrivesEvent()); + } + + @override + Widget build(BuildContext context) { + return BlocConsumer( + listener: (context, state) { + if (state is FolderSelectedState) { + widget.onSelect(state.folder, state.driveId); + } + }, + builder: (context, state) { + String title; + String description = ''; + Widget content; + final colors = ArDriveTheme.of(context).themeData.colors; + final actions = []; + if (state is SelectingDriveState) { + final publicDrives = + state.drives.where((drive) => !drive.isPrivate).toList(); + final privateDrives = + state.drives.where((drive) => drive.isPrivate).toList(); + title = 'Select Drive'; + description = 'Select the drive you want to upload to'; + content = SizedBox( + width: 200, + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (publicDrives.isNotEmpty) ...[ + Text( + 'Public Drives', + style: ArDriveTypography.body.buttonLargeBold(), + ), + const Divider(), + ListView.builder( + padding: EdgeInsets.zero, + physics: const NeverScrollableScrollPhysics(), + itemCount: publicDrives.length, + shrinkWrap: true, + itemBuilder: (context, index) { + final color = state.selectedDrive == null + ? null + : state.selectedDrive != null + ? publicDrives[index].id == + state.selectedDrive!.id + ? null + : colors.themeAccentDisabled + : null; + return ListTile( + leading: ArDriveIcons.addDrive( + color: color, + ), + title: Text( + state.drives[index].name, + style: ArDriveTypography.body + .buttonLargeBold( + color: color, + ) + .copyWith( + fontWeight: state.selectedDrive?.id == + state.drives[index].id + ? FontWeight.w700 + : null, + ), + ), + onTap: () { + context + .read() + .add(SelectDriveEvent(state.drives[index])); + }, + ); + }, + ), + ], + if (privateDrives.isNotEmpty) ...[ + const SizedBox(height: 16), + Text( + 'Private Drives', + style: ArDriveTypography.body.buttonLargeBold(), + ), + const Divider(), + ListView.builder( + padding: EdgeInsets.zero, + physics: const NeverScrollableScrollPhysics(), + itemCount: privateDrives.length, + shrinkWrap: true, + itemBuilder: (context, index) { + final color = state.selectedDrive == null + ? null + : state.selectedDrive != null + ? privateDrives[index].id == + state.selectedDrive!.id + ? null + : colors.themeAccentDisabled + : null; + return ListTile( + leading: ArDriveIcons.addDrive( + color: color, + ), + title: Text( + state.drives[index].name, + style: ArDriveTypography.body + .buttonLargeBold( + color: color, + ) + .copyWith( + fontWeight: state.selectedDrive?.id == + state.drives[index].id + ? FontWeight.w700 + : null, + ), + ), + onTap: () { + context + .read() + .add(SelectDriveEvent(state.drives[index])); + }, + ); + }, + ), + ] + ], + ), + ), + ); + actions.add( + ModalAction( + title: 'Cancel', + action: () { + Navigator.of(context).pop(); + }, + ), + ); + + actions.add( + ModalAction( + isEnable: state.selectedDrive != null, + title: 'Confirm', + action: () { + context + .read() + .add(ConfirmDriveEvent(state.selectedDrive!)); + }, + ), + ); + } else if (state is SelectingFolderState) { + title = 'Select Folder'; + description = 'Select the folder you want to upload to'; + content = ListView.builder( + itemCount: state.folders.length, + shrinkWrap: true, + itemBuilder: (context, index) { + final color = state.selectedFolder == null + ? null + : state.selectedFolder != null + ? state.folders[index].id == state.selectedFolder!.id + ? null + : colors.themeAccentDisabled + : null; + return SizedBox( + width: 200, + child: ListTile( + leading: + getIconForContentType('folder', color: color, size: 24), + title: Text( + state.folders[index].name, + style: ArDriveTypography.body + .buttonLargeBold( + color: color, + ) + .copyWith( + fontWeight: state.selectedFolder?.id == + state.folders[index].id + ? FontWeight.w700 + : null), + ), + onTap: () { + context + .read() + .add(SelectFolderEvent(state.folders[index])); + }, + ), + ); + }, + ); + + actions.addAll([ + ModalAction( + title: 'Back', + action: () { + context.read().add(SelectDriveEvent( + context.read().selectedDrive!)); + }, + ), + ModalAction( + isEnable: state.selectedFolder != null, + title: 'Upload', + action: () { + context + .read() + .add(ConfirmFolderEvent(state.selectedFolder!)); + Navigator.of(context).pop(); + }, + ), + ]); + } else { + title = 'Loading'; + content = const Center(child: CircularProgressIndicator()); + } + + return ArDriveStandardModal( + title: title, + description: description, + actions: actions, + content: SizedBox( + height: 400, + width: 200, + child: content, + ), + ); + }, + ); + } +} diff --git a/lib/sharing/folder_selector/folder_selector_bloc.dart b/lib/sharing/folder_selector/folder_selector_bloc.dart new file mode 100644 index 0000000000..90763ea210 --- /dev/null +++ b/lib/sharing/folder_selector/folder_selector_bloc.dart @@ -0,0 +1,47 @@ +import 'package:ardrive/models/daos/daos.dart'; +import 'package:ardrive/models/database/database.dart'; +import 'package:bloc/bloc.dart'; +import 'package:equatable/equatable.dart'; + +part 'folder_selector_event.dart'; +part 'folder_selector_state.dart'; + +class FolderSelectorBloc + extends Bloc { + final DriveDao driveDao; + Drive? selectedDrive; + List drives = []; + FolderSelectorBloc( + this.driveDao, + ) : super(LoadingDrivesState()) { + on((event, emit) async { + if (event is LoadDrivesEvent) { + drives = await driveDao.allDrives().get(); + + emit(SelectingDriveState(drives: drives)); + } else if (event is SelectDriveEvent) { + emit( + SelectingDriveState( + drives: drives, + selectedDrive: event.drive, + ), + ); + } else if (event is ConfirmDriveEvent) { + final folderTree = await driveDao.getFolderTree( + event.drive.id, event.drive.rootFolderId); + + selectedDrive = event.drive; + + emit(SelectingFolderState(folders: folderTree.getRecursiveFolders())); + } else if (event is SelectFolderEvent) { + final folders = (state as SelectingFolderState).folders; + emit(SelectingFolderState( + folders: folders, + selectedFolder: event.folder, + )); + } else if (event is ConfirmFolderEvent) { + emit(FolderSelectedState(event.folder.id, event.folder.driveId)); + } + }); + } +} diff --git a/lib/sharing/folder_selector/folder_selector_event.dart b/lib/sharing/folder_selector/folder_selector_event.dart new file mode 100644 index 0000000000..dfceb29d0c --- /dev/null +++ b/lib/sharing/folder_selector/folder_selector_event.dart @@ -0,0 +1,46 @@ +part of 'folder_selector_bloc.dart'; + +sealed class FolderSelectorEvent extends Equatable { + const FolderSelectorEvent(); + + @override + List get props => []; +} + +final class LoadDrivesEvent extends FolderSelectorEvent {} + +final class SelectDriveEvent extends FolderSelectorEvent { + final Drive drive; + + SelectDriveEvent(this.drive); + + @override + List get props => [drive]; +} + +final class ConfirmDriveEvent extends FolderSelectorEvent { + final Drive drive; + + ConfirmDriveEvent(this.drive); + + @override + List get props => [drive]; +} + +final class ConfirmFolderEvent extends FolderSelectorEvent { + final FolderEntry folder; + + ConfirmFolderEvent(this.folder); + + @override + List get props => [folder]; +} + +final class SelectFolderEvent extends FolderSelectorEvent { + final FolderEntry folder; + + SelectFolderEvent(this.folder); + + @override + List get props => [folder]; +} diff --git a/lib/sharing/folder_selector/folder_selector_state.dart b/lib/sharing/folder_selector/folder_selector_state.dart new file mode 100644 index 0000000000..a50b6c6695 --- /dev/null +++ b/lib/sharing/folder_selector/folder_selector_state.dart @@ -0,0 +1,38 @@ +part of 'folder_selector_bloc.dart'; + +sealed class FolderSelectorState extends Equatable { + const FolderSelectorState(); + + @override + List get props => []; +} + +final class LoadingDrivesState extends FolderSelectorState {} + +final class FolderSelectorInitial extends FolderSelectorState {} + +final class SelectingDriveState extends FolderSelectorState { + final List drives; + final Drive? selectedDrive; + + SelectingDriveState({required this.drives, this.selectedDrive}); + + @override + List get props => [drives, selectedDrive ?? '']; +} + +final class SelectingFolderState extends FolderSelectorState { + final List folders; + final FolderEntry? selectedFolder; + + SelectingFolderState({required this.folders, this.selectedFolder}); + + @override + List get props => [folders, selectedFolder ?? '']; +} + +final class FolderSelectedState extends FolderSelectorState { + final String folder; + final String driveId; + const FolderSelectedState(this.folder, this.driveId); +} diff --git a/lib/sharing/sharing_file_listener.dart b/lib/sharing/sharing_file_listener.dart new file mode 100644 index 0000000000..64e0cc6db1 --- /dev/null +++ b/lib/sharing/sharing_file_listener.dart @@ -0,0 +1,99 @@ +import 'package:ardrive/components/components.dart'; +import 'package:ardrive/models/daos/daos.dart'; +import 'package:ardrive/pages/drive_detail/components/drive_explorer_item_tile.dart'; +import 'package:ardrive/sharing/blocs/sharing_file_bloc.dart'; +import 'package:ardrive/sharing/folder_selector/folder_selector.dart'; +import 'package:ardrive/sharing/folder_selector/folder_selector_bloc.dart'; +import 'package:ardrive/utils/show_general_dialog.dart'; +import 'package:ardrive_ui/ardrive_ui.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; + +class SharingFileListener extends StatefulWidget { + const SharingFileListener({super.key, required this.child}); + + final Widget child; + + @override + State createState() => _SharingFileListenerState(); +} + +class _SharingFileListenerState extends State { + @override + void dispose() { + BlocProvider.of(context).add(SharingFileCleared()); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return BlocListener( + listener: (context, state) { + if (state is SharingFileReceivedState) { + showArDriveDialog( + context, + content: ArDriveStandardModal( + title: 'Shared Files', + actions: [ + ModalAction( + action: () { + Navigator.of(context).pop(); + BlocProvider.of(context) + .add(SharingFileCleared()); + }, + title: 'Cancel', + ), + ModalAction( + action: () { + Navigator.of(context).pop(); + showArDriveDialog( + context, + content: BlocProvider( + create: (context) => FolderSelectorBloc( + context.read(), + ), + child: FolderSelector( + onSelect: (folderId, driveId) { + promptToUpload( + context, + driveId: driveId, + parentFolderId: folderId, + isFolderUpload: false, + files: state.files, + ); + }, + ), + ), + ); + }, + title: 'Select Drive', + ), + ], + content: SizedBox( + height: 400, + width: 200, + child: ListView.builder( + itemCount: state.files.length, + shrinkWrap: true, + itemBuilder: (context, index) { + return ListTile( + leading: getIconForContentType( + state.files[index].contentType, + size: 24, + ), + title: Text( + state.files[index].name, + style: ArDriveTypography.body.buttonLargeBold(), + ), + ); + }, + ), + ), + ), + ); + } + }, + child: widget.child, + ); + } +} diff --git a/pubspec.lock b/pubspec.lock index 70ed0571b6..026f5d1b53 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -910,6 +910,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.1" + flutter_sharing_intent: + dependency: "direct main" + description: + name: flutter_sharing_intent + sha256: "6eb896e6523b735e8230eeb206fd3b9f220f11ce879c2400a90b443147036ff9" + url: "https://pub.dev" + source: hosted + version: "1.1.0" flutter_stripe: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 741c7b0422..f4bb11a2da 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -130,6 +130,7 @@ dependencies: loading_animation_widget: ^1.2.0+4 synchronized: ^3.1.0 confetti: ^0.7.0 + flutter_sharing_intent: ^1.1.0 dependency_overrides: stripe_js: From ecb519eec2bbd7dfdff39da07ac990ec417bdec7 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Thu, 21 Dec 2023 17:18:16 -0300 Subject: [PATCH 02/24] fix lint --- ios/Podfile.lock | 237 ++++++++++-------- ios/Runner.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- ios/Runner/AppDelegate.swift | 2 +- lib/sharing/blocs/sharing_file_bloc.dart | 2 +- .../folder_selector/folder_selector_bloc.dart | 2 +- .../folder_selector_event.dart | 8 +- .../folder_selector_state.dart | 4 +- 8 files changed, 142 insertions(+), 117 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 82159e4e24..0b73fdb546 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1,6 +1,8 @@ PODS: - "app_settings (3.0.0+1)": - Flutter + - audio_session (0.0.1): + - Flutter - connectivity_plus (0.0.1): - Flutter - ReachabilitySwift @@ -44,27 +46,27 @@ PODS: - Flutter - file_selector_ios (0.0.1): - Flutter - - Firebase/CoreOnly (10.10.0): - - FirebaseCore (= 10.10.0) - - Firebase/Crashlytics (10.10.0): + - Firebase/CoreOnly (10.15.0): + - FirebaseCore (= 10.15.0) + - Firebase/Crashlytics (10.15.0): - Firebase/CoreOnly - - FirebaseCrashlytics (~> 10.10.0) - - firebase_core (2.14.0): - - Firebase/CoreOnly (= 10.10.0) + - FirebaseCrashlytics (~> 10.15.0) + - firebase_core (2.17.0): + - Firebase/CoreOnly (= 10.15.0) - Flutter - - firebase_crashlytics (3.3.3): - - Firebase/Crashlytics (= 10.10.0) + - firebase_crashlytics (3.3.7): + - Firebase/Crashlytics (= 10.15.0) - firebase_core - Flutter - - FirebaseCore (10.10.0): + - FirebaseCore (10.15.0): - FirebaseCoreInternal (~> 10.0) - GoogleUtilities/Environment (~> 7.8) - GoogleUtilities/Logger (~> 7.8) - - FirebaseCoreExtension (10.14.0): + - FirebaseCoreExtension (10.19.0): - FirebaseCore (~> 10.0) - - FirebaseCoreInternal (10.14.0): + - FirebaseCoreInternal (10.19.0): - "GoogleUtilities/NSData+zlib (~> 7.8)" - - FirebaseCrashlytics (10.10.0): + - FirebaseCrashlytics (10.15.0): - FirebaseCore (~> 10.5) - FirebaseInstallations (~> 10.0) - FirebaseSessions (~> 10.5) @@ -72,12 +74,12 @@ PODS: - GoogleUtilities/Environment (~> 7.8) - nanopb (< 2.30910.0, >= 2.30908.0) - PromisesObjC (~> 2.1) - - FirebaseInstallations (10.14.0): + - FirebaseInstallations (10.19.0): - FirebaseCore (~> 10.0) - GoogleUtilities/Environment (~> 7.8) - GoogleUtilities/UserDefaults (~> 7.8) - PromisesObjC (~> 2.1) - - FirebaseSessions (10.14.0): + - FirebaseSessions (10.19.0): - FirebaseCore (~> 10.5) - FirebaseCoreExtension (~> 10.0) - FirebaseInstallations (~> 10.0) @@ -92,31 +94,35 @@ PODS: - Flutter - flutter_secure_storage (6.0.0): - Flutter + - flutter_sharing_intent (0.0.1): + - Flutter - FMDB (2.7.5): - FMDB/standard (= 2.7.5) - FMDB/standard (2.7.5) - - GoogleDataTransport (9.2.5): + - GoogleDataTransport (9.3.0): - GoogleUtilities/Environment (~> 7.7) - nanopb (< 2.30910.0, >= 2.30908.0) - PromisesObjC (< 3.0, >= 1.2) - - GoogleUtilities/Environment (7.11.5): + - GoogleUtilities/Environment (7.12.0): - PromisesObjC (< 3.0, >= 1.2) - - GoogleUtilities/Logger (7.11.5): + - GoogleUtilities/Logger (7.12.0): - GoogleUtilities/Environment - - "GoogleUtilities/NSData+zlib (7.11.5)" - - GoogleUtilities/UserDefaults (7.11.5): + - "GoogleUtilities/NSData+zlib (7.12.0)" + - GoogleUtilities/UserDefaults (7.12.0): - GoogleUtilities/Logger - image_picker_ios (0.0.1): - Flutter - integration_test (0.0.1): - Flutter + - just_audio (0.0.1): + - Flutter - local_auth_ios (0.0.1): - Flutter - - nanopb (2.30909.0): - - nanopb/decode (= 2.30909.0) - - nanopb/encode (= 2.30909.0) - - nanopb/decode (2.30909.0) - - nanopb/encode (2.30909.0) + - nanopb (2.30909.1): + - nanopb/decode (= 2.30909.1) + - nanopb/encode (= 2.30909.1) + - nanopb/decode (2.30909.1) + - nanopb/encode (2.30909.1) - package_info_plus (0.4.5): - Flutter - path_provider_foundation (0.0.1): @@ -128,9 +134,9 @@ PODS: - PromisesSwift (2.3.1): - PromisesObjC (= 2.3.1) - ReachabilitySwift (5.0.0) - - SDWebImage (5.17.0): - - SDWebImage/Core (= 5.17.0) - - SDWebImage/Core (5.17.0) + - SDWebImage (5.18.7): + - SDWebImage/Core (= 5.18.7) + - SDWebImage/Core (5.18.7) - security_scoped_resource (0.0.1): - Flutter - share_plus (0.0.1): @@ -141,67 +147,71 @@ PODS: - sqflite (0.0.3): - Flutter - FMDB (>= 2.7.5) - - sqlite3 (3.41.2): - - sqlite3/common (= 3.41.2) - - sqlite3/common (3.41.2) - - sqlite3/fts5 (3.41.2): + - sqlite3 (3.43.1): + - sqlite3/common (= 3.43.1) + - sqlite3/common (3.43.1) + - sqlite3/fts5 (3.43.1): - sqlite3/common - - sqlite3/perf-threadsafe (3.41.2): + - sqlite3/perf-threadsafe (3.43.1): - sqlite3/common - - sqlite3/rtree (3.41.2): + - sqlite3/rtree (3.43.1): - sqlite3/common - sqlite3_flutter_libs (0.0.1): - Flutter - - sqlite3 (~> 3.41.2) + - sqlite3 (~> 3.43.1) - sqlite3/fts5 - sqlite3/perf-threadsafe - sqlite3/rtree - - Stripe (23.7.1): - - StripeApplePay (= 23.7.1) - - StripeCore (= 23.7.1) - - StripePayments (= 23.7.1) - - StripePaymentsUI (= 23.7.1) - - StripeUICore (= 23.7.1) + - Stripe (23.12.0): + - StripeApplePay (= 23.12.0) + - StripeCore (= 23.12.0) + - StripePayments (= 23.12.0) + - StripePaymentsUI (= 23.12.0) + - StripeUICore (= 23.12.0) - stripe_ios (0.0.1): - Flutter - - Stripe (~> 23.7.0) - - StripeApplePay (~> 23.7.0) - - StripeFinancialConnections (~> 23.7.0) - - StripePayments (~> 23.7.0) - - StripePaymentSheet (~> 23.7.0) - - StripePaymentsUI (~> 23.7.0) - - StripeApplePay (23.7.1): - - StripeCore (= 23.7.1) - - StripeCore (23.7.1) - - StripeFinancialConnections (23.7.1): - - StripeCore (= 23.7.1) - - StripeUICore (= 23.7.1) - - StripePayments (23.7.1): - - StripeCore (= 23.7.1) - - StripePayments/Stripe3DS2 (= 23.7.1) - - StripePayments/Stripe3DS2 (23.7.1): - - StripeCore (= 23.7.1) - - StripePaymentSheet (23.7.1): - - StripeApplePay (= 23.7.1) - - StripeCore (= 23.7.1) - - StripePayments (= 23.7.1) - - StripePaymentsUI (= 23.7.1) - - StripePaymentsUI (23.7.1): - - StripeCore (= 23.7.1) - - StripePayments (= 23.7.1) - - StripeUICore (= 23.7.1) - - StripeUICore (23.7.1): - - StripeCore (= 23.7.1) + - Stripe (~> 23.12.0) + - StripeApplePay (~> 23.12.0) + - StripeFinancialConnections (~> 23.12.0) + - StripePayments (~> 23.12.0) + - StripePaymentSheet (~> 23.12.0) + - StripePaymentsUI (~> 23.12.0) + - StripeApplePay (23.12.0): + - StripeCore (= 23.12.0) + - StripeCore (23.12.0) + - StripeFinancialConnections (23.12.0): + - StripeCore (= 23.12.0) + - StripeUICore (= 23.12.0) + - StripePayments (23.12.0): + - StripeCore (= 23.12.0) + - StripePayments/Stripe3DS2 (= 23.12.0) + - StripePayments/Stripe3DS2 (23.12.0): + - StripeCore (= 23.12.0) + - StripePaymentSheet (23.12.0): + - StripeApplePay (= 23.12.0) + - StripeCore (= 23.12.0) + - StripePayments (= 23.12.0) + - StripePaymentsUI (= 23.12.0) + - StripePaymentsUI (23.12.0): + - StripeCore (= 23.12.0) + - StripePayments (= 23.12.0) + - StripeUICore (= 23.12.0) + - StripeUICore (23.12.0): + - StripeCore (= 23.12.0) - SwiftyGif (5.4.4) + - system_info_plus (0.0.1): + - Flutter - url_launcher_ios (0.0.1): - Flutter - video_player_avfoundation (0.0.1): - Flutter - - wakelock (0.0.1): + - FlutterMacOS + - webcrypto (0.1.1): - Flutter DEPENDENCIES: - app_settings (from `.symlinks/plugins/app_settings/ios`) + - audio_session (from `.symlinks/plugins/audio_session/ios`) - connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`) - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) - file_picker (from `.symlinks/plugins/file_picker/ios`) @@ -213,8 +223,10 @@ DEPENDENCIES: - flutter_downloader (from `.symlinks/plugins/flutter_downloader/ios`) - flutter_email_sender (from `.symlinks/plugins/flutter_email_sender/ios`) - flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`) + - flutter_sharing_intent (from `.symlinks/plugins/flutter_sharing_intent/ios`) - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) - integration_test (from `.symlinks/plugins/integration_test/ios`) + - just_audio (from `.symlinks/plugins/just_audio/ios`) - local_auth_ios (from `.symlinks/plugins/local_auth_ios/ios`) - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) @@ -225,9 +237,10 @@ DEPENDENCIES: - sqflite (from `.symlinks/plugins/sqflite/ios`) - sqlite3_flutter_libs (from `.symlinks/plugins/sqlite3_flutter_libs/ios`) - stripe_ios (from `.symlinks/plugins/stripe_ios/ios`) + - system_info_plus (from `.symlinks/plugins/system_info_plus/ios`) - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) - - video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/ios`) - - wakelock (from `.symlinks/plugins/wakelock/ios`) + - video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/darwin`) + - webcrypto (from `.symlinks/plugins/webcrypto/ios`) SPEC REPOS: trunk: @@ -262,6 +275,8 @@ SPEC REPOS: EXTERNAL SOURCES: app_settings: :path: ".symlinks/plugins/app_settings/ios" + audio_session: + :path: ".symlinks/plugins/audio_session/ios" connectivity_plus: :path: ".symlinks/plugins/connectivity_plus/ios" device_info_plus: @@ -284,10 +299,14 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/flutter_email_sender/ios" flutter_secure_storage: :path: ".symlinks/plugins/flutter_secure_storage/ios" + flutter_sharing_intent: + :path: ".symlinks/plugins/flutter_sharing_intent/ios" image_picker_ios: :path: ".symlinks/plugins/image_picker_ios/ios" integration_test: :path: ".symlinks/plugins/integration_test/ios" + just_audio: + :path: ".symlinks/plugins/just_audio/ios" local_auth_ios: :path: ".symlinks/plugins/local_auth_ios/ios" package_info_plus: @@ -308,69 +327,75 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/sqlite3_flutter_libs/ios" stripe_ios: :path: ".symlinks/plugins/stripe_ios/ios" + system_info_plus: + :path: ".symlinks/plugins/system_info_plus/ios" url_launcher_ios: :path: ".symlinks/plugins/url_launcher_ios/ios" video_player_avfoundation: - :path: ".symlinks/plugins/video_player_avfoundation/ios" - wakelock: - :path: ".symlinks/plugins/wakelock/ios" + :path: ".symlinks/plugins/video_player_avfoundation/darwin" + webcrypto: + :path: ".symlinks/plugins/webcrypto/ios" SPEC CHECKSUMS: app_settings: 54b8813f690b34f757c0bf97a46637bed5acc76c + audio_session: 4f3e461722055d21515cf3261b64c973c062f345 connectivity_plus: 07c49e96d7fc92bc9920617b83238c4d178b446a - device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed + device_info_plus: 7545d84d8d1b896cb16a4ff98c19f07ec4b298ea DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179 - file_picker: 817ab1d8cd2da9d2da412a417162deee3500fc95 + file_picker: ce3938a0df3cc1ef404671531facef740d03f920 file_saver: 503e386464dbe118f630e17b4c2e1190fa0cf808 file_selector_ios: 8c25d700d625e1dcdd6599f2d927072f2254647b - Firebase: facd334e557a979bd03a0b58d90fd56b52b8aba0 - firebase_core: 85b6664038311940ad60584eaabc73103c61f5de - firebase_crashlytics: cd12245f604099a4ef6557fb36490abe309a118a - FirebaseCore: d027ff503d37edb78db98429b11f580a24a7df2a - FirebaseCoreExtension: 976638051b1a46b503afce7ec80277f9161f2040 - FirebaseCoreInternal: d558159ee6cc4b823c2296ecc193de9f6d9a5bb3 - FirebaseCrashlytics: bc8f3bed7f4d04be79d87391455efb4c9b163131 - FirebaseInstallations: f672b1eda64e6381c21d424a2f680a943fd83f3b - FirebaseSessions: f145e7365d36bec0d724c4574a8750e6f82fa6c8 + Firebase: 66043bd4579e5b73811f96829c694c7af8d67435 + firebase_core: 28e84c2a4fcf6a50ef83f47b145ded8c1fa331e4 + firebase_crashlytics: 36b8a72e23437dbb69bd97102661ce31b6721be5 + FirebaseCore: 2cec518b43635f96afe7ac3a9c513e47558abd2e + FirebaseCoreExtension: c08d14c7b22e07994e876d837e6f58642f340087 + FirebaseCoreInternal: b444828ea7cfd594fca83046b95db98a2be4f290 + FirebaseCrashlytics: a83f26fb922a3fe181eb738fb4dcf0c92bba6455 + FirebaseInstallations: 033d199474164db20c8350736842a94fe717b960 + FirebaseSessions: e5f4caa188dc8bc6142abc974355be75b042215e Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 flutter_downloader: b7301ae057deadd4b1650dc7c05375f10ff12c39 flutter_email_sender: 02d7443217d8c41483223627972bfdc09f74276b flutter_secure_storage: 23fc622d89d073675f2eaa109381aefbcf5a49be + flutter_sharing_intent: e35380d0e1501d7111dbb7e46d5ac6339da6da98 FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a - GoogleDataTransport: 54dee9d48d14580407f8f5fbf2f496e92437a2f2 - GoogleUtilities: 13e2c67ede716b8741c7989e26893d151b2b2084 + GoogleDataTransport: 57c22343ab29bc686febbf7cbb13bad167c2d8fe + GoogleUtilities: 0759d1a57ebb953965c2dfe0ba4c82e95ccc2e34 image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5 integration_test: 13825b8a9334a850581300559b8839134b124670 + just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa local_auth_ios: c6cf091ded637a88f24f86a8875d8b0f526e2605 - nanopb: b552cce312b6c8484180ef47159bc0f65a1f0431 - package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e - path_provider_foundation: eaf5b3e458fc0e5fbb9940fb09980e853fe058b8 + nanopb: d4d75c12cd1316f4a64e3c6963f879ecd4b5e0d5 + package_info_plus: fd030dabf36271f146f1f3beacd48f564b0f17f7 + path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943 permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6 PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4 PromisesSwift: 28dca69a9c40779916ac2d6985a0192a5cb4a265 ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825 - SDWebImage: 750adf017a315a280c60fde706ab1e552a3ae4e9 + SDWebImage: f9258c58221ed854cfa0e2b80ee4033710b1c6d3 security_scoped_resource: ff26d31a9c6de0e45e5e8e0d7f43f3da0a1c6444 - share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68 + share_plus: 599aa54e4ea31d4b4c0e9c911bcc26c55e791028 shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126 sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a - sqlite3: fd89671d969f3e73efe503ce203e28b016b58f68 - sqlite3_flutter_libs: 04ba0d14a04335a2fbf9a331e8664f401fbccdd5 - Stripe: fbe3d1d61cba70ac7a920c6097222ba9525352c4 - stripe_ios: 8e0be46c31e1758756e5fdc1613f751d4d945ae0 - StripeApplePay: 06e3899c9db102567804b77c41cec2861b5e2c39 - StripeCore: 9b331e5f9d4067ef7296718c680a73ad6f2d1066 - StripeFinancialConnections: 7d8116c4dcd3b034f13a181b4d96e6991b594cfc - StripePayments: 46fbd561312cb300c93dd855b9c896285c8eb1fb - StripePaymentSheet: 016fd1c6053efff1f348fc6f44babecacda9d0af - StripePaymentsUI: cb06c01d3c9efde91ebce218f9e4e94e902dd676 - StripeUICore: a9db3f2a82c932d5ca58dd8fc4ac0a6b72f1ccee + sqlite3: e0a0623a33a20a47cb5921552aebc6e9e437dc91 + sqlite3_flutter_libs: 0d61e18fab1bed977dbd2d2fc76a726044ca00e7 + Stripe: 15fad81ffb8d553d77ff504a6d50d47b9028bed0 + stripe_ios: 872ce75ce051b4070d061a185c8b7b67323c9f30 + StripeApplePay: 871274acfa7a96650ea8a697c288c54b8288fb6e + StripeCore: 7b08fd286e8f8f5336eb725bc7ed1d2a4705cdc4 + StripeFinancialConnections: 561831507db3d383be3933a3979f1b9d287a15e7 + StripePayments: 081e01e73762852ccf3e662202d5dd4107634058 + StripePaymentSheet: ec04397e9223c86a87be8b348cdbcf2075dd7a16 + StripePaymentsUI: 3dae7fed9b148b2749dff622ece45f9b441b88ce + StripeUICore: 4a76fa59cab679e1b2fe1ad37d6b08c5bf2ada54 SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f + system_info_plus: 5393c8da281d899950d751713575fbf91c7709aa url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4 - video_player_avfoundation: 81e49bb3d9fb63dccf9fa0f6d877dc3ddbeac126 - wakelock: d0fc7c864128eac40eba1617cb5264d9c940b46f + video_player_avfoundation: 8563f13d8fc8b2c29dc2d09e60b660e4e8128837 + webcrypto: 58dac29c85327d3d72a47d19d44128f10905f58e PODFILE CHECKSUM: a53104172c70845ea00f443ee40dc85202454329 -COCOAPODS: 1.12.1 +COCOAPODS: 1.13.0 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index e44aa7895d..3f9ed861ad 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -247,7 +247,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 1500; - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1430; ORGANIZATIONNAME = ""; TargetAttributes = { 064460FB2B34C5B1001CD384 = { diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 305b73635c..e2da37c99b 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ get props => [drive]; @@ -21,7 +21,7 @@ final class SelectDriveEvent extends FolderSelectorEvent { final class ConfirmDriveEvent extends FolderSelectorEvent { final Drive drive; - ConfirmDriveEvent(this.drive); + const ConfirmDriveEvent(this.drive); @override List get props => [drive]; @@ -30,7 +30,7 @@ final class ConfirmDriveEvent extends FolderSelectorEvent { final class ConfirmFolderEvent extends FolderSelectorEvent { final FolderEntry folder; - ConfirmFolderEvent(this.folder); + const ConfirmFolderEvent(this.folder); @override List get props => [folder]; @@ -39,7 +39,7 @@ final class ConfirmFolderEvent extends FolderSelectorEvent { final class SelectFolderEvent extends FolderSelectorEvent { final FolderEntry folder; - SelectFolderEvent(this.folder); + const SelectFolderEvent(this.folder); @override List get props => [folder]; diff --git a/lib/sharing/folder_selector/folder_selector_state.dart b/lib/sharing/folder_selector/folder_selector_state.dart index a50b6c6695..2bce5a6cbb 100644 --- a/lib/sharing/folder_selector/folder_selector_state.dart +++ b/lib/sharing/folder_selector/folder_selector_state.dart @@ -15,7 +15,7 @@ final class SelectingDriveState extends FolderSelectorState { final List drives; final Drive? selectedDrive; - SelectingDriveState({required this.drives, this.selectedDrive}); + const SelectingDriveState({required this.drives, this.selectedDrive}); @override List get props => [drives, selectedDrive ?? '']; @@ -25,7 +25,7 @@ final class SelectingFolderState extends FolderSelectorState { final List folders; final FolderEntry? selectedFolder; - SelectingFolderState({required this.folders, this.selectedFolder}); + const SelectingFolderState({required this.folders, this.selectedFolder}); @override List get props => [folders, selectedFolder ?? '']; From 5e30cd6158e78ce4ba131791e1db3bf840089815 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Thu, 21 Dec 2023 17:24:05 -0300 Subject: [PATCH 03/24] Update sync_cubit.dart --- lib/blocs/sync/sync_cubit.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/blocs/sync/sync_cubit.dart b/lib/blocs/sync/sync_cubit.dart index 7fb5384a8b..f6009e869d 100644 --- a/lib/blocs/sync/sync_cubit.dart +++ b/lib/blocs/sync/sync_cubit.dart @@ -87,8 +87,9 @@ class SyncCubit extends Cubit { _configService = configService, _tabVisibility = tabVisibility, super(SyncIdle()) { + // TODO: verify if (_blockSync) { - Future.delayed(Duration(seconds: 1000), () { + Future.delayed(const Duration(seconds: 1000), () { _blockSync = false; // startSync(); }); From eccdcb021e296ac0a49442b8ef641d33889cf583 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Tue, 9 Jan 2024 11:55:47 -0300 Subject: [PATCH 04/24] add failed status string back --- lib/components/upload_form.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/components/upload_form.dart b/lib/components/upload_form.dart index de8082edba..19635d0b27 100644 --- a/lib/components/upload_form.dart +++ b/lib/components/upload_form.dart @@ -923,7 +923,7 @@ class _UploadFormState extends State { status = 'Complete'; break; case UploadStatus.failed: - status = ''; + status = 'Failed'; break; case UploadStatus.preparationDone: status = 'Preparation done'; From 8793b9567e79e5a44fb9bf6549be03f19a0d5262 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Wed, 10 Jan 2024 12:12:45 -0300 Subject: [PATCH 05/24] feat(sharing) - block sync from happening if the sharing files is opened --- lib/blocs/sync/sync_cubit.dart | 17 ++++++--------- lib/core/activity_tracker.dart | 8 +++++++ lib/main.dart | 4 +++- lib/sharing/blocs/sharing_file_bloc.dart | 27 +++++++++++++++++++++--- 4 files changed, 42 insertions(+), 14 deletions(-) diff --git a/lib/blocs/sync/sync_cubit.dart b/lib/blocs/sync/sync_cubit.dart index f6009e869d..38a1dab32a 100644 --- a/lib/blocs/sync/sync_cubit.dart +++ b/lib/blocs/sync/sync_cubit.dart @@ -57,6 +57,7 @@ class SyncCubit extends Cubit { final Database _db; final TabVisibilitySingleton _tabVisibility; final ConfigService _configService; + final ActivityTracker _activityTracker; StreamSubscription? _restartOnFocusStreamSubscription; StreamSubscription? _restartArConnectOnFocusStreamSubscription; @@ -68,8 +69,6 @@ class SyncCubit extends Cubit { late DateTime _initSync; late SyncProgress _syncProgress; - bool _blockSync = true; - SyncCubit({ required ProfileCubit profileCubit, required ActivityCubit activityCubit, @@ -81,20 +80,13 @@ class SyncCubit extends Cubit { required ActivityTracker activityTracker, }) : _profileCubit = profileCubit, _activityCubit = activityCubit, + _activityTracker = activityTracker, _arweave = arweave, _driveDao = driveDao, _db = db, _configService = configService, _tabVisibility = tabVisibility, super(SyncIdle()) { - // TODO: verify - if (_blockSync) { - Future.delayed(const Duration(seconds: 1000), () { - _blockSync = false; - // startSync(); - }); - return; - } // Sync the user's drives on start and periodically. createSyncStream(); restartSyncOnFocus(); @@ -187,6 +179,11 @@ class SyncCubit extends Cubit { var ghostFolders = {}; Future startSync({bool syncDeep = false}) async { + if (_activityTracker.isSharingFilesFromExternalApp) { + logger.d('An activity is in progress, skipping sync.'); + return; + } + logger.i('Starting Sync'); if (state is SyncInProgress) { diff --git a/lib/core/activity_tracker.dart b/lib/core/activity_tracker.dart index 0d44e57f9f..212ca4382f 100644 --- a/lib/core/activity_tracker.dart +++ b/lib/core/activity_tracker.dart @@ -4,6 +4,7 @@ class ActivityTracker extends ChangeNotifier { bool _isToppingUp = false; bool _isShowingAnyDialog = false; bool _isUploading = false; + bool _isSharingFilesFromExternalApp = false; // getters bool get isToppingUp => _isToppingUp; @@ -18,6 +19,8 @@ class ActivityTracker extends ChangeNotifier { bool get isUploading => _isUploading; + bool get isSharingFilesFromExternalApp => _isSharingFilesFromExternalApp; + // setters void setUploading(bool value) { _isUploading = value; @@ -32,4 +35,9 @@ class ActivityTracker extends ChangeNotifier { _isShowingAnyDialog = value; notifyListeners(); } + + void setSharingFilesFromExternalApp(bool value) { + _isSharingFilesFromExternalApp = value; + notifyListeners(); + } } diff --git a/lib/main.dart b/lib/main.dart index 8026ac5eb5..7f6d50d7ab 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -256,7 +256,9 @@ class AppState extends State { themeDetector: ThemeDetector(), ), ), - BlocProvider(create: (_) => SharingFileBloc()), + BlocProvider( + create: (context) => SharingFileBloc(context.read()), + ), ], child: ArDriveDevToolsShortcuts( child: KeyboardHandler( diff --git a/lib/sharing/blocs/sharing_file_bloc.dart b/lib/sharing/blocs/sharing_file_bloc.dart index 01bacd6118..ff9d47a4ae 100644 --- a/lib/sharing/blocs/sharing_file_bloc.dart +++ b/lib/sharing/blocs/sharing_file_bloc.dart @@ -1,3 +1,5 @@ +import 'package:ardrive/core/activity_tracker.dart'; +import 'package:ardrive/utils/logger/logger.dart'; import 'package:ardrive_io/ardrive_io.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -10,14 +12,27 @@ part 'sharing_file_state.dart'; class SharingFileBloc extends Bloc { List? files; + final ActivityTracker activityTracker; - SharingFileBloc() : super(SharingFileInitial()) { + SharingFileBloc( + this.activityTracker, + ) : super(SharingFileInitial()) { // For sharing images coming from outside the app while the app is in the memory // For sharing images coming from outside the app while the app is closed FlutterSharingIntent.instance .getInitialSharing() .then((List value) { + logger.d('SharingFileReceived'); + + if (value.isNotEmpty) { + add(SharingFileReceived(value)); + } + }); + + FlutterSharingIntent.instance.getMediaStream().listen((value) { + logger.d('SharingFileReceived'); + if (value.isNotEmpty) { add(SharingFileReceived(value)); } @@ -25,6 +40,7 @@ class SharingFileBloc extends Bloc { on((event, emit) async { if (event is SharingFileReceived) { + activityTracker.setSharingFilesFromExternalApp(true); files = event.files; final ioFiles = []; @@ -37,9 +53,14 @@ class SharingFileBloc extends Bloc { emit(SharingFileReceivedState(ioFiles)); } else if (event is SharingFileCleared) { files = null; - } else if (event is ShowSharingFile) { - // emit(SharingFileReceivedState(files!)); + activityTracker.setSharingFilesFromExternalApp(false); } }); } + + @override + close() async { + activityTracker.setSharingFilesFromExternalApp(false); + super.close(); + } } From 22b69b7a30703c51ec1fb06bf83ea33cecc9f209 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Thu, 11 Jan 2024 10:29:11 -0300 Subject: [PATCH 06/24] Update sharing_file_bloc.dart --- lib/sharing/blocs/sharing_file_bloc.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sharing/blocs/sharing_file_bloc.dart b/lib/sharing/blocs/sharing_file_bloc.dart index ff9d47a4ae..e511e6c3d3 100644 --- a/lib/sharing/blocs/sharing_file_bloc.dart +++ b/lib/sharing/blocs/sharing_file_bloc.dart @@ -1,5 +1,5 @@ import 'package:ardrive/core/activity_tracker.dart'; -import 'package:ardrive/utils/logger/logger.dart'; +import 'package:ardrive/utils/logger.dart'; import 'package:ardrive_io/ardrive_io.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; From 34833583dd6a4162cd0e7bfa7c74f5fd069eb9f8 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Thu, 11 Jan 2024 14:47:50 -0300 Subject: [PATCH 07/24] Update sharing_file_bloc.dart --- lib/sharing/blocs/sharing_file_bloc.dart | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/sharing/blocs/sharing_file_bloc.dart b/lib/sharing/blocs/sharing_file_bloc.dart index e511e6c3d3..ce96c8f46d 100644 --- a/lib/sharing/blocs/sharing_file_bloc.dart +++ b/lib/sharing/blocs/sharing_file_bloc.dart @@ -17,9 +17,6 @@ class SharingFileBloc extends Bloc { SharingFileBloc( this.activityTracker, ) : super(SharingFileInitial()) { - // For sharing images coming from outside the app while the app is in the memory - - // For sharing images coming from outside the app while the app is closed FlutterSharingIntent.instance .getInitialSharing() .then((List value) { From b353bd57adc9c038a04f586bbc369eaebb37222b Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Tue, 23 Jan 2024 20:58:04 -0300 Subject: [PATCH 08/24] fix(sharing file) remove width constraint --- lib/sharing/blocs/sharing_file_bloc.dart | 5 +++++ .../folder_selector/folder_selector.dart | 2 -- lib/sharing/sharing_file_listener.dart | 20 ++++++++++--------- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/lib/sharing/blocs/sharing_file_bloc.dart b/lib/sharing/blocs/sharing_file_bloc.dart index 01bacd6118..b7a00d4212 100644 --- a/lib/sharing/blocs/sharing_file_bloc.dart +++ b/lib/sharing/blocs/sharing_file_bloc.dart @@ -23,6 +23,11 @@ class SharingFileBloc extends Bloc { } }); + // For sharing images coming from outside the app while the app is in the memory + FlutterSharingIntent.instance.getMediaStream().listen((event) { + add(SharingFileReceived(event)); + }); + on((event, emit) async { if (event is SharingFileReceived) { files = event.files; diff --git a/lib/sharing/folder_selector/folder_selector.dart b/lib/sharing/folder_selector/folder_selector.dart index df7afa342c..4ed0432c80 100644 --- a/lib/sharing/folder_selector/folder_selector.dart +++ b/lib/sharing/folder_selector/folder_selector.dart @@ -43,7 +43,6 @@ class _FolderSelectorState extends State { title = 'Select Drive'; description = 'Select the drive you want to upload to'; content = SizedBox( - width: 200, child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -236,7 +235,6 @@ class _FolderSelectorState extends State { actions: actions, content: SizedBox( height: 400, - width: 200, child: content, ), ); diff --git a/lib/sharing/sharing_file_listener.dart b/lib/sharing/sharing_file_listener.dart index 64e0cc6db1..d629478dfe 100644 --- a/lib/sharing/sharing_file_listener.dart +++ b/lib/sharing/sharing_file_listener.dart @@ -71,19 +71,21 @@ class _SharingFileListenerState extends State { ], content: SizedBox( height: 400, - width: 200, child: ListView.builder( itemCount: state.files.length, shrinkWrap: true, itemBuilder: (context, index) { - return ListTile( - leading: getIconForContentType( - state.files[index].contentType, - size: 24, - ), - title: Text( - state.files[index].name, - style: ArDriveTypography.body.buttonLargeBold(), + return SizedBox( + width: 200, + child: ListTile( + leading: getIconForContentType( + state.files[index].contentType, + size: 24, + ), + title: Text( + state.files[index].name, + style: ArDriveTypography.body.buttonLargeBold(), + ), ), ); }, From 82717218257ee6fa4efa9fd3f8ee03903b878bbd Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Tue, 23 Jan 2024 21:00:21 -0300 Subject: [PATCH 09/24] Update sharing_file_listener.dart --- lib/sharing/sharing_file_listener.dart | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/lib/sharing/sharing_file_listener.dart b/lib/sharing/sharing_file_listener.dart index d629478dfe..11a19dbee0 100644 --- a/lib/sharing/sharing_file_listener.dart +++ b/lib/sharing/sharing_file_listener.dart @@ -75,17 +75,14 @@ class _SharingFileListenerState extends State { itemCount: state.files.length, shrinkWrap: true, itemBuilder: (context, index) { - return SizedBox( - width: 200, - child: ListTile( - leading: getIconForContentType( - state.files[index].contentType, - size: 24, - ), - title: Text( - state.files[index].name, - style: ArDriveTypography.body.buttonLargeBold(), - ), + return ListTile( + leading: getIconForContentType( + state.files[index].contentType, + size: 24, + ), + title: Text( + state.files[index].name, + style: ArDriveTypography.body.buttonLargeBold(), ), ); }, From bfd6b98a67cd0968659867ec708f6b0f1ffc8a98 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Tue, 23 Jan 2024 21:04:44 -0300 Subject: [PATCH 10/24] Update AndroidManifest.xml --- android/app/src/main/AndroidManifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 4daf2e9c7e..7c009920b0 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -13,7 +13,7 @@ android:icon="@mipmap/ic_launcher"> Date: Thu, 25 Jan 2024 10:27:55 -0300 Subject: [PATCH 11/24] feat(sharing) - enhance the folder selector widget - update activity tracker properly when closing the select folder modal --- .../folder_selector/folder_selector.dart | 174 +++++++++++++----- .../folder_selector/folder_selector_bloc.dart | 32 +++- .../folder_selector_event.dart | 4 +- .../folder_selector_state.dart | 11 +- lib/sharing/sharing_file_listener.dart | 4 + 5 files changed, 166 insertions(+), 59 deletions(-) diff --git a/lib/sharing/folder_selector/folder_selector.dart b/lib/sharing/folder_selector/folder_selector.dart index df7afa342c..203644d567 100644 --- a/lib/sharing/folder_selector/folder_selector.dart +++ b/lib/sharing/folder_selector/folder_selector.dart @@ -1,12 +1,15 @@ import 'package:ardrive/models/drive.dart'; import 'package:ardrive/pages/drive_detail/components/drive_explorer_item_tile.dart'; +import 'package:ardrive/pages/drive_detail/components/hover_widget.dart'; import 'package:ardrive/sharing/folder_selector/folder_selector_bloc.dart'; import 'package:ardrive_ui/ardrive_ui.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; class FolderSelector extends StatefulWidget { - const FolderSelector({super.key, required this.onSelect}); + const FolderSelector({super.key, required this.onSelect, this.dispose}); + + final Function? dispose; final Function(String driveId, String folderId) onSelect; @@ -21,6 +24,12 @@ class _FolderSelectorState extends State { context.read().add(LoadDrivesEvent()); } + @override + dispose() { + widget.dispose?.call(); + super.dispose(); + } + @override Widget build(BuildContext context) { return BlocConsumer( @@ -60,11 +69,11 @@ class _FolderSelectorState extends State { itemCount: publicDrives.length, shrinkWrap: true, itemBuilder: (context, index) { + final publicDrive = publicDrives[index]; final color = state.selectedDrive == null ? null : state.selectedDrive != null - ? publicDrives[index].id == - state.selectedDrive!.id + ? publicDrive.id == state.selectedDrive!.id ? null : colors.themeAccentDisabled : null; @@ -73,22 +82,22 @@ class _FolderSelectorState extends State { color: color, ), title: Text( - state.drives[index].name, + publicDrive.name, style: ArDriveTypography.body .buttonLargeBold( color: color, ) .copyWith( - fontWeight: state.selectedDrive?.id == - state.drives[index].id - ? FontWeight.w700 - : null, + fontWeight: + state.selectedDrive?.id == publicDrive.id + ? FontWeight.w700 + : null, ), ), onTap: () { context .read() - .add(SelectDriveEvent(state.drives[index])); + .add(SelectDriveEvent(publicDrive)); }, ); }, @@ -107,11 +116,11 @@ class _FolderSelectorState extends State { itemCount: privateDrives.length, shrinkWrap: true, itemBuilder: (context, index) { + final privateDrive = privateDrives[index]; final color = state.selectedDrive == null ? null : state.selectedDrive != null - ? privateDrives[index].id == - state.selectedDrive!.id + ? privateDrive.id == state.selectedDrive!.id ? null : colors.themeAccentDisabled : null; @@ -120,22 +129,22 @@ class _FolderSelectorState extends State { color: color, ), title: Text( - state.drives[index].name, + privateDrive.name, style: ArDriveTypography.body .buttonLargeBold( color: color, ) .copyWith( - fontWeight: state.selectedDrive?.id == - state.drives[index].id - ? FontWeight.w700 - : null, + fontWeight: + state.selectedDrive?.id == privateDrive.id + ? FontWeight.w700 + : null, ), ), onTap: () { context .read() - .add(SelectDriveEvent(state.drives[index])); + .add(SelectDriveEvent(privateDrive)); }, ); }, @@ -168,42 +177,107 @@ class _FolderSelectorState extends State { } else if (state is SelectingFolderState) { title = 'Select Folder'; description = 'Select the folder you want to upload to'; - content = ListView.builder( - itemCount: state.folders.length, - shrinkWrap: true, - itemBuilder: (context, index) { - final color = state.selectedFolder == null - ? null - : state.selectedFolder != null - ? state.folders[index].id == state.selectedFolder!.id - ? null - : colors.themeAccentDisabled - : null; - return SizedBox( - width: 200, - child: ListTile( - leading: - getIconForContentType('folder', color: color, size: 24), - title: Text( - state.folders[index].name, - style: ArDriveTypography.body - .buttonLargeBold( - color: color, - ) - .copyWith( - fontWeight: state.selectedFolder?.id == - state.folders[index].id - ? FontWeight.w700 - : null), + content = SizedBox( + height: 400, + child: Column( + children: [ + if (state.selectedFolder != null) ...[ + SizedBox( + width: 200, + height: 48, + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + if (state.isRootFolder) + Flexible( + child: ListTile( + leading: + getIconForContentType('folder', size: 24), + title: Text( + 'Root folder', + style: ArDriveTypography.body + .buttonLargeBold() + .copyWith(fontWeight: FontWeight.w700), + ), + ), + ), + if (state.parentFolder != null && !state.isRootFolder) + Padding( + padding: const EdgeInsets.only(top: 4.0, right: 4), + child: SizedBox( + width: 24, + child: ArDriveIconButton( + icon: ArDriveIcons.arrowLeft(), + onPressed: () { + context.read().add( + SelectFolderEvent( + folder: state.parentFolder!)); + }, + ), + ), + ), + if (!state.isRootFolder) + Flexible( + child: ListTile( + leading: + getIconForContentType('folder', size: 24), + title: Text( + state.selectedFolder!.name, + style: ArDriveTypography.body + .buttonLargeBold() + .copyWith(fontWeight: FontWeight.w700), + ), + ), + ), + ], + ), ), - onTap: () { - context - .read() - .add(SelectFolderEvent(state.folders[index])); + ], + ListView.builder( + padding: EdgeInsets.only( + left: state.selectedFolder == null + ? 0 + : state.parentFolder != null + ? 48 + : 20), + itemCount: state.folders.length, + shrinkWrap: true, + itemBuilder: (context, index) { + final color = state.selectedFolder == null + ? null + : state.selectedFolder != null + ? state.folders[index].id == + state.selectedFolder!.id + ? null + : colors.themeAccentDisabled + : null; + return SizedBox( + width: 200, + child: ListTile( + leading: getIconForContentType('folder', + color: color, size: 24), + title: Text( + state.folders[index].name, + style: ArDriveTypography.body + .buttonLargeBold( + color: color, + ) + .copyWith( + fontWeight: state.selectedFolder?.id == + state.folders[index].id + ? FontWeight.w700 + : null), + ), + onTap: () { + context.read().add( + SelectFolderEvent(folder: state.folders[index])); + }, + ), + ); }, ), - ); - }, + ], + ), ); actions.addAll([ diff --git a/lib/sharing/folder_selector/folder_selector_bloc.dart b/lib/sharing/folder_selector/folder_selector_bloc.dart index 29c984299f..b1198cb039 100644 --- a/lib/sharing/folder_selector/folder_selector_bloc.dart +++ b/lib/sharing/folder_selector/folder_selector_bloc.dart @@ -32,13 +32,33 @@ class FolderSelectorBloc selectedDrive = event.drive; - emit(SelectingFolderState(folders: folderTree.getRecursiveFolders())); + emit( + SelectingFolderState( + selectedFolder: folderTree.folder, + isRootFolder: true, + folders: folderTree.subfolders.map((e) => e.folder).toList(), + ), + ); } else if (event is SelectFolderEvent) { - final folders = (state as SelectingFolderState).folders; - emit(SelectingFolderState( - folders: folders, - selectedFolder: event.folder, - )); + final folderTree = + await driveDao.getFolderTree(event.folder.driveId, event.folder.id); + FolderEntry? parentFolder; + if (event.folder.parentFolderId != null) { + parentFolder = await driveDao + .folderById( + driveId: event.folder.driveId, + folderId: event.folder.parentFolderId!) + .getSingle(); + } + + emit( + SelectingFolderState( + isRootFolder: event.folder.id == selectedDrive!.rootFolderId, + parentFolder: parentFolder, + selectedFolder: event.folder, + folders: folderTree.subfolders.map((e) => e.folder).toList(), + ), + ); } else if (event is ConfirmFolderEvent) { emit(FolderSelectedState(event.folder.id, event.folder.driveId)); } diff --git a/lib/sharing/folder_selector/folder_selector_event.dart b/lib/sharing/folder_selector/folder_selector_event.dart index 91cc9f1ed2..022bad35d7 100644 --- a/lib/sharing/folder_selector/folder_selector_event.dart +++ b/lib/sharing/folder_selector/folder_selector_event.dart @@ -39,7 +39,9 @@ final class ConfirmFolderEvent extends FolderSelectorEvent { final class SelectFolderEvent extends FolderSelectorEvent { final FolderEntry folder; - const SelectFolderEvent(this.folder); + const SelectFolderEvent({ + required this.folder, + }); @override List get props => [folder]; diff --git a/lib/sharing/folder_selector/folder_selector_state.dart b/lib/sharing/folder_selector/folder_selector_state.dart index 2bce5a6cbb..6ba145f7db 100644 --- a/lib/sharing/folder_selector/folder_selector_state.dart +++ b/lib/sharing/folder_selector/folder_selector_state.dart @@ -23,9 +23,16 @@ final class SelectingDriveState extends FolderSelectorState { final class SelectingFolderState extends FolderSelectorState { final List folders; + final FolderEntry? parentFolder; final FolderEntry? selectedFolder; - - const SelectingFolderState({required this.folders, this.selectedFolder}); + final bool isRootFolder; + + const SelectingFolderState({ + required this.folders, + this.selectedFolder, + this.isRootFolder = false, + this.parentFolder, + }); @override List get props => [folders, selectedFolder ?? '']; diff --git a/lib/sharing/sharing_file_listener.dart b/lib/sharing/sharing_file_listener.dart index 64e0cc6db1..a0de359592 100644 --- a/lib/sharing/sharing_file_listener.dart +++ b/lib/sharing/sharing_file_listener.dart @@ -62,6 +62,10 @@ class _SharingFileListenerState extends State { files: state.files, ); }, + dispose: () { + BlocProvider.of(context) + .add(SharingFileCleared()); + }, ), ), ); From 65c13e3d36cbed871cc335d3858d71f16877358e Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Fri, 26 Jan 2024 08:29:27 -0300 Subject: [PATCH 12/24] Update main.dart --- lib/main.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/main.dart b/lib/main.dart index ad13787e2f..e9546056c0 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -12,7 +12,6 @@ import 'package:ardrive/core/crypto/crypto.dart'; import 'package:ardrive/models/database/database_helpers.dart'; import 'package:ardrive/services/authentication/biometric_authentication.dart'; import 'package:ardrive/services/config/config_fetcher.dart'; -import 'package:ardrive/sharing/blocs/sharing_file_bloc.dart'; import 'package:ardrive/theme/theme_switcher_bloc.dart'; import 'package:ardrive/theme/theme_switcher_state.dart'; import 'package:ardrive/turbo/services/payment_service.dart'; From 7111e2a610e77201d557b35c93ef9d63fcf41c69 Mon Sep 17 00:00:00 2001 From: atticusofsparta Date: Sun, 28 Jan 2024 20:22:48 -0600 Subject: [PATCH 13/24] fix(intent share): fixes navigation, font colors, and freezing on upload using intents --- lib/main.dart | 2 ++ lib/sharing/blocs/sharing_file_bloc.dart | 2 ++ lib/sharing/blocs/sharing_file_state.dart | 5 ++- .../folder_selector/folder_selector.dart | 36 +++++++++++-------- lib/sharing/sharing_file_listener.dart | 22 +++++++----- 5 files changed, 44 insertions(+), 23 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index e9546056c0..c84de39385 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -12,6 +12,7 @@ import 'package:ardrive/core/crypto/crypto.dart'; import 'package:ardrive/models/database/database_helpers.dart'; import 'package:ardrive/services/authentication/biometric_authentication.dart'; import 'package:ardrive/services/config/config_fetcher.dart'; +import 'package:ardrive/sharing/blocs/sharing_file_bloc.dart'; import 'package:ardrive/theme/theme_switcher_bloc.dart'; import 'package:ardrive/theme/theme_switcher_state.dart'; import 'package:ardrive/turbo/services/payment_service.dart'; @@ -267,6 +268,7 @@ class AppState extends State { driveDao: context.read(), ), ), + BlocProvider(create: (context) => SharingFileBloc(ActivityTracker())), ]; List get repositoryProviders => [ diff --git a/lib/sharing/blocs/sharing_file_bloc.dart b/lib/sharing/blocs/sharing_file_bloc.dart index 267101b2a7..f21418f053 100644 --- a/lib/sharing/blocs/sharing_file_bloc.dart +++ b/lib/sharing/blocs/sharing_file_bloc.dart @@ -56,6 +56,8 @@ class SharingFileBloc extends Bloc { } else if (event is SharingFileCleared) { files = null; activityTracker.setSharingFilesFromExternalApp(false); + emit( + SharingFileClearedState()); // Emit a new state indicating that files are cleared } }); } diff --git a/lib/sharing/blocs/sharing_file_state.dart b/lib/sharing/blocs/sharing_file_state.dart index 4c49f9cc7b..853c0f8028 100644 --- a/lib/sharing/blocs/sharing_file_state.dart +++ b/lib/sharing/blocs/sharing_file_state.dart @@ -18,4 +18,7 @@ final class SharingFileReceivedState extends SharingFileState { List get props => [files]; } -final class SharingFileClearedState extends SharingFileState {} +final class SharingFileClearedState extends SharingFileState { + @override + List get props => []; +} diff --git a/lib/sharing/folder_selector/folder_selector.dart b/lib/sharing/folder_selector/folder_selector.dart index ab3135192e..99520006e4 100644 --- a/lib/sharing/folder_selector/folder_selector.dart +++ b/lib/sharing/folder_selector/folder_selector.dart @@ -59,7 +59,11 @@ class _FolderSelectorState extends State { if (publicDrives.isNotEmpty) ...[ Text( 'Public Drives', - style: ArDriveTypography.body.buttonLargeBold(), + style: ArDriveTypography.body.buttonLargeBold( + color: ArDriveTheme.of(context) + .themeData + .colors + .themeFgSubtle), ), const Divider(), ListView.builder( @@ -70,10 +74,10 @@ class _FolderSelectorState extends State { itemBuilder: (context, index) { final publicDrive = publicDrives[index]; final color = state.selectedDrive == null - ? null + ? colors.themeFgSubtle : state.selectedDrive != null ? publicDrive.id == state.selectedDrive!.id - ? null + ? colors.themeFgOnAccent : colors.themeAccentDisabled : null; return ListTile( @@ -83,9 +87,7 @@ class _FolderSelectorState extends State { title: Text( publicDrive.name, style: ArDriveTypography.body - .buttonLargeBold( - color: color, - ) + .buttonLargeBold(color: color) .copyWith( fontWeight: state.selectedDrive?.id == publicDrive.id @@ -104,10 +106,8 @@ class _FolderSelectorState extends State { ], if (privateDrives.isNotEmpty) ...[ const SizedBox(height: 16), - Text( - 'Private Drives', - style: ArDriveTypography.body.buttonLargeBold(), - ), + Text('Private Drives', + style: ArDriveTypography.body.buttonLargeBold()), const Divider(), ListView.builder( padding: EdgeInsets.zero, @@ -117,7 +117,7 @@ class _FolderSelectorState extends State { itemBuilder: (context, index) { final privateDrive = privateDrives[index]; final color = state.selectedDrive == null - ? null + ? colors.themeFgSubtle : state.selectedDrive != null ? privateDrive.id == state.selectedDrive!.id ? null @@ -195,7 +195,11 @@ class _FolderSelectorState extends State { title: Text( 'Root folder', style: ArDriveTypography.body - .buttonLargeBold() + .buttonLargeBold( + color: ArDriveTheme.of(context) + .themeData + .colors + .themeFgOnAccent) .copyWith(fontWeight: FontWeight.w700), ), ), @@ -223,7 +227,11 @@ class _FolderSelectorState extends State { title: Text( state.selectedFolder!.name, style: ArDriveTypography.body - .buttonLargeBold() + .buttonLargeBold( + color: ArDriveTheme.of(context) + .themeData + .colors + .themeFgSubtle) .copyWith(fontWeight: FontWeight.w700), ), ), @@ -243,7 +251,7 @@ class _FolderSelectorState extends State { shrinkWrap: true, itemBuilder: (context, index) { final color = state.selectedFolder == null - ? null + ? colors.themeFgSubtle : state.selectedFolder != null ? state.folders[index].id == state.selectedFolder!.id diff --git a/lib/sharing/sharing_file_listener.dart b/lib/sharing/sharing_file_listener.dart index d0a981fbdf..e26083f30d 100644 --- a/lib/sharing/sharing_file_listener.dart +++ b/lib/sharing/sharing_file_listener.dart @@ -4,6 +4,7 @@ import 'package:ardrive/pages/drive_detail/components/drive_explorer_item_tile.d import 'package:ardrive/sharing/blocs/sharing_file_bloc.dart'; import 'package:ardrive/sharing/folder_selector/folder_selector.dart'; import 'package:ardrive/sharing/folder_selector/folder_selector_bloc.dart'; +import 'package:ardrive/utils/app_localizations_wrapper.dart'; import 'package:ardrive/utils/show_general_dialog.dart'; import 'package:ardrive_ui/ardrive_ui.dart'; import 'package:flutter/material.dart'; @@ -21,7 +22,6 @@ class SharingFileListener extends StatefulWidget { class _SharingFileListenerState extends State { @override void dispose() { - BlocProvider.of(context).add(SharingFileCleared()); super.dispose(); } @@ -29,19 +29,19 @@ class _SharingFileListenerState extends State { Widget build(BuildContext context) { return BlocListener( listener: (context, state) { + final sharingFileBloc = context.read(); if (state is SharingFileReceivedState) { showArDriveDialog( context, content: ArDriveStandardModal( - title: 'Shared Files', + title: appLocalizationsOf(context).shareFile, actions: [ ModalAction( action: () { Navigator.of(context).pop(); - BlocProvider.of(context) - .add(SharingFileCleared()); + sharingFileBloc.add(SharingFileCleared()); }, - title: 'Cancel', + title: appLocalizationsOf(context).cancel, ), ModalAction( action: () { @@ -63,13 +63,14 @@ class _SharingFileListenerState extends State { ); }, dispose: () { - BlocProvider.of(context) - .add(SharingFileCleared()); + Navigator.of(context).pop(); + sharingFileBloc.add(SharingFileCleared()); }, ), ), ); }, + // TODOL Localize title: 'Select Drive', ), ], @@ -86,7 +87,12 @@ class _SharingFileListenerState extends State { ), title: Text( state.files[index].name, - style: ArDriveTypography.body.buttonLargeBold(), + style: ArDriveTypography.body.buttonLargeBold( + color: ArDriveTheme.of(context) + .themeData + .colors + .themeFgOnAccent, + ), ), ); }, From 331d5e8c0a763f29f97f17c9093cafabfe672c90 Mon Sep 17 00:00:00 2001 From: atticusofsparta Date: Sun, 28 Jan 2024 20:54:12 -0600 Subject: [PATCH 14/24] fix(drive select): scroll issues --- lib/sharing/folder_selector/folder_selector.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/sharing/folder_selector/folder_selector.dart b/lib/sharing/folder_selector/folder_selector.dart index 99520006e4..0bc058f2f6 100644 --- a/lib/sharing/folder_selector/folder_selector.dart +++ b/lib/sharing/folder_selector/folder_selector.dart @@ -68,7 +68,7 @@ class _FolderSelectorState extends State { const Divider(), ListView.builder( padding: EdgeInsets.zero, - physics: const NeverScrollableScrollPhysics(), + physics: const ScrollPhysics(), itemCount: publicDrives.length, shrinkWrap: true, itemBuilder: (context, index) { @@ -111,7 +111,6 @@ class _FolderSelectorState extends State { const Divider(), ListView.builder( padding: EdgeInsets.zero, - physics: const NeverScrollableScrollPhysics(), itemCount: privateDrives.length, shrinkWrap: true, itemBuilder: (context, index) { @@ -120,7 +119,7 @@ class _FolderSelectorState extends State { ? colors.themeFgSubtle : state.selectedDrive != null ? privateDrive.id == state.selectedDrive!.id - ? null + ? colors.themeFgSubtle : colors.themeAccentDisabled : null; return ListTile( @@ -249,6 +248,7 @@ class _FolderSelectorState extends State { : 20), itemCount: state.folders.length, shrinkWrap: true, + physics: const ScrollPhysics(), itemBuilder: (context, index) { final color = state.selectedFolder == null ? colors.themeFgSubtle From 8bb73abaceaa47f4109af13165cd793fcf70c722 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Mon, 29 Jan 2024 09:53:08 -0300 Subject: [PATCH 15/24] Update main.dart - add missing bloc --- lib/main.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/main.dart b/lib/main.dart index e9546056c0..03ba94ce45 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -12,6 +12,7 @@ import 'package:ardrive/core/crypto/crypto.dart'; import 'package:ardrive/models/database/database_helpers.dart'; import 'package:ardrive/services/authentication/biometric_authentication.dart'; import 'package:ardrive/services/config/config_fetcher.dart'; +import 'package:ardrive/sharing/blocs/sharing_file_bloc.dart'; import 'package:ardrive/theme/theme_switcher_bloc.dart'; import 'package:ardrive/theme/theme_switcher_state.dart'; import 'package:ardrive/turbo/services/payment_service.dart'; @@ -267,6 +268,9 @@ class AppState extends State { driveDao: context.read(), ), ), + BlocProvider( + create: (context) => SharingFileBloc(context.read()), + ), ]; List get repositoryProviders => [ From cef7a5cf1d839821c1de8c84e57f2b9338b98788 Mon Sep 17 00:00:00 2001 From: atticusofsparta Date: Mon, 29 Jan 2024 13:46:06 -0600 Subject: [PATCH 16/24] fix(colors): use correct text theme in modals --- lib/sharing/folder_selector/folder_selector.dart | 14 +++++++------- lib/sharing/sharing_file_listener.dart | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/sharing/folder_selector/folder_selector.dart b/lib/sharing/folder_selector/folder_selector.dart index 99520006e4..0407b304d2 100644 --- a/lib/sharing/folder_selector/folder_selector.dart +++ b/lib/sharing/folder_selector/folder_selector.dart @@ -63,7 +63,7 @@ class _FolderSelectorState extends State { color: ArDriveTheme.of(context) .themeData .colors - .themeFgSubtle), + .themeFgDefault), ), const Divider(), ListView.builder( @@ -74,10 +74,10 @@ class _FolderSelectorState extends State { itemBuilder: (context, index) { final publicDrive = publicDrives[index]; final color = state.selectedDrive == null - ? colors.themeFgSubtle + ? colors.themeFgDefault : state.selectedDrive != null ? publicDrive.id == state.selectedDrive!.id - ? colors.themeFgOnAccent + ? colors.themeFgDefault : colors.themeAccentDisabled : null; return ListTile( @@ -117,10 +117,10 @@ class _FolderSelectorState extends State { itemBuilder: (context, index) { final privateDrive = privateDrives[index]; final color = state.selectedDrive == null - ? colors.themeFgSubtle + ? colors.themeFgDefault : state.selectedDrive != null ? privateDrive.id == state.selectedDrive!.id - ? null + ? colors.themeFgDefault : colors.themeAccentDisabled : null; return ListTile( @@ -199,7 +199,7 @@ class _FolderSelectorState extends State { color: ArDriveTheme.of(context) .themeData .colors - .themeFgOnAccent) + .themeFgDefault) .copyWith(fontWeight: FontWeight.w700), ), ), @@ -231,7 +231,7 @@ class _FolderSelectorState extends State { color: ArDriveTheme.of(context) .themeData .colors - .themeFgSubtle) + .themeFgDefault) .copyWith(fontWeight: FontWeight.w700), ), ), diff --git a/lib/sharing/sharing_file_listener.dart b/lib/sharing/sharing_file_listener.dart index e26083f30d..85cf6a956a 100644 --- a/lib/sharing/sharing_file_listener.dart +++ b/lib/sharing/sharing_file_listener.dart @@ -70,7 +70,7 @@ class _SharingFileListenerState extends State { ), ); }, - // TODOL Localize + // TODO: Localize title: 'Select Drive', ), ], @@ -91,7 +91,7 @@ class _SharingFileListenerState extends State { color: ArDriveTheme.of(context) .themeData .colors - .themeFgOnAccent, + .themeFgDefault, ), ), ); From 77d8879ca88a87ebada8e1d08dc77b36eef81114 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Mon, 29 Jan 2024 20:55:45 -0300 Subject: [PATCH 17/24] fix(sharing intent) - use a fixed version of sharing intent plugin --- lib/sharing/folder_selector/folder_selector.dart | 1 + pubspec.lock | 9 +++++---- pubspec.yaml | 5 ++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/sharing/folder_selector/folder_selector.dart b/lib/sharing/folder_selector/folder_selector.dart index 0407b304d2..53de0eca70 100644 --- a/lib/sharing/folder_selector/folder_selector.dart +++ b/lib/sharing/folder_selector/folder_selector.dart @@ -179,6 +179,7 @@ class _FolderSelectorState extends State { content = SizedBox( height: 400, child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ if (state.selectedFolder != null) ...[ SizedBox( diff --git a/pubspec.lock b/pubspec.lock index 3b5d157d2f..7fea1220e5 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -928,10 +928,11 @@ packages: flutter_sharing_intent: dependency: "direct main" description: - name: flutter_sharing_intent - sha256: "6eb896e6523b735e8230eeb206fd3b9f220f11ce879c2400a90b443147036ff9" - url: "https://pub.dev" - source: hosted + path: "." + ref: "5f4f2e66c02580105ba89b3fec5a7be907d5466f" + resolved-ref: "5f4f2e66c02580105ba89b3fec5a7be907d5466f" + url: "https://github.com/bhagat-techind/flutter_sharing_intent" + source: git version: "1.1.0" flutter_stripe: dependency: "direct main" diff --git a/pubspec.yaml b/pubspec.yaml index e4290a046f..a8c3773902 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -132,7 +132,10 @@ dependencies: loading_animation_widget: ^1.2.0+4 synchronized: ^3.1.0 confetti: ^0.7.0 - flutter_sharing_intent: ^1.1.0 + flutter_sharing_intent: + git: + url: https://github.com/bhagat-techind/flutter_sharing_intent + ref: 5f4f2e66c02580105ba89b3fec5a7be907d5466f sentry_flutter: ^7.14.0 dependency_overrides: From c54ae40036ca600a289e3a8723381c0fe0ff3668 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Mon, 29 Jan 2024 21:31:12 -0300 Subject: [PATCH 18/24] remove duplicated event --- lib/sharing/blocs/sharing_file_bloc.dart | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/sharing/blocs/sharing_file_bloc.dart b/lib/sharing/blocs/sharing_file_bloc.dart index f21418f053..6312dd9dcb 100644 --- a/lib/sharing/blocs/sharing_file_bloc.dart +++ b/lib/sharing/blocs/sharing_file_bloc.dart @@ -35,11 +35,6 @@ class SharingFileBloc extends Bloc { } }); - // For sharing images coming from outside the app while the app is in the memory - FlutterSharingIntent.instance.getMediaStream().listen((event) { - add(SharingFileReceived(event)); - }); - on((event, emit) async { if (event is SharingFileReceived) { activityTracker.setSharingFilesFromExternalApp(true); From 15ead3f7fa94a6370b6f00b5620d47d211d82187 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Mon, 29 Jan 2024 21:34:30 -0300 Subject: [PATCH 19/24] remove pop --- lib/sharing/sharing_file_listener.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/sharing/sharing_file_listener.dart b/lib/sharing/sharing_file_listener.dart index 85cf6a956a..3b67b61045 100644 --- a/lib/sharing/sharing_file_listener.dart +++ b/lib/sharing/sharing_file_listener.dart @@ -63,7 +63,6 @@ class _SharingFileListenerState extends State { ); }, dispose: () { - Navigator.of(context).pop(); sharingFileBloc.add(SharingFileCleared()); }, ), From bc0781fca31213668c526850cf75f3fd582a6a19 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Mon, 29 Jan 2024 22:01:01 -0300 Subject: [PATCH 20/24] fix(sharing file) - disable sync if the app is verifying if there's any file coming from outside the app --- lib/blocs/sync/sync_cubit.dart | 12 +++++++++--- lib/core/activity_tracker.dart | 9 +++++++++ lib/sharing/blocs/sharing_file_bloc.dart | 2 ++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/lib/blocs/sync/sync_cubit.dart b/lib/blocs/sync/sync_cubit.dart index 5ee2c1c2d7..993089c299 100644 --- a/lib/blocs/sync/sync_cubit.dart +++ b/lib/blocs/sync/sync_cubit.dart @@ -191,9 +191,15 @@ class SyncCubit extends Cubit { var ghostFolders = {}; Future startSync({bool syncDeep = false}) async { - if (_activityTracker.isSharingFilesFromExternalApp) { - logger.d('An activity is in progress, skipping sync.'); - return; + if (AppPlatform.isMobile) { + if (_activityTracker.isSharingFilesFromExternalApp) { + logger.d('An activity is in progress, skipping sync.'); + + return; + } else if (_activityTracker.isVerifyingSharingFilesFromExternalApp) { + Future.delayed(const Duration(seconds: 2)).then((value) => startSync()); + return; + } } logger.i('Starting Sync'); diff --git a/lib/core/activity_tracker.dart b/lib/core/activity_tracker.dart index 212ca4382f..61a6dcd33c 100644 --- a/lib/core/activity_tracker.dart +++ b/lib/core/activity_tracker.dart @@ -5,6 +5,7 @@ class ActivityTracker extends ChangeNotifier { bool _isShowingAnyDialog = false; bool _isUploading = false; bool _isSharingFilesFromExternalApp = false; + bool _isVerifyingSharingFilesFromExternalApp = true; // getters bool get isToppingUp => _isToppingUp; @@ -21,6 +22,9 @@ class ActivityTracker extends ChangeNotifier { bool get isSharingFilesFromExternalApp => _isSharingFilesFromExternalApp; + bool get isVerifyingSharingFilesFromExternalApp => + _isVerifyingSharingFilesFromExternalApp; + // setters void setUploading(bool value) { _isUploading = value; @@ -40,4 +44,9 @@ class ActivityTracker extends ChangeNotifier { _isSharingFilesFromExternalApp = value; notifyListeners(); } + + void setVerifyingSharingFilesFromExternalApp(bool value) { + _isVerifyingSharingFilesFromExternalApp = value; + notifyListeners(); + } } diff --git a/lib/sharing/blocs/sharing_file_bloc.dart b/lib/sharing/blocs/sharing_file_bloc.dart index 6312dd9dcb..e71c34622a 100644 --- a/lib/sharing/blocs/sharing_file_bloc.dart +++ b/lib/sharing/blocs/sharing_file_bloc.dart @@ -25,6 +25,8 @@ class SharingFileBloc extends Bloc { if (value.isNotEmpty) { add(SharingFileReceived(value)); } + + activityTracker.setVerifyingSharingFilesFromExternalApp(false); }); FlutterSharingIntent.instance.getMediaStream().listen((value) { From b98e060c7469b3dd7adc1e3da683965a353b7113 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Tue, 30 Jan 2024 00:53:13 -0300 Subject: [PATCH 21/24] fix(sharing) sync first and then add the shared files --- lib/blocs/sync/sync_cubit.dart | 11 --------- lib/main.dart | 4 +++- lib/pages/drive_detail/drive_detail_page.dart | 1 + lib/sharing/blocs/sharing_file_bloc.dart | 4 ++-- lib/sharing/blocs/sharing_file_event.dart | 2 ++ lib/sharing/sharing_file_listener.dart | 23 +++++++++++++++---- 6 files changed, 26 insertions(+), 19 deletions(-) diff --git a/lib/blocs/sync/sync_cubit.dart b/lib/blocs/sync/sync_cubit.dart index 993089c299..715d011605 100644 --- a/lib/blocs/sync/sync_cubit.dart +++ b/lib/blocs/sync/sync_cubit.dart @@ -191,17 +191,6 @@ class SyncCubit extends Cubit { var ghostFolders = {}; Future startSync({bool syncDeep = false}) async { - if (AppPlatform.isMobile) { - if (_activityTracker.isSharingFilesFromExternalApp) { - logger.d('An activity is in progress, skipping sync.'); - - return; - } else if (_activityTracker.isVerifyingSharingFilesFromExternalApp) { - Future.delayed(const Duration(seconds: 2)).then((value) => startSync()); - return; - } - } - logger.i('Starting Sync'); if (state is SyncInProgress) { diff --git a/lib/main.dart b/lib/main.dart index 03ba94ce45..b4a77b3d60 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -269,7 +269,9 @@ class AppState extends State { ), ), BlocProvider( - create: (context) => SharingFileBloc(context.read()), + create: (context) => SharingFileBloc( + context.read(), + ), ), ]; diff --git a/lib/pages/drive_detail/drive_detail_page.dart b/lib/pages/drive_detail/drive_detail_page.dart index 99fb24f525..ac8b40bb13 100644 --- a/lib/pages/drive_detail/drive_detail_page.dart +++ b/lib/pages/drive_detail/drive_detail_page.dart @@ -113,6 +113,7 @@ class _DriveDetailPageState extends State { @override Widget build(BuildContext context) { return SharingFileListener( + context: context, child: SizedBox.expand( child: BlocListener( listener: (context, state) { diff --git a/lib/sharing/blocs/sharing_file_bloc.dart b/lib/sharing/blocs/sharing_file_bloc.dart index e71c34622a..6527dedc91 100644 --- a/lib/sharing/blocs/sharing_file_bloc.dart +++ b/lib/sharing/blocs/sharing_file_bloc.dart @@ -25,8 +25,6 @@ class SharingFileBloc extends Bloc { if (value.isNotEmpty) { add(SharingFileReceived(value)); } - - activityTracker.setVerifyingSharingFilesFromExternalApp(false); }); FlutterSharingIntent.instance.getMediaStream().listen((value) { @@ -50,6 +48,8 @@ class SharingFileBloc extends Bloc { } emit(SharingFileReceivedState(ioFiles)); + } else if (event is ResubmitSharingFile) { + add(SharingFileReceived(files!)); } else if (event is SharingFileCleared) { files = null; activityTracker.setSharingFilesFromExternalApp(false); diff --git a/lib/sharing/blocs/sharing_file_event.dart b/lib/sharing/blocs/sharing_file_event.dart index 9957579202..12ab32731d 100644 --- a/lib/sharing/blocs/sharing_file_event.dart +++ b/lib/sharing/blocs/sharing_file_event.dart @@ -16,6 +16,8 @@ class SharingFileReceived extends SharingFileEvent { List get props => [files]; } +class ResubmitSharingFile extends SharingFileEvent {} + class ShowSharingFile extends SharingFileEvent {} class SharingFileCleared extends SharingFileEvent {} diff --git a/lib/sharing/sharing_file_listener.dart b/lib/sharing/sharing_file_listener.dart index 3b67b61045..48f98d514b 100644 --- a/lib/sharing/sharing_file_listener.dart +++ b/lib/sharing/sharing_file_listener.dart @@ -1,3 +1,4 @@ +import 'package:ardrive/blocs/sync/sync_cubit.dart'; import 'package:ardrive/components/components.dart'; import 'package:ardrive/models/daos/daos.dart'; import 'package:ardrive/pages/drive_detail/components/drive_explorer_item_tile.dart'; @@ -11,9 +12,11 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; class SharingFileListener extends StatefulWidget { - const SharingFileListener({super.key, required this.child}); + const SharingFileListener( + {super.key, required this.child, required this.context}); final Widget child; + final BuildContext context; @override State createState() => _SharingFileListenerState(); @@ -29,11 +32,21 @@ class _SharingFileListenerState extends State { Widget build(BuildContext context) { return BlocListener( listener: (context, state) { + final syncCubit = context.read(); final sharingFileBloc = context.read(); if (state is SharingFileReceivedState) { - showArDriveDialog( - context, - content: ArDriveStandardModal( + if (syncCubit.state is SyncInProgress) { + syncCubit.stream.listen((syncState) { + if (syncState is SyncIdle) { + context.read().add(ResubmitSharingFile()); + } + }); + return; + } + + showAnimatedDialogWithBuilder( + widget.context, + builder: (context) => ArDriveStandardModal( title: appLocalizationsOf(context).shareFile, actions: [ ModalAction( @@ -55,7 +68,7 @@ class _SharingFileListenerState extends State { child: FolderSelector( onSelect: (folderId, driveId) { promptToUpload( - context, + widget.context, driveId: driveId, parentFolderId: folderId, isFolderUpload: false, From 38c52bde9ca1716cc6f1ac27d461a3d37b09e3b7 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Tue, 30 Jan 2024 00:53:54 -0300 Subject: [PATCH 22/24] fix(sharing) --- lib/pages/app_router_delegate.dart | 5 +++-- lib/pages/drive_detail/drive_detail_page.dart | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/pages/app_router_delegate.dart b/lib/pages/app_router_delegate.dart index a1ffb57a57..a2b8c4585e 100644 --- a/lib/pages/app_router_delegate.dart +++ b/lib/pages/app_router_delegate.dart @@ -66,8 +66,8 @@ class AppRouterDelegate extends RouterDelegate AppRouterDelegate() : navigatorKey = GlobalKey(); @override - Widget build(BuildContext context) { - if (context.read().flavor != Flavor.production) { + Widget build(BuildContext navigatorContext) { + if (navigatorContext.read().flavor != Flavor.production) { return ArDriveAppWithDevTools(widget: _app()); } @@ -165,6 +165,7 @@ class AppRouterDelegate extends RouterDelegate if (state is DrivesLoadSuccess) { shellPage = !state.hasNoDrives ? DriveDetailPage( + context: navigatorKey.currentContext!, anonymouslyShowDriveDetail: anonymouslyShowDriveDetail, ) diff --git a/lib/pages/drive_detail/drive_detail_page.dart b/lib/pages/drive_detail/drive_detail_page.dart index ac8b40bb13..00cb805949 100644 --- a/lib/pages/drive_detail/drive_detail_page.dart +++ b/lib/pages/drive_detail/drive_detail_page.dart @@ -65,8 +65,10 @@ part 'components/fs_entry_preview_widget.dart'; class DriveDetailPage extends StatefulWidget { final bool anonymouslyShowDriveDetail; + final BuildContext context; const DriveDetailPage({ + required this.context, Key? key, required this.anonymouslyShowDriveDetail, }) : super(key: key); @@ -113,7 +115,7 @@ class _DriveDetailPageState extends State { @override Widget build(BuildContext context) { return SharingFileListener( - context: context, + context: widget.context, child: SizedBox.expand( child: BlocListener( listener: (context, state) { From 7e262039d5e4d8cd99313a9a9aca67039f216934 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Tue, 30 Jan 2024 00:54:19 -0300 Subject: [PATCH 23/24] fix lint --- lib/blocs/sync/sync_cubit.dart | 2 -- lib/pages/app_router_delegate.dart | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/blocs/sync/sync_cubit.dart b/lib/blocs/sync/sync_cubit.dart index 715d011605..1b8d644368 100644 --- a/lib/blocs/sync/sync_cubit.dart +++ b/lib/blocs/sync/sync_cubit.dart @@ -60,7 +60,6 @@ class SyncCubit extends Cubit { final Database _db; final TabVisibilitySingleton _tabVisibility; final ConfigService _configService; - final ActivityTracker _activityTracker; StreamSubscription? _restartOnFocusStreamSubscription; StreamSubscription? _restartArConnectOnFocusStreamSubscription; @@ -84,7 +83,6 @@ class SyncCubit extends Cubit { required ActivityTracker activityTracker, }) : _profileCubit = profileCubit, _activityCubit = activityCubit, - _activityTracker = activityTracker, _promptToSnapshotBloc = promptToSnapshotBloc, _arweave = arweave, _driveDao = driveDao, diff --git a/lib/pages/app_router_delegate.dart b/lib/pages/app_router_delegate.dart index a2b8c4585e..b4e643ecd4 100644 --- a/lib/pages/app_router_delegate.dart +++ b/lib/pages/app_router_delegate.dart @@ -66,6 +66,7 @@ class AppRouterDelegate extends RouterDelegate AppRouterDelegate() : navigatorKey = GlobalKey(); @override + // ignore: avoid_renaming_method_parameters Widget build(BuildContext navigatorContext) { if (navigatorContext.read().flavor != Flavor.production) { return ArDriveAppWithDevTools(widget: _app()); From 8532cb5cdf2b14459baebc3747026f4b1bab0e97 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Tue, 30 Jan 2024 00:57:44 -0300 Subject: [PATCH 24/24] Update folder_selector.dart add scroll to folder selector --- .../folder_selector/folder_selector.dart | 202 +++++++++--------- 1 file changed, 103 insertions(+), 99 deletions(-) diff --git a/lib/sharing/folder_selector/folder_selector.dart b/lib/sharing/folder_selector/folder_selector.dart index fe952c82da..d03e8a3f27 100644 --- a/lib/sharing/folder_selector/folder_selector.dart +++ b/lib/sharing/folder_selector/folder_selector.dart @@ -177,114 +177,118 @@ class _FolderSelectorState extends State { description = 'Select the folder you want to upload to'; content = SizedBox( height: 400, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (state.selectedFolder != null) ...[ - SizedBox( - width: 200, - height: 48, - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - if (state.isRootFolder) - Flexible( - child: ListTile( - leading: - getIconForContentType('folder', size: 24), - title: Text( - 'Root folder', - style: ArDriveTypography.body - .buttonLargeBold( - color: ArDriveTheme.of(context) - .themeData - .colors - .themeFgDefault) - .copyWith(fontWeight: FontWeight.w700), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (state.selectedFolder != null) ...[ + SizedBox( + width: 200, + height: 48, + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + if (state.isRootFolder) + Flexible( + child: ListTile( + leading: + getIconForContentType('folder', size: 24), + title: Text( + 'Root folder', + style: ArDriveTypography.body + .buttonLargeBold( + color: ArDriveTheme.of(context) + .themeData + .colors + .themeFgDefault) + .copyWith(fontWeight: FontWeight.w700), + ), ), ), - ), - if (state.parentFolder != null && !state.isRootFolder) - Padding( - padding: const EdgeInsets.only(top: 4.0, right: 4), - child: SizedBox( - width: 24, - child: ArDriveIconButton( - icon: ArDriveIcons.arrowLeft(), - onPressed: () { - context.read().add( - SelectFolderEvent( - folder: state.parentFolder!)); - }, + if (state.parentFolder != null && !state.isRootFolder) + Padding( + padding: + const EdgeInsets.only(top: 4.0, right: 4), + child: SizedBox( + width: 24, + child: ArDriveIconButton( + icon: ArDriveIcons.arrowLeft(), + onPressed: () { + context.read().add( + SelectFolderEvent( + folder: state.parentFolder!)); + }, + ), ), ), - ), - if (!state.isRootFolder) - Flexible( - child: ListTile( - leading: - getIconForContentType('folder', size: 24), - title: Text( - state.selectedFolder!.name, - style: ArDriveTypography.body - .buttonLargeBold( - color: ArDriveTheme.of(context) - .themeData - .colors - .themeFgDefault) - .copyWith(fontWeight: FontWeight.w700), + if (!state.isRootFolder) + Flexible( + child: ListTile( + leading: + getIconForContentType('folder', size: 24), + title: Text( + state.selectedFolder!.name, + style: ArDriveTypography.body + .buttonLargeBold( + color: ArDriveTheme.of(context) + .themeData + .colors + .themeFgDefault) + .copyWith(fontWeight: FontWeight.w700), + ), ), ), - ), - ], + ], + ), ), + ], + ListView.builder( + padding: EdgeInsets.only( + left: state.selectedFolder == null + ? 0 + : state.parentFolder != null + ? 48 + : 20), + itemCount: state.folders.length, + shrinkWrap: true, + physics: const ScrollPhysics(), + itemBuilder: (context, index) { + final color = state.selectedFolder == null + ? colors.themeFgSubtle + : state.selectedFolder != null + ? state.folders[index].id == + state.selectedFolder!.id + ? null + : colors.themeAccentDisabled + : null; + return SizedBox( + width: 200, + child: ListTile( + leading: getIconForContentType('folder', + color: color, size: 24), + title: Text( + state.folders[index].name, + style: ArDriveTypography.body + .buttonLargeBold( + color: color, + ) + .copyWith( + fontWeight: state.selectedFolder?.id == + state.folders[index].id + ? FontWeight.w700 + : null), + ), + onTap: () { + context.read().add( + SelectFolderEvent( + folder: state.folders[index])); + }, + ), + ); + }, ), ], - ListView.builder( - padding: EdgeInsets.only( - left: state.selectedFolder == null - ? 0 - : state.parentFolder != null - ? 48 - : 20), - itemCount: state.folders.length, - shrinkWrap: true, - physics: const ScrollPhysics(), - itemBuilder: (context, index) { - final color = state.selectedFolder == null - ? colors.themeFgSubtle - : state.selectedFolder != null - ? state.folders[index].id == - state.selectedFolder!.id - ? null - : colors.themeAccentDisabled - : null; - return SizedBox( - width: 200, - child: ListTile( - leading: getIconForContentType('folder', - color: color, size: 24), - title: Text( - state.folders[index].name, - style: ArDriveTypography.body - .buttonLargeBold( - color: color, - ) - .copyWith( - fontWeight: state.selectedFolder?.id == - state.folders[index].id - ? FontWeight.w700 - : null), - ), - onTap: () { - context.read().add( - SelectFolderEvent(folder: state.folders[index])); - }, - ), - ); - }, - ), - ], + ), ), );