diff --git a/.github/actions/ci/action.yml b/.github/actions/ci/action.yml index 5ff0000..593d2f9 100644 --- a/.github/actions/ci/action.yml +++ b/.github/actions/ci/action.yml @@ -6,9 +6,9 @@ inputs: description: The type of CI to run. required: true relay-endpoint: - description: 'The endpoint of the relay e.g. relay.walletconnect.com' + description: 'The endpoint of the relay e.g. relay.walletconnect.org' required: false - default: 'wss://relay.walletconnect.com' + default: 'wss://relay.walletconnect.org' project-id: description: 'Reown project id' required: true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a6312b..e9e49ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,9 +14,9 @@ on: workflow_dispatch: inputs: relay-endpoint: - description: 'The endpoint of the relay e.g. relay.walletconnect.com' + description: 'The endpoint of the relay e.g. relay.walletconnect.org' required: false - default: 'wss://relay.walletconnect.com' + default: 'wss://relay.walletconnect.org' project-id: description: 'Reown project id' required: true diff --git a/README.md b/README.md index f425594..cbda539 100644 --- a/README.md +++ b/README.md @@ -12,11 +12,14 @@ The communications protocol for web3, Reown brings the ecosystem together by ena Reown is released under the Apache 2.0 license. [See LICENSE](/LICENSE) for details. -### Run +### Generate project dependencies -1. Run `sh scripts/generate_all.sh` in the root folder to generate dependencies. -2. Run `cd packages/reown_walletkit/example` -3. Run `flutter run --dart-define=PROJECT_ID=0123... --flavor internal --debug` +- Run `sh scripts/generate_all.sh` in the root folder to generate dependencies. + +### Run WalletKit Sample + +1. Run `cd packages/reown_walletkit/example` +2. Run `flutter run --dart-define=PROJECT_ID=0123... --flavor internal --debug` You can add your own keys for testing purposes as follows: @@ -33,3 +36,18 @@ You can add your own keys for testing purposes as follows: `--dart-define=POLKADOT_MNEMONIC=your mnemonic phrase....` `--dart-define=POLKADOT_ADDRESS=DbfmtKwL.........` + +_NB: WalletKit sample is intended to be used just as an explanatory project_ + + +### Run AppKit Sample + +AppKit has two samples, `base`, which is made with `ReownAppKit` UI-less SDK, and `modal`, which is made with `ReownAppKitModal` + +1. Run `cd packages/reown_appkit/example/base` +2. Run `flutter run --dart-define=PROJECT_ID=0123... --flavor internal --debug` + +or + +1. Run `cd packages/reown_appkit/example/modal` +2. Run `flutter run --dart-define=PROJECT_ID=0123... --debug` \ No newline at end of file diff --git a/packages/reown_appkit/example/base/ios/Runner.xcodeproj/project.pbxproj b/packages/reown_appkit/example/base/ios/Runner.xcodeproj/project.pbxproj index 731f3dc..14c2304 100644 --- a/packages/reown_appkit/example/base/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/reown_appkit/example/base/ios/Runner.xcodeproj/project.pbxproj @@ -10,11 +10,11 @@ 0964B3132C49545400AE1CDA /* Info-internal.plist in Resources */ = {isa = PBXBuildFile; fileRef = 0964B3122C49545400AE1CDA /* Info-internal.plist */; }; 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 414AE7E39195B5090F5D4CA6 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E773B8F41134281C9D4CFC19 /* Pods_Runner.framework */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - EE77454DAD8FD412D482F6C3 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0FBFF5BF09E84167BD163930 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -31,22 +31,23 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 038160CCD52183E3BE61EA85 /* Pods-Runner.release-internal.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release-internal.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release-internal.xcconfig"; sourceTree = ""; }; 0964B30E2C494D2000AE1CDA /* Debug-production.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Debug-production.xcconfig"; path = "Flutter/Debug-production.xcconfig"; sourceTree = ""; }; 0964B30F2C494D2000AE1CDA /* Release-internal.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Release-internal.xcconfig"; path = "Flutter/Release-internal.xcconfig"; sourceTree = ""; }; 0964B3102C494D2000AE1CDA /* Debug-internal.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Debug-internal.xcconfig"; path = "Flutter/Debug-internal.xcconfig"; sourceTree = ""; }; 0964B3112C494D2000AE1CDA /* Release-production.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Release-production.xcconfig"; path = "Flutter/Release-production.xcconfig"; sourceTree = ""; }; 0964B3122C49545400AE1CDA /* Info-internal.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Info-internal.plist"; sourceTree = ""; }; 09969A8C2C73BC9100B14363 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = ""; }; - 0FBFF5BF09E84167BD163930 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 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 = ""; }; - 31E1C0C6C1CE5B8C290B5BB7 /* Pods-Runner.debug-internal.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug-internal.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug-internal.xcconfig"; sourceTree = ""; }; - 36201DFA7BB123FA19946B2A /* Pods-Runner.profile-production.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile-production.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile-production.xcconfig"; sourceTree = ""; }; + 2295B3B5B048BF8CBE7C6911 /* Pods-Runner.debug-production.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug-production.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug-production.xcconfig"; sourceTree = ""; }; + 23D0106F3B30C1E9C84EE36C /* Pods-Runner.profile-production.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile-production.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile-production.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 7460D6D5C27478CFBE654AFE /* Pods-Runner.profile-internal.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile-internal.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile-internal.xcconfig"; sourceTree = ""; }; + 4F18E1279B89B3E98C9E5D7F /* Pods-Runner.release-production.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release-production.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release-production.xcconfig"; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 8FB84B8E81E1A4DB69A7C13A /* Pods-Runner.debug-internal.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug-internal.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug-internal.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -54,9 +55,8 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - BEC689F7C80562D797630DCB /* Pods-Runner.debug-production.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug-production.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug-production.xcconfig"; sourceTree = ""; }; - BEDB3C367A718D9F2360775F /* Pods-Runner.release-production.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release-production.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release-production.xcconfig"; sourceTree = ""; }; - EB796D13487CAE0905774D30 /* Pods-Runner.release-internal.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release-internal.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release-internal.xcconfig"; sourceTree = ""; }; + C03912E24A27574266826143 /* Pods-Runner.profile-internal.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile-internal.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile-internal.xcconfig"; sourceTree = ""; }; + E773B8F41134281C9D4CFC19 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -64,7 +64,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - EE77454DAD8FD412D482F6C3 /* Pods_Runner.framework in Frameworks */, + 414AE7E39195B5090F5D4CA6 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -74,24 +74,16 @@ 337F646810BF58BC9EACB5E5 /* Pods */ = { isa = PBXGroup; children = ( - BEC689F7C80562D797630DCB /* Pods-Runner.debug-production.xcconfig */, - 31E1C0C6C1CE5B8C290B5BB7 /* Pods-Runner.debug-internal.xcconfig */, - BEDB3C367A718D9F2360775F /* Pods-Runner.release-production.xcconfig */, - EB796D13487CAE0905774D30 /* Pods-Runner.release-internal.xcconfig */, - 36201DFA7BB123FA19946B2A /* Pods-Runner.profile-production.xcconfig */, - 7460D6D5C27478CFBE654AFE /* Pods-Runner.profile-internal.xcconfig */, + 2295B3B5B048BF8CBE7C6911 /* Pods-Runner.debug-production.xcconfig */, + 8FB84B8E81E1A4DB69A7C13A /* Pods-Runner.debug-internal.xcconfig */, + 4F18E1279B89B3E98C9E5D7F /* Pods-Runner.release-production.xcconfig */, + 038160CCD52183E3BE61EA85 /* Pods-Runner.release-internal.xcconfig */, + 23D0106F3B30C1E9C84EE36C /* Pods-Runner.profile-production.xcconfig */, + C03912E24A27574266826143 /* Pods-Runner.profile-internal.xcconfig */, ); path = Pods; sourceTree = ""; }; - 8A9501949039880DA079B0AA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 0FBFF5BF09E84167BD163930 /* Pods_Runner.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -114,7 +106,7 @@ 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, 337F646810BF58BC9EACB5E5 /* Pods */, - 8A9501949039880DA079B0AA /* Frameworks */, + B5826F140EB23A7B024AE981 /* Frameworks */, ); sourceTree = ""; }; @@ -143,6 +135,14 @@ path = Runner; sourceTree = ""; }; + B5826F140EB23A7B024AE981 /* Frameworks */ = { + isa = PBXGroup; + children = ( + E773B8F41134281C9D4CFC19 /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -150,14 +150,14 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - 06ECA84F670FFDD5592E70C3 /* [CP] Check Pods Manifest.lock */, + 737A078D8D63CB5D7C2CD01C /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 11B97BF15298ACF10C04BE97 /* [CP] Embed Pods Frameworks */, + EA6BD363A9BB5C05047E1A44 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -217,75 +217,75 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 06ECA84F670FFDD5592E70C3 /* [CP] Check Pods Manifest.lock */ = { + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); - inputFileListPaths = ( - ); inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); + name = "Thin Binary"; outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin\n"; }; - 11B97BF15298ACF10C04BE97 /* [CP] Embed Pods Frameworks */ = { + 737A078D8D63CB5D7C2CD01C /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Embed Pods Frameworks"; + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( - "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); - name = "Thin Binary"; + name = "Run Script"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin\n"; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build\n"; }; - 9740EEB61CF901F6004384FC /* Run Script */ = { + EA6BD363A9BB5C05047E1A44 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); - inputPaths = ( + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - name = "Run Script"; - outputPaths = ( + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ diff --git a/packages/reown_appkit/example/modal/integration_test/plugin_integration_test.dart b/packages/reown_appkit/example/modal/integration_test/plugin_integration_test.dart index 481e050..9d9f8e0 100644 --- a/packages/reown_appkit/example/modal/integration_test/plugin_integration_test.dart +++ b/packages/reown_appkit/example/modal/integration_test/plugin_integration_test.dart @@ -14,7 +14,7 @@ void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets('getPlatformVersion test', (WidgetTester tester) async { - // final AppKitModal plugin = AppKitModal(); + // final ReownAppKitModal plugin = ReownAppKitModal(); // final String? version = await plugin.getPlatformVersion(); // The version string depends on the host platform running the test, so // just assert that some non-empty string is returned. diff --git a/packages/reown_appkit/example/modal/ios/Runner.xcodeproj/project.pbxproj b/packages/reown_appkit/example/modal/ios/Runner.xcodeproj/project.pbxproj index 8005114..c329272 100644 --- a/packages/reown_appkit/example/modal/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/reown_appkit/example/modal/ios/Runner.xcodeproj/project.pbxproj @@ -8,14 +8,14 @@ /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 249F63BF944B3685222381FD /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41366A1C222737B9D9067671 /* Pods_RunnerTests.framework */; }; 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 6386F0203834B59B4E1A68F5 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D97CBA5AF486DBF3227D7F0D /* Pods_Runner.framework */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - DFE5E94090634FE93C4B3A51 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8ECAEF4D303E31FC191BFC9 /* Pods_Runner.framework */; }; - F7263D19E9C771D5D410EFAE /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C32DCD80A8A43366F689D184 /* Pods_RunnerTests.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -42,19 +42,19 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 0586207D0B42A9A899095729 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; 092D151B2ABD988600C69848 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = ""; }; - 1335300FE31578AEDDF553B3 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 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 = ""; }; - 2720EAFA66A072708D8721F7 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + 176AA5DE618321838E6E8B8A /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 59310688D2F58C1781EA2A0E /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; + 41366A1C222737B9D9067671 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 8E8A94E0E1D976EDB00D4963 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 81C610DEDD08EB2533E34747 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -62,10 +62,10 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - C32DCD80A8A43366F689D184 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - D41150082049425B949452B0 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; - DE76E3FBB5ABBF396B814CCC /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; - F8ECAEF4D303E31FC191BFC9 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + AC8F511367181E6F6136C983 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + B8E86EBF810A6D68F134ACAF /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + BFB0AA4997B4023F9DE5AA47 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; + D97CBA5AF486DBF3227D7F0D /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -73,7 +73,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - F7263D19E9C771D5D410EFAE /* Pods_RunnerTests.framework in Frameworks */, + 249F63BF944B3685222381FD /* Pods_RunnerTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -81,7 +81,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - DFE5E94090634FE93C4B3A51 /* Pods_Runner.framework in Frameworks */, + 6386F0203834B59B4E1A68F5 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -115,7 +115,7 @@ 97C146EF1CF9000F007C117D /* Products */, 331C8082294A63A400263BE5 /* RunnerTests */, E880F334C300E1CEFAFD6E4C /* Pods */, - CFDB35147C7A16878475480F /* Frameworks */, + C2BA7E736F705702CA2EE3EF /* Frameworks */, ); sourceTree = ""; }; @@ -144,11 +144,11 @@ path = Runner; sourceTree = ""; }; - CFDB35147C7A16878475480F /* Frameworks */ = { + C2BA7E736F705702CA2EE3EF /* Frameworks */ = { isa = PBXGroup; children = ( - F8ECAEF4D303E31FC191BFC9 /* Pods_Runner.framework */, - C32DCD80A8A43366F689D184 /* Pods_RunnerTests.framework */, + D97CBA5AF486DBF3227D7F0D /* Pods_Runner.framework */, + 41366A1C222737B9D9067671 /* Pods_RunnerTests.framework */, ); name = Frameworks; sourceTree = ""; @@ -156,12 +156,12 @@ E880F334C300E1CEFAFD6E4C /* Pods */ = { isa = PBXGroup; children = ( - 8E8A94E0E1D976EDB00D4963 /* Pods-Runner.debug.xcconfig */, - 2720EAFA66A072708D8721F7 /* Pods-Runner.release.xcconfig */, - 1335300FE31578AEDDF553B3 /* Pods-Runner.profile.xcconfig */, - 59310688D2F58C1781EA2A0E /* Pods-RunnerTests.debug.xcconfig */, - D41150082049425B949452B0 /* Pods-RunnerTests.release.xcconfig */, - DE76E3FBB5ABBF396B814CCC /* Pods-RunnerTests.profile.xcconfig */, + 176AA5DE618321838E6E8B8A /* Pods-Runner.debug.xcconfig */, + AC8F511367181E6F6136C983 /* Pods-Runner.release.xcconfig */, + B8E86EBF810A6D68F134ACAF /* Pods-Runner.profile.xcconfig */, + 0586207D0B42A9A899095729 /* Pods-RunnerTests.debug.xcconfig */, + 81C610DEDD08EB2533E34747 /* Pods-RunnerTests.release.xcconfig */, + BFB0AA4997B4023F9DE5AA47 /* Pods-RunnerTests.profile.xcconfig */, ); path = Pods; sourceTree = ""; @@ -173,7 +173,7 @@ isa = PBXNativeTarget; buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; buildPhases = ( - B14A67942870E170E53D2BB0 /* [CP] Check Pods Manifest.lock */, + CD151532311346AF03DABA35 /* [CP] Check Pods Manifest.lock */, 331C807D294A63A400263BE5 /* Sources */, 331C807F294A63A400263BE5 /* Resources */, 6D09732E2619FACF7894A4A1 /* Frameworks */, @@ -192,14 +192,14 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - 7DE32BCA2BE4F83E6C9432BA /* [CP] Check Pods Manifest.lock */, + 97B1B2D87834BA07A2642830 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 3F1552979A1A89B75654B126 /* [CP] Embed Pods Frameworks */, + 675B5813D793694944A49951 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -286,7 +286,7 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; - 3F1552979A1A89B75654B126 /* [CP] Embed Pods Frameworks */ = { + 675B5813D793694944A49951 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -303,44 +303,44 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 7DE32BCA2BE4F83E6C9432BA /* [CP] Check Pods Manifest.lock */ = { + 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); - inputFileListPaths = ( - ); inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( ); + name = "Run Script"; outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - 9740EEB61CF901F6004384FC /* Run Script */ = { + 97B1B2D87834BA07A2642830 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); + inputFileListPaths = ( + ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( ); - name = "Run Script"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; }; - B14A67942870E170E53D2BB0 /* [CP] Check Pods Manifest.lock */ = { + CD151532311346AF03DABA35 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -492,7 +492,7 @@ }; 331C8088294A63A400263BE5 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 59310688D2F58C1781EA2A0E /* Pods-RunnerTests.debug.xcconfig */; + baseConfigurationReference = 0586207D0B42A9A899095729 /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -510,7 +510,7 @@ }; 331C8089294A63A400263BE5 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = D41150082049425B949452B0 /* Pods-RunnerTests.release.xcconfig */; + baseConfigurationReference = 81C610DEDD08EB2533E34747 /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -526,7 +526,7 @@ }; 331C808A294A63A400263BE5 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = DE76E3FBB5ABBF396B814CCC /* Pods-RunnerTests.profile.xcconfig */; + baseConfigurationReference = BFB0AA4997B4023F9DE5AA47 /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; diff --git a/packages/reown_appkit/example/modal/lib/home_page.dart b/packages/reown_appkit/example/modal/lib/home_page.dart index d2bc1a2..3911353 100644 --- a/packages/reown_appkit/example/modal/lib/home_page.dart +++ b/packages/reown_appkit/example/modal/lib/home_page.dart @@ -35,7 +35,7 @@ class MyHomePage extends StatefulWidget { class _MyHomePageState extends State { final overlay = OverlayController(const Duration(milliseconds: 200)); - late AppKitModal _appKitModal; + late ReownAppKitModal _appKitModal; late SIWESampleWebService _siweTestService; bool _initialized = false; @@ -212,15 +212,15 @@ class _MyHomePageState extends State { final siweAuthValue = prefs.getBool('appkit_siwe_auth') ?? true; // See https://docs.walletconnect.com/appkit/flutter/core/custom-chains - final eip155Chains = AppKitModalNetworks.supported['eip155']!; - final eip155Tests = AppKitModalNetworks.test['eip155']!; - AppKitModalNetworks.supported['eip155'] = [ + final eip155Chains = ReownAppKitModalNetworks.supported['eip155']!; + final eip155Tests = ReownAppKitModalNetworks.test['eip155']!; + ReownAppKitModalNetworks.supported['eip155'] = [ ...eip155Chains, ...eip155Tests, ]; try { - _appKitModal = AppKitModal( + _appKitModal = ReownAppKitModal( context: context, projectId: DartDefines.projectId, logLevel: LogLevel.error, @@ -245,7 +245,7 @@ class _MyHomePageState extends State { // MORE WALLETS https://explorer.walletconnect.com/?type=wallet&chains=eip155%3A1 ); setState(() => _initialized = true); - } on AppKitModalException catch (e) { + } on ReownAppKitModalException catch (e) { debugPrint('⛔️ ${e.message}'); return; } @@ -377,12 +377,12 @@ class _MyHomePageState extends State { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: AppKitModalTheme.colorsOf(context).background125, + backgroundColor: ReownAppKitModalTheme.colorsOf(context).background125, appBar: AppBar( elevation: 0.0, title: const Text(StringConstants.pageTitle), - backgroundColor: AppKitModalTheme.colorsOf(context).background175, - foregroundColor: AppKitModalTheme.colorsOf(context).foreground100, + backgroundColor: ReownAppKitModalTheme.colorsOf(context).background175, + foregroundColor: ReownAppKitModalTheme.colorsOf(context).foreground100, ), body: !_initialized ? const SizedBox.shrink() @@ -400,7 +400,7 @@ class _MyHomePageState extends State { ), ), endDrawer: Drawer( - backgroundColor: AppKitModalTheme.colorsOf(context).background125, + backgroundColor: ReownAppKitModalTheme.colorsOf(context).background125, child: DebugDrawer( toggleOverlay: _toggleOverlay, toggleBrightness: widget.toggleBrightness, @@ -440,7 +440,7 @@ class _MyHomePageState extends State { class _ButtonsView extends StatelessWidget { const _ButtonsView({required this.appKit}); - final AppKitModal appKit; + final ReownAppKitModal appKit; @override Widget build(BuildContext context) { @@ -468,10 +468,10 @@ class _ButtonsView extends StatelessWidget { // custom: ElevatedButton( // onPressed: () { // // TODO document openModalView - // // appKit.openModalView(AppKitModalQRCodePage()); - // // appKit.openModalView(AppKitModalSelectNetworkPage()); - // // appKit.openModalView(AppKitModalAllWalletsPage()); - // // appKit.openModalView(AppKitModalMainWalletsPage()); + // // appKit.openModalView(ReownAppKitModalQRCodePage()); + // // appKit.openModalView(ReownAppKitModalSelectNetworkPage()); + // // appKit.openModalView(ReownAppKitModalAllWalletsPage()); + // // appKit.openModalView(ReownAppKitModalMainWalletsPage()); // }, // child: appKit.isConnected // ? Text('${appKit.session!.address!.substring(0, 7)}...') @@ -485,7 +485,7 @@ class _ButtonsView extends StatelessWidget { class _ConnectedView extends StatelessWidget { const _ConnectedView({required this.appKit}); - final AppKitModal appKit; + final ReownAppKitModal appKit; @override Widget build(BuildContext context) { diff --git a/packages/reown_appkit/example/modal/lib/main.dart b/packages/reown_appkit/example/modal/lib/main.dart index 243e9c8..d7a3548 100644 --- a/packages/reown_appkit/example/modal/lib/main.dart +++ b/packages/reown_appkit/example/modal/lib/main.dart @@ -18,7 +18,7 @@ class MyApp extends StatefulWidget { class _MyAppState extends State with WidgetsBindingObserver { bool _isDarkMode = false; - AppKitModalThemeData? _themeData; + ReownAppKitModalThemeData? _themeData; @override void initState() { @@ -62,7 +62,7 @@ class _MyAppState extends State with WidgetsBindingObserver { // This widget is the root of your application. @override Widget build(BuildContext context) { - return AppKitModalTheme( + return ReownAppKitModalTheme( isDarkMode: _isDarkMode, themeData: _themeData, child: MaterialApp( @@ -96,8 +96,8 @@ class _MyAppState extends State with WidgetsBindingObserver { _isDarkMode = !_isDarkMode; }); - AppKitModalThemeData get _customTheme => AppKitModalThemeData( - lightColors: AppKitModalColors.lightMode.copyWith( + ReownAppKitModalThemeData get _customTheme => ReownAppKitModalThemeData( + lightColors: ReownAppKitModalColors.lightMode.copyWith( accent100: const Color.fromARGB(255, 30, 59, 236), background100: const Color.fromARGB(255, 161, 183, 231), // Main Modal's background color @@ -110,7 +110,7 @@ class _MyAppState extends State with WidgetsBindingObserver { // Secondary Modal's text foreground150: const Color.fromARGB(255, 22, 18, 19), ), - darkColors: AppKitModalColors.darkMode.copyWith( + darkColors: ReownAppKitModalColors.darkMode.copyWith( accent100: const Color.fromARGB(255, 161, 183, 231), background100: const Color.fromARGB(255, 30, 59, 236), // Main Modal's background color @@ -123,6 +123,6 @@ class _MyAppState extends State with WidgetsBindingObserver { // Secondary Modal's text foreground150: const Color.fromARGB(255, 233, 237, 236), ), - radiuses: AppKitModalRadiuses.square, + radiuses: ReownAppKitModalRadiuses.square, ); } diff --git a/packages/reown_appkit/example/modal/lib/models/chain_metadata.dart b/packages/reown_appkit/example/modal/lib/models/chain_metadata.dart index 40f7c57..34255ff 100644 --- a/packages/reown_appkit/example/modal/lib/models/chain_metadata.dart +++ b/packages/reown_appkit/example/modal/lib/models/chain_metadata.dart @@ -10,7 +10,7 @@ enum ChainType { class ChainMetadata { final Color color; final ChainType type; - final AppKitModalNetworkInfo appKitNetworkInfo; + final ReownAppKitModalNetworkInfo appKitNetworkInfo; const ChainMetadata({ required this.color, diff --git a/packages/reown_appkit/example/modal/lib/services/eip155_service.dart b/packages/reown_appkit/example/modal/lib/services/eip155_service.dart index cb7800a..4fd8c3b 100644 --- a/packages/reown_appkit/example/modal/lib/services/eip155_service.dart +++ b/packages/reown_appkit/example/modal/lib/services/eip155_service.dart @@ -66,7 +66,7 @@ class EIP155 { } static Future callMethod({ - required AppKitModal appKit, + required ReownAppKitModal appKit, required String topic, required EIP155UIMethods method, required String chainId, @@ -120,7 +120,7 @@ class EIP155 { } static Future requestAccounts({ - required AppKitModal appKit, + required ReownAppKitModal appKit, }) async { return await appKit.request( topic: appKit.session!.topic, @@ -133,7 +133,7 @@ class EIP155 { } static Future personalSign({ - required AppKitModal appKit, + required ReownAppKitModal appKit, required String message, }) async { final bytes = utf8.encode(message); @@ -153,7 +153,7 @@ class EIP155 { } static Future ethSignTypedData({ - required AppKitModal appKit, + required ReownAppKitModal appKit, required String data, }) async { return await appKit.request( @@ -170,7 +170,7 @@ class EIP155 { } static Future ethSignTypedDataV3({ - required AppKitModal appKit, + required ReownAppKitModal appKit, required String data, }) async { return await appKit.request( @@ -187,7 +187,7 @@ class EIP155 { } static Future ethSignTypedDataV4({ - required AppKitModal appKit, + required ReownAppKitModal appKit, required String data, }) async { return await appKit.request( @@ -204,7 +204,7 @@ class EIP155 { } static Future ethSendOrSignTransaction({ - required AppKitModal appKit, + required ReownAppKitModal appKit, required Transaction transaction, required EIP155UIMethods method, }) async { @@ -221,7 +221,7 @@ class EIP155 { } static Future walletWatchAsset({ - required AppKitModal appKit, + required ReownAppKitModal appKit, }) async { return await appKit.request( topic: appKit.session!.topic, @@ -244,7 +244,7 @@ class EIP155 { // Example of calling `transfer` function from AAVE token Smart Contract static Future callTestSmartContract({ - required AppKitModal appKit, + required ReownAppKitModal appKit, required String action, }) async { // Create DeployedContract object using contract's ABI and address @@ -327,7 +327,7 @@ class EIP155 { // Example of calling `transfer` function from USDT token Smart Contract static Future callUSDTSmartContract({ - required AppKitModal appKit, + required ReownAppKitModal appKit, required String action, }) async { // Create DeployedContract object using contract's ABI and address @@ -378,7 +378,7 @@ class EIP155 { } static Future _readSmartContract({ - required AppKitModal appKit, + required ReownAppKitModal appKit, required DeployedContract contract, }) async { final results = await Future.wait([ diff --git a/packages/reown_appkit/example/modal/lib/utils/styles.dart b/packages/reown_appkit/example/modal/lib/utils/styles.dart index 7e4719f..0d6f16d 100644 --- a/packages/reown_appkit/example/modal/lib/utils/styles.dart +++ b/packages/reown_appkit/example/modal/lib/utils/styles.dart @@ -2,14 +2,14 @@ import 'package:flutter/material.dart'; import 'package:reown_appkit/reown_appkit.dart'; ButtonStyle buttonStyle(BuildContext context) { - final themeColors = AppKitModalTheme.colorsOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); return ButtonStyle( backgroundColor: MaterialStateProperty.resolveWith( (states) { if (states.contains(MaterialState.disabled)) { - return AppKitModalTheme.colorsOf(context).background225; + return ReownAppKitModalTheme.colorsOf(context).background225; } - return AppKitModalTheme.colorsOf(context).accent100; + return ReownAppKitModalTheme.colorsOf(context).accent100; }, ), shape: MaterialStateProperty.resolveWith( @@ -24,25 +24,28 @@ ButtonStyle buttonStyle(BuildContext context) { ), textStyle: MaterialStateProperty.resolveWith( (states) { - return AppKitModalTheme.getDataOf(context).textStyles.small600.copyWith( + return ReownAppKitModalTheme.getDataOf(context) + .textStyles + .small600 + .copyWith( color: (states.contains(MaterialState.disabled)) - ? AppKitModalTheme.colorsOf(context).foreground300 - : AppKitModalTheme.colorsOf(context).inverse100, + ? ReownAppKitModalTheme.colorsOf(context).foreground300 + : ReownAppKitModalTheme.colorsOf(context).inverse100, ); }, ), foregroundColor: MaterialStateProperty.resolveWith( (states) { return (states.contains(MaterialState.disabled)) - ? AppKitModalTheme.colorsOf(context).foreground300 - : AppKitModalTheme.colorsOf(context).inverse100; + ? ReownAppKitModalTheme.colorsOf(context).foreground300 + : ReownAppKitModalTheme.colorsOf(context).inverse100; }, ), ); } BorderRadiusGeometry borderRadius(BuildContext context) { - final radiuses = AppKitModalTheme.radiusesOf(context); + final radiuses = ReownAppKitModalTheme.radiusesOf(context); return radiuses.isSquare() ? const BorderRadius.all(Radius.zero) : radiuses.isCircular() diff --git a/packages/reown_appkit/example/modal/lib/widgets/debug_drawer.dart b/packages/reown_appkit/example/modal/lib/widgets/debug_drawer.dart index aa9595b..4cc98f1 100644 --- a/packages/reown_appkit/example/modal/lib/widgets/debug_drawer.dart +++ b/packages/reown_appkit/example/modal/lib/widgets/debug_drawer.dart @@ -74,7 +74,7 @@ class _DebugDrawerState extends State with WidgetsBindingObserver { @override Widget build(BuildContext context) { - final isCustom = AppKitModalTheme.isCustomTheme(context); + final isCustom = ReownAppKitModalTheme.isCustomTheme(context); return SafeArea( child: Column( children: [ @@ -84,11 +84,13 @@ class _DebugDrawerState extends State with WidgetsBindingObserver { ListTile( leading: Icon( Icons.logo_dev_rounded, - color: AppKitModalTheme.colorsOf(context).foreground100, + color: + ReownAppKitModalTheme.colorsOf(context).foreground100, ), title: const Text('Analytics view'), titleTextStyle: TextStyle( - color: AppKitModalTheme.colorsOf(context).foreground100, + color: + ReownAppKitModalTheme.colorsOf(context).foreground100, ), onTap: () { widget.toggleOverlay(); @@ -98,51 +100,56 @@ class _DebugDrawerState extends State with WidgetsBindingObserver { leading: isCustom ? Icon( Icons.yard, - color: - AppKitModalTheme.colorsOf(context).foreground100, + color: ReownAppKitModalTheme.colorsOf(context) + .foreground100, ) : Icon( Icons.yard_outlined, - color: - AppKitModalTheme.colorsOf(context).foreground100, + color: ReownAppKitModalTheme.colorsOf(context) + .foreground100, ), title: isCustom ? const Text('Custom theme') : const Text('Default theme'), titleTextStyle: TextStyle( - color: AppKitModalTheme.colorsOf(context).foreground100, + color: + ReownAppKitModalTheme.colorsOf(context).foreground100, ), trailing: Switch( value: isCustom, - activeColor: AppKitModalTheme.colorsOf(context).accent100, + activeColor: + ReownAppKitModalTheme.colorsOf(context).accent100, onChanged: (value) { widget.toggleTheme(); }, ), ), ListTile( - leading: AppKitModalTheme.maybeOf(context)?.isDarkMode ?? + leading: ReownAppKitModalTheme.maybeOf(context)?.isDarkMode ?? false ? Icon( Icons.dark_mode_outlined, - color: - AppKitModalTheme.colorsOf(context).foreground100, + color: ReownAppKitModalTheme.colorsOf(context) + .foreground100, ) : Icon( Icons.light_mode_outlined, - color: - AppKitModalTheme.colorsOf(context).foreground100, + color: ReownAppKitModalTheme.colorsOf(context) + .foreground100, ), - title: AppKitModalTheme.maybeOf(context)?.isDarkMode ?? false + title: ReownAppKitModalTheme.maybeOf(context)?.isDarkMode ?? + false ? const Text('Dark theme') : const Text('Light theme'), titleTextStyle: TextStyle( - color: AppKitModalTheme.colorsOf(context).foreground100, + color: + ReownAppKitModalTheme.colorsOf(context).foreground100, ), trailing: Switch( - value: - AppKitModalTheme.maybeOf(context)?.isDarkMode ?? false, - activeColor: AppKitModalTheme.colorsOf(context).accent100, + value: ReownAppKitModalTheme.maybeOf(context)?.isDarkMode ?? + false, + activeColor: + ReownAppKitModalTheme.colorsOf(context).accent100, onChanged: (value) { widget.toggleBrightness(); }, @@ -155,7 +162,8 @@ class _DebugDrawerState extends State with WidgetsBindingObserver { child: Text( 'Will require app to restart', style: TextStyle( - color: AppKitModalTheme.colorsOf(context).foreground100, + color: + ReownAppKitModalTheme.colorsOf(context).foreground100, ), ), ), @@ -163,15 +171,18 @@ class _DebugDrawerState extends State with WidgetsBindingObserver { ListTile( leading: Icon( Icons.speaker_notes_rounded, - color: AppKitModalTheme.colorsOf(context).foreground100, + color: + ReownAppKitModalTheme.colorsOf(context).foreground100, ), title: const Text('Analytics On'), titleTextStyle: TextStyle( - color: AppKitModalTheme.colorsOf(context).foreground100, + color: + ReownAppKitModalTheme.colorsOf(context).foreground100, ), trailing: Switch( value: _analyticsValue, - activeColor: AppKitModalTheme.colorsOf(context).accent100, + activeColor: + ReownAppKitModalTheme.colorsOf(context).accent100, onChanged: (value) { _analyticsValue = value; _updateValue('appkit_analytics', value); @@ -181,15 +192,18 @@ class _DebugDrawerState extends State with WidgetsBindingObserver { ListTile( leading: Icon( Icons.email_rounded, - color: AppKitModalTheme.colorsOf(context).foreground100, + color: + ReownAppKitModalTheme.colorsOf(context).foreground100, ), title: const Text('Email Wallet On'), titleTextStyle: TextStyle( - color: AppKitModalTheme.colorsOf(context).foreground100, + color: + ReownAppKitModalTheme.colorsOf(context).foreground100, ), trailing: Switch( value: _emailWalletValue, - activeColor: AppKitModalTheme.colorsOf(context).accent100, + activeColor: + ReownAppKitModalTheme.colorsOf(context).accent100, onChanged: (value) { _emailWalletValue = value; _updateValue('appkit_email_wallet', value); @@ -199,15 +213,18 @@ class _DebugDrawerState extends State with WidgetsBindingObserver { ListTile( leading: Icon( Icons.account_balance_wallet, - color: AppKitModalTheme.colorsOf(context).foreground100, + color: + ReownAppKitModalTheme.colorsOf(context).foreground100, ), title: const Text('1-CA + SIWE On'), titleTextStyle: TextStyle( - color: AppKitModalTheme.colorsOf(context).foreground100, + color: + ReownAppKitModalTheme.colorsOf(context).foreground100, ), trailing: Switch( value: _siweAuthValue, - activeColor: AppKitModalTheme.colorsOf(context).accent100, + activeColor: + ReownAppKitModalTheme.colorsOf(context).accent100, onChanged: (value) { _siweAuthValue = value; _updateValue('appkit_siwe_auth', value); @@ -237,7 +254,8 @@ class _DebugDrawerState extends State with WidgetsBindingObserver { 'Core v$packageVersion', style: TextStyle( fontSize: 12.0, - color: AppKitModalTheme.colorsOf(context).foreground100, + color: + ReownAppKitModalTheme.colorsOf(context).foreground100, ), ), ); @@ -248,11 +266,11 @@ class _DebugDrawerState extends State with WidgetsBindingObserver { ListTile( leading: Icon( Icons.close, - color: AppKitModalTheme.colorsOf(context).foreground100, + color: ReownAppKitModalTheme.colorsOf(context).foreground100, ), title: const Text('Close'), titleTextStyle: TextStyle( - color: AppKitModalTheme.colorsOf(context).foreground100, + color: ReownAppKitModalTheme.colorsOf(context).foreground100, ), onTap: () { if (_hasUpdates) { diff --git a/packages/reown_appkit/example/modal/lib/widgets/session_widget.dart b/packages/reown_appkit/example/modal/lib/widgets/session_widget.dart index c1cda0a..ed8fb45 100644 --- a/packages/reown_appkit/example/modal/lib/widgets/session_widget.dart +++ b/packages/reown_appkit/example/modal/lib/widgets/session_widget.dart @@ -15,7 +15,7 @@ import 'package:reown_appkit_example/widgets/method_dialog.dart'; class SessionWidget extends StatefulWidget { const SessionWidget({super.key, required this.appKit}); - final AppKitModal appKit; + final ReownAppKitModal appKit; @override SessionWidgetState createState() => SessionWidgetState(); @@ -49,12 +49,12 @@ class SessionWidgetState extends State { Expanded( child: Text( session.connectedWalletName ?? '', - style: AppKitModalTheme.getDataOf(context) + style: ReownAppKitModalTheme.getDataOf(context) .textStyles .paragraph600 .copyWith( - color: - AppKitModalTheme.colorsOf(context).foreground100, + color: ReownAppKitModalTheme.colorsOf(context) + .foreground100, ), ), ), @@ -80,20 +80,22 @@ class SessionWidgetState extends State { children: [ Text( StringConstants.sessionTopic, - style: AppKitModalTheme.getDataOf(context) + style: ReownAppKitModalTheme.getDataOf(context) .textStyles .small600 .copyWith( - color: AppKitModalTheme.colorsOf(context).foreground100, + color: + ReownAppKitModalTheme.colorsOf(context).foreground100, ), ), Text( '${session.topic}', - style: AppKitModalTheme.getDataOf(context) + style: ReownAppKitModalTheme.getDataOf(context) .textStyles .small400 .copyWith( - color: AppKitModalTheme.colorsOf(context).foreground100, + color: + ReownAppKitModalTheme.colorsOf(context).foreground100, ), ), ], @@ -108,7 +110,7 @@ class SessionWidgetState extends State { // Get current active account final accounts = session.getAccounts() ?? []; final chainId = widget.appKit.selectedChain?.chainId ?? ''; - final namespace = AppKitModalNetworks.getNamespaceForChainId(chainId); + final namespace = ReownAppKitModalNetworks.getNamespaceForChainId(chainId); final chainsNamespaces = NamespaceUtils.getChainsFromAccounts(accounts); if (chainsNamespaces.contains('$namespace:$chainId')) { final account = accounts.firstWhere( @@ -122,11 +124,11 @@ class SessionWidgetState extends State { const SizedBox.square(dimension: 8.0), Text( 'Stored session:', - style: AppKitModalTheme.getDataOf(context) + style: ReownAppKitModalTheme.getDataOf(context) .textStyles .small600 .copyWith( - color: AppKitModalTheme.colorsOf(context).foreground100, + color: ReownAppKitModalTheme.colorsOf(context).foreground100, ), ), InkWell( @@ -143,11 +145,12 @@ class SessionWidgetState extends State { child: Text( const JsonEncoder.withIndent(' ') .convert(widget.appKit.session?.toMap()), - style: AppKitModalTheme.getDataOf(context) + style: ReownAppKitModalTheme.getDataOf(context) .textStyles .small400 .copyWith( - color: AppKitModalTheme.colorsOf(context).foreground100, + color: + ReownAppKitModalTheme.colorsOf(context).foreground100, ), ), ), @@ -172,15 +175,21 @@ class SessionWidgetState extends State { Text( // chainMetadata.appKitNetworkInfo.name, widget.appKit.selectedChain?.name ?? 'Unsupported chain', - style: AppKitModalTheme.getDataOf(context).textStyles.title600.copyWith( - color: AppKitModalTheme.colorsOf(context).foreground100, + style: ReownAppKitModalTheme.getDataOf(context) + .textStyles + .title600 + .copyWith( + color: ReownAppKitModalTheme.colorsOf(context).foreground100, ), ), const SizedBox(height: StyleConstants.linear8), Text( NamespaceUtils.getAccount(account), - style: AppKitModalTheme.getDataOf(context).textStyles.small400.copyWith( - color: AppKitModalTheme.colorsOf(context).foreground100, + style: ReownAppKitModalTheme.getDataOf(context) + .textStyles + .small400 + .copyWith( + color: ReownAppKitModalTheme.colorsOf(context).foreground100, ), ), ]; @@ -189,11 +198,11 @@ class SessionWidgetState extends State { const SizedBox(height: StyleConstants.linear8), Text( StringConstants.methods, - style: AppKitModalTheme.getDataOf(context) + style: ReownAppKitModalTheme.getDataOf(context) .textStyles .paragraph600 .copyWith( - color: AppKitModalTheme.colorsOf(context).foreground100, + color: ReownAppKitModalTheme.colorsOf(context).foreground100, ), ), ]); @@ -203,11 +212,11 @@ class SessionWidgetState extends State { const SizedBox(height: StyleConstants.linear8), Text( StringConstants.events, - style: AppKitModalTheme.getDataOf(context) + style: ReownAppKitModalTheme.getDataOf(context) .textStyles .paragraph600 .copyWith( - color: AppKitModalTheme.colorsOf(context).foreground100, + color: ReownAppKitModalTheme.colorsOf(context).foreground100, ), ), ]); @@ -217,7 +226,8 @@ class SessionWidgetState extends State { padding: const EdgeInsets.all(StyleConstants.linear8), margin: const EdgeInsets.symmetric(vertical: StyleConstants.linear8), decoration: BoxDecoration( - border: Border.all(color: AppKitModalTheme.colorsOf(context).accent100), + border: Border.all( + color: ReownAppKitModalTheme.colorsOf(context).accent100), borderRadius: const BorderRadius.all( Radius.circular(StyleConstants.linear8), ), @@ -238,10 +248,12 @@ class SessionWidgetState extends State { return [ Text( 'No methods approved', - style: - AppKitModalTheme.getDataOf(context).textStyles.small400.copyWith( - color: AppKitModalTheme.colorsOf(context).foreground100, - ), + style: ReownAppKitModalTheme.getDataOf(context) + .textStyles + .small400 + .copyWith( + color: ReownAppKitModalTheme.colorsOf(context).foreground100, + ), ) ]; } @@ -374,10 +386,12 @@ class SessionWidgetState extends State { const SizedBox(height: StyleConstants.linear8), Text( 'Session chains:', - style: - AppKitModalTheme.getDataOf(context).textStyles.small600.copyWith( - color: AppKitModalTheme.colorsOf(context).foreground100, - ), + style: ReownAppKitModalTheme.getDataOf(context) + .textStyles + .small600 + .copyWith( + color: ReownAppKitModalTheme.colorsOf(context).foreground100, + ), ), ], ); @@ -385,8 +399,11 @@ class SessionWidgetState extends State { children.add( Text( approvedChains.join(', '), - style: AppKitModalTheme.getDataOf(context).textStyles.small400.copyWith( - color: AppKitModalTheme.colorsOf(context).foreground100, + style: ReownAppKitModalTheme.getDataOf(context) + .textStyles + .small400 + .copyWith( + color: ReownAppKitModalTheme.colorsOf(context).foreground100, ), ), ); @@ -399,8 +416,11 @@ class SessionWidgetState extends State { if (approvedEvents.isEmpty) { return Text( 'No events approved', - style: AppKitModalTheme.getDataOf(context).textStyles.small400.copyWith( - color: AppKitModalTheme.colorsOf(context).foreground100, + style: ReownAppKitModalTheme.getDataOf(context) + .textStyles + .small400 + .copyWith( + color: ReownAppKitModalTheme.colorsOf(context).foreground100, ), ); } @@ -415,17 +435,17 @@ class SessionWidgetState extends State { padding: const EdgeInsets.all(StyleConstants.linear8), decoration: BoxDecoration( border: Border.all( - color: AppKitModalTheme.colorsOf(context).accent100, + color: ReownAppKitModalTheme.colorsOf(context).accent100, ), borderRadius: borderRadius(context), ), child: Text( event, - style: AppKitModalTheme.getDataOf(context) + style: ReownAppKitModalTheme.getDataOf(context) .textStyles .small400 .copyWith( - color: AppKitModalTheme.colorsOf(context).foreground100, + color: ReownAppKitModalTheme.colorsOf(context).foreground100, ), ), ), diff --git a/packages/reown_appkit/lib/modal/appkit_modal_impl.dart b/packages/reown_appkit/lib/modal/appkit_modal_impl.dart index 85dc745..7ee3cec 100644 --- a/packages/reown_appkit/lib/modal/appkit_modal_impl.dart +++ b/packages/reown_appkit/lib/modal/appkit_modal_impl.dart @@ -48,7 +48,7 @@ import 'package:reown_appkit/modal/services/toast_service/toast_service_singleto /// Either a [projectId] and [metadata] must be provided or an already created [appKit]. /// optionalNamespaces is mostly not needed, if you use it, the values set here will override every optionalNamespaces set in evey chain -class AppKitModal with ChangeNotifier implements IAppKitModal { +class ReownAppKitModal with ChangeNotifier implements IReownAppKitModal { String _projectId = ''; Map _requiredNamespaces = {}; @@ -56,15 +56,15 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { String? _lastChainEmitted; bool _supportsOneClickAuth = false; - AppKitModalStatus _status = AppKitModalStatus.idle; + ReownAppKitModalStatus _status = ReownAppKitModalStatus.idle; @override - AppKitModalStatus get status => _status; + ReownAppKitModalStatus get status => _status; String? _currentSelectedChainId; @override - AppKitModalNetworkInfo? get selectedChain { + ReownAppKitModalNetworkInfo? get selectedChain { if (_currentSelectedChainId != null) { - return AppKitModalNetworks.getNetworkById( + return ReownAppKitModalNetworks.getNetworkById( CoreConstants.namespace, _currentSelectedChainId!, ); @@ -72,9 +72,9 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { return null; } - AppKitModalWalletInfo? _selectedWallet; + ReownAppKitModalWalletInfo? _selectedWallet; @override - AppKitModalWalletInfo? get selectedWallet => _selectedWallet; + ReownAppKitModalWalletInfo? get selectedWallet => _selectedWallet; @override bool get hasNamespaces => @@ -109,9 +109,9 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { @override bool get isConnected => _isConnected; - AppKitModalSession? _currentSession; + ReownAppKitModalSession? _currentSession; @override - AppKitModalSession? get session => _currentSession; + ReownAppKitModalSession? get session => _currentSession; Logger get _logger => _appKit.core.logger; @@ -129,7 +129,8 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { } /// `context` is required if SIWEConfig is passed. - AppKitModal({ + // TODO change to ReownAppKitModal + ReownAppKitModal({ required BuildContext context, IReownAppKit? appKit, String? projectId, @@ -142,23 +143,23 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { Set? excludedWalletIds, bool? enableAnalytics, bool enableEmail = false, - List blockchains = const [], + List blockchains = const [], LogLevel logLevel = LogLevel.nothing, }) { if (appKit == null) { if (projectId == null) { - throw AppKitModalException( + throw ReownAppKitModalException( 'Either a `projectId` and `metadata` must be provided or an already created `appKit`', ); } if (metadata == null) { - throw AppKitModalException( + throw ReownAppKitModalException( '`metadata:` parameter is required when using `projectId:`', ); } } // if (siweConfig?.enabled == true && context == null) { - // throw AppKitModalException( + // throw ReownAppKitModalException( // '`context:` parameter is required if using `siweConfig:`. Also, `context:` parameter will be enforced in future versions.', // ); // } @@ -231,11 +232,11 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { ); return; } - if (_status == AppKitModalStatus.initializing || - _status == AppKitModalStatus.initialized) { + if (_status == ReownAppKitModalStatus.initializing || + _status == ReownAppKitModalStatus.initialized) { return; } - _status = AppKitModalStatus.initializing; + _status = ReownAppKitModalStatus.initializing; _notify(); _registerListeners(); @@ -266,7 +267,7 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { final wcSessions = _appKit.sessions.getAll(); // Loop through all the chain data - final allNetworks = AppKitModalNetworks.getNetworks( + final allNetworks = ReownAppKitModalNetworks.getNetworks( CoreConstants.namespace, ); for (final chain in allNetworks) { @@ -280,7 +281,8 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { // There's a session stored if (wcSessions.isNotEmpty) { - await _storeSession(AppKitModalSession(sessionData: wcSessions.first)); + await _storeSession( + ReownAppKitModalSession(sessionData: wcSessions.first)); // session should not outlive the pairing if (wcPairings.isEmpty) { await disconnect(); @@ -313,8 +315,9 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { final connected = _appKit.core.relayClient.isConnected; _serviceInitialized = connected; - _status = - connected ? AppKitModalStatus.initialized : AppKitModalStatus.error; + _status = connected + ? ReownAppKitModalStatus.initialized + : ReownAppKitModalStatus.error; _logger.i('[$runtimeType] initialized'); _notify(); } @@ -338,7 +341,8 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { } } - Future _setSesionAndChainData(AppKitModalSession modalSession) async { + Future _setSesionAndChainData( + ReownAppKitModalSession modalSession) async { try { await _storeSession(modalSession); _currentSelectedChainId = _currentSelectedChainId ?? modalSession.chainId; @@ -351,12 +355,12 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { } } - Future _getStoredSession() async { + Future _getStoredSession() async { try { if (_storage.has(StorageConstants.modalSession)) { final storedSession = _storage.get(StorageConstants.modalSession); if (storedSession != null) { - return AppKitModalSession.fromMap(storedSession); + return ReownAppKitModalSession.fromMap(storedSession); } } } catch (e) { @@ -365,7 +369,7 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { return null; } - Future _storeSession(AppKitModalSession modalSession) async { + Future _storeSession(ReownAppKitModalSession modalSession) async { _currentSession = modalSession; try { await _storage.set( @@ -383,7 +387,7 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { if (_currentSession != null) { final chainId = _getStoredChainId(null); if (chainId != null) { - final chain = AppKitModalNetworks.getNetworkById( + final chain = ReownAppKitModalNetworks.getNetworkById( CoreConstants.namespace, chainId, ); @@ -398,7 +402,7 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { @override Future selectChain( - AppKitModalNetworkInfo? chainInfo, { + ReownAppKitModalNetworkInfo? chainInfo, { bool switchChain = false, bool logEvent = true, }) async { @@ -511,7 +515,7 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { @override Future openNetworksView() { return _showModalView( - startWidget: AppKitModalSelectNetworkPage( + startWidget: ReownAppKitModalSelectNetworkPage( onTapNetwork: (info) { selectChain(info); widgetStack.instance.addDefault(); @@ -574,7 +578,7 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { if (_context == null) { _logger.e( 'No context was found. ' - 'Try adding `context:` parameter in AppKitModal class', + 'Try adding `context:` parameter in ReownAppKitModal class', ); return; } @@ -588,9 +592,9 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { widgetStack.instance.clear(); final isBottomSheet = PlatformUtils.isBottomSheet(); - final theme = AppKitModalTheme.maybeOf(_context!); + final theme = ReownAppKitModalTheme.maybeOf(_context!); await magicService.instance.syncTheme(theme); - final themeData = theme?.themeData ?? const AppKitModalThemeData(); + final themeData = theme?.themeData ?? const ReownAppKitModalThemeData(); Widget? showWidget = startWidget; if (_isConnected && showWidget == null) { @@ -598,7 +602,7 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { } final childWidget = theme == null - ? AppKitModalTheme( + ? ReownAppKitModalTheme( themeData: themeData, child: ModalContainer(startWidget: showWidget), ) @@ -637,12 +641,13 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { anchorPoint: Offset(0, 0), context: _context!, builder: (_) { - final radiuses = AppKitModalTheme.radiusesOf(_context!); + final radiuses = ReownAppKitModalTheme.radiusesOf(_context!); final maxRadius = min(radiuses.radiusM, 36.0); final borderRadius = BorderRadius.all(Radius.circular(maxRadius)); final constraints = BoxConstraints(maxWidth: 360, maxHeight: 600); return Dialog( - backgroundColor: AppKitModalTheme.colorsOf(_context!).background125, + backgroundColor: + ReownAppKitModalTheme.colorsOf(_context!).background125, shape: RoundedRectangleBorder(borderRadius: borderRadius), clipBehavior: Clip.hardEdge, child: ConstrainedBox( @@ -689,7 +694,7 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { ); if (walletRedirect == null) { - throw AppKitModalException( + throw ReownAppKitModalException( 'You didn\'t select a wallet or walletInfo argument is null', ); } @@ -767,7 +772,7 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { final nonce = await siweService.instance!.getNonce(); final p1 = await siweService.instance!.config!.getMessageParams(); final chains = - AppKitModalNetworks.getNetworks(CoreConstants.namespace) + ReownAppKitModalNetworks.getNetworks(CoreConstants.namespace) .map((e) => '${CoreConstants.namespace}:${e.chainId}') .toList(); final methods = p1.methods ?? MethodsConstants.allMethods; @@ -925,14 +930,14 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { Future disconnect({bool disconnectAllSessions = true}) async { _checkInitialized(); - _status = AppKitModalStatus.initializing; + _status = ReownAppKitModalStatus.initializing; _notify(); if (_currentSession?.sessionService.isCoinbase == true) { try { await coinbaseService.instance.resetSession(); } catch (_) { - _status = AppKitModalStatus.initialized; + _status = ReownAppKitModalStatus.initialized; _notify(); return; } @@ -941,7 +946,7 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { await Future.delayed(Duration(milliseconds: 300)); final disconnected = await magicService.instance.disconnect(); if (!disconnected) { - _status = AppKitModalStatus.initialized; + _status = ReownAppKitModalStatus.initialized; _notify(); return; } @@ -974,7 +979,7 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { return; } catch (e) { analyticsService.instance.sendEvent(DisconnectErrorEvent()); - _status = AppKitModalStatus.initialized; + _status = ReownAppKitModalStatus.initialized; _notify(); } } @@ -1016,7 +1021,7 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { } @override - void selectWallet(AppKitModalWalletInfo? walletInfo) { + void selectWallet(ReownAppKitModalWalletInfo? walletInfo) { _selectedWallet = walletInfo; } @@ -1043,7 +1048,7 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { List parameters = const [], }) async { if (_currentSession == null) { - throw AppKitModalException('Session is null'); + throw ReownAppKitModalException('Session is null'); } String reqChainId = chainId; final isValidChainId = NamespaceUtils.isValidChainId(chainId); @@ -1060,14 +1065,14 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { // _logger.d('[$runtimeType] requestWriteContract, chainId: $reqChainId'); - final networkInfo = AppKitModalNetworks.getNetworkById( + final networkInfo = ReownAppKitModalNetworks.getNetworkById( reqChainId.split(':').first, reqChainId.split(':').last, )!; try { if (selectedChain == null) { - throw AppKitModalException( + throw ReownAppKitModalException( 'You must select a chain before reading a contract', ); } @@ -1094,7 +1099,7 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { String? method, }) async { if (_currentSession == null) { - throw AppKitModalException('Session is null'); + throw ReownAppKitModalException('Session is null'); } String reqChainId = chainId; final isValidChainId = NamespaceUtils.isValidChainId(chainId); @@ -1134,7 +1139,7 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { String? switchToChainId, }) async { if (_currentSession == null) { - throw AppKitModalException('Session is null'); + throw ReownAppKitModalException('Session is null'); } String reqChainId = chainId; final isValidChainId = NamespaceUtils.isValidChainId(chainId); @@ -1185,7 +1190,7 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { // If the error is due to no session on Coinbase Wallet we disconnnect the session on Modal. // This is the only way to detect a missing session since Coinbase Wallet is not sending any event. // disconnect(); - throw AppKitModalException('Coinbase Wallet Error'); + throw ReownAppKitModalException('Coinbase Wallet Error'); } rethrow; } @@ -1194,11 +1199,11 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { @override Future dispose() async { - if (_status == AppKitModalStatus.initialized) { + if (_status == ReownAppKitModalStatus.initialized) { await disconnect(); await expirePreviousInactivePairings(); _unregisterListeners(); - _status = AppKitModalStatus.idle; + _status = ReownAppKitModalStatus.idle; _logger.d('[$runtimeType] dispose'); } super.dispose(); @@ -1249,7 +1254,7 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { void _setRequiredNamespaces(Map? requiredNSpaces) { if (requiredNSpaces != null) { - // Set the required namespaces declared by the user on AppKitModal object + // Set the required namespaces declared by the user on ReownAppKitModal object _requiredNamespaces = requiredNSpaces.map( (key, value) => MapEntry( key, @@ -1269,7 +1274,7 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { (k) => k != CoreConstants.namespace, ); if (wrongNamespace != null) { - throw AppKitModalException('Only eip155 blockains are supported'); + throw ReownAppKitModalException('Only eip155 blockains are supported'); } _logger.d('[$runtimeType] _requiredNamespaces $_requiredNamespaces'); @@ -1277,7 +1282,7 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { void _setOptionalNamespaces(Map? optionalNSpaces) { if (optionalNSpaces != null) { - // Set the optional namespaces declared by the user on AppKitModal object + // Set the optional namespaces declared by the user on ReownAppKitModal object _optionalNamespaces = optionalNSpaces.map( (key, value) => MapEntry( key, @@ -1290,9 +1295,9 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { ); } else { // Set the optional namespaces to everything in our chain presets - final namespaces = AppKitModalNetworks.supported.keys; + final namespaces = ReownAppKitModalNetworks.supported.keys; for (var ns in namespaces) { - final chains = AppKitModalNetworks.supported[ns] ?? []; + final chains = ReownAppKitModalNetworks.supported[ns] ?? []; _optionalNamespaces[ns] = RequiredNamespace( chains: chains.map((e) => '$ns:${e.chainId}').toList(), methods: MethodsConstants.allMethods.toSet().toList(), @@ -1305,7 +1310,7 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { (k) => k != CoreConstants.namespace, ); if (wrongNamespace != null) { - throw AppKitModalException( + throw ReownAppKitModalException( 'Only ${CoreConstants.namespace} networks are supported', ); } @@ -1349,7 +1354,8 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { } @override - Future requestSwitchToChain(AppKitModalNetworkInfo newChain) async { + Future requestSwitchToChain( + ReownAppKitModalNetworkInfo newChain) async { if (_currentSession?.sessionService.isMagic == true) { await selectChain(newChain); return; @@ -1391,7 +1397,7 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { } @override - Future requestAddChain(AppKitModalNetworkInfo newChain) async { + Future requestAddChain(ReownAppKitModalNetworkInfo newChain) async { final topic = _currentSession?.topic ?? ''; final chainId = '${CoreConstants.namespace}:$_currentSelectedChainId'; final newChainId = '${CoreConstants.namespace}:${newChain.chainId}'; @@ -1464,15 +1470,15 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { _currentSession = null; _lastChainEmitted = null; _supportsOneClickAuth = false; - _status = AppKitModalStatus.initialized; + _status = ReownAppKitModalStatus.initialized; _notify(); } void _checkInitialized() { - if (_status != AppKitModalStatus.initialized && - _status != AppKitModalStatus.initializing) { - throw AppKitModalException( - 'AppKitModal must be initialized before calling this method.', + if (_status != ReownAppKitModalStatus.initialized && + _status != ReownAppKitModalStatus.initializing) { + throw ReownAppKitModalException( + 'ReownAppKitModal must be initialized before calling this method.', ); } } @@ -1573,7 +1579,7 @@ class AppKitModal with ChangeNotifier implements IAppKitModal { } } -extension _EmailConnectorExtension on AppKitModal { +extension _EmailConnectorExtension on ReownAppKitModal { // Login event should be treated like Connect event for regular wallets Future _onMagicLoginEvent(MagicLoginEvent? args) async { final debugString = jsonEncode(args?.data?.toJson()); @@ -1583,7 +1589,7 @@ extension _EmailConnectorExtension on AppKitModal { _currentSelectedChainId = newChainId; // final magicData = args.data?.copytWith(chainId: int.tryParse(newChainId)); - final session = AppKitModalSession(magicData: magicData); + final session = ReownAppKitModalSession(magicData: magicData); await _setSesionAndChainData(session); onModalConnect.broadcast(ModalConnect(session)); if (_selectedWallet == null) { @@ -1597,7 +1603,7 @@ extension _EmailConnectorExtension on AppKitModal { onModalUpdate.broadcast(ModalConnect(_currentSession!)); } else { _disconnectOnClose = true; - final theme = AppKitModalTheme.maybeOf(_context!); + final theme = ReownAppKitModalTheme.maybeOf(_context!); await magicService.instance.syncTheme(theme); widgetStack.instance.push(ApproveSIWEPage( onSiweFinish: _oneSIWEFinish, @@ -1672,7 +1678,7 @@ extension _EmailConnectorExtension on AppKitModal { } } -extension _CoinbaseConnectorExtension on AppKitModal { +extension _CoinbaseConnectorExtension on ReownAppKitModal { void _onCoinbaseConnectEvent(CoinbaseConnectEvent? args) async { final debugString = jsonEncode(args?.data?.toJson()); _logger.i('[$runtimeType] _onCoinbaseConnectEvent: $debugString'); @@ -1680,7 +1686,7 @@ extension _CoinbaseConnectorExtension on AppKitModal { final newChainId = _getStoredChainId('${args!.data!.chainId}')!; _currentSelectedChainId = newChainId; // - final session = AppKitModalSession(coinbaseData: args.data!); + final session = ReownAppKitModalSession(coinbaseData: args.data!); await _setSesionAndChainData(session); onModalConnect.broadcast(ModalConnect(session)); // @@ -1705,7 +1711,7 @@ extension _CoinbaseConnectorExtension on AppKitModal { final chainId = args.chainId ?? _currentSession!.chainId; _currentSelectedChainId = chainId; // - final chain = AppKitModalNetworks.getNetworkById( + final chain = ReownAppKitModalNetworks.getNetworkById( CoreConstants.namespace, chainId, ); @@ -1741,7 +1747,7 @@ extension _CoinbaseConnectorExtension on AppKitModal { } } -extension _AppKitModalExtension on AppKitModal { +extension _AppKitModalExtension on ReownAppKitModal { void _onSessionAuthResponse(SessionAuthResponse? args) async { final debugString = jsonEncode(args?.toJson()); dev.log('[$runtimeType] _onSessionAuthResponse: $debugString'); @@ -1804,7 +1810,8 @@ extension _AppKitModalExtension on AppKitModal { } // HAS TO BE CALLED JUST ONCE ON CONNECTION - Future _settleSession(SessionData sessionData) async { + Future _settleSession( + SessionData sessionData) async { if (_currentSelectedChainId == null) { final chains = NamespaceUtils.getChainIdsFromNamespaces( namespaces: sessionData.namespaces, @@ -1812,7 +1819,7 @@ extension _AppKitModalExtension on AppKitModal { final chainId = chains.first.split(':').last.toString(); _currentSelectedChainId = chainId; } - final session = AppKitModalSession(sessionData: sessionData); + final session = ReownAppKitModalSession(sessionData: sessionData); await _setSesionAndChainData(session); if (_selectedWallet == null) { analyticsService.instance.sendEvent(ConnectSuccessEvent( @@ -1832,7 +1839,7 @@ extension _AppKitModalExtension on AppKitModal { return session; } - void _oneSIWEFinish(AppKitModalSession updatedSession) async { + void _oneSIWEFinish(ReownAppKitModalSession updatedSession) async { await _storeSession(updatedSession); try { await _storage.set( @@ -1873,7 +1880,7 @@ extension _AppKitModalExtension on AppKitModal { if (wcSessions.isEmpty) return; // final session = _appKit.sessions.get(args.topic); - final updatedSession = AppKitModalSession( + final updatedSession = ReownAppKitModalSession( sessionData: session!.copyWith( namespaces: args.namespaces, ), @@ -1896,27 +1903,30 @@ extension _AppKitModalExtension on AppKitModal { void _onRelayClientConnect(EventArgs? args) { _logger.i('[$runtimeType] relay client connected'); - final service = _currentSession?.sessionService ?? AppKitModalConnector.wc; + final service = + _currentSession?.sessionService ?? ReownAppKitModalConnector.wc; if (service.isWC && _serviceInitialized) { - _status = AppKitModalStatus.initialized; + _status = ReownAppKitModalStatus.initialized; _notify(); } } void _onRelayClientDisconnect(EventArgs? args) { _logger.i('[$runtimeType] relay client disconnected'); - final service = _currentSession?.sessionService ?? AppKitModalConnector.wc; + final service = + _currentSession?.sessionService ?? ReownAppKitModalConnector.wc; if (service.isWC && _serviceInitialized) { - _status = AppKitModalStatus.idle; + _status = ReownAppKitModalStatus.idle; _notify(); } } void _onRelayClientError(ErrorEvent? args) { _logger.i('[$runtimeType] relay client error: ${args?.error}'); - final service = _currentSession?.sessionService ?? AppKitModalConnector.wc; + final service = + _currentSession?.sessionService ?? ReownAppKitModalConnector.wc; if (service.isWC) { - _status = AppKitModalStatus.error; + _status = ReownAppKitModalStatus.error; _notify(); } } diff --git a/packages/reown_appkit/lib/modal/i_appkit_modal_impl.dart b/packages/reown_appkit/lib/modal/i_appkit_modal_impl.dart index ec8ff64..6372545 100644 --- a/packages/reown_appkit/lib/modal/i_appkit_modal_impl.dart +++ b/packages/reown_appkit/lib/modal/i_appkit_modal_impl.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:reown_appkit/reown_appkit.dart'; -enum AppKitModalStatus { +enum ReownAppKitModalStatus { idle, initializing, initialized, @@ -15,11 +15,11 @@ enum AppKitModalStatus { /// Either a [projectId] and [metadata] must be provided or an already created [appKit]. /// optionalNamespaces is mostly not needed, if you use it, the values set here will override every optionalNamespaces set in evey chain -abstract class IAppKitModal with ChangeNotifier { +abstract class IReownAppKitModal with ChangeNotifier { BuildContext? get modalContext; /// Whether or not this object has been initialized. - AppKitModalStatus get status; + ReownAppKitModalStatus get status; bool get hasNamespaces; @@ -37,7 +37,7 @@ abstract class IAppKitModal with ChangeNotifier { String? get wcUri; /// The current session's data. - AppKitModalSession? get session; + ReownAppKitModalSession? get session; /// The url to the account's avatar image. /// Pass this into a [Image.network] and it will load the avatar image. @@ -49,16 +49,16 @@ abstract class IAppKitModal with ChangeNotifier { ValueNotifier get balanceNotifier; /// The currently selected chain. - AppKitModalNetworkInfo? get selectedChain; + ReownAppKitModalNetworkInfo? get selectedChain; /// The currently selected wallet. - AppKitModalWalletInfo? get selectedWallet; + ReownAppKitModalWalletInfo? get selectedWallet; /// Sets up the explorer and appKit if they already been initialized. Future init(); // @Deprecated( - // 'Add context param to AppKitModal and use openNetworksView() instead') + // 'Add context param to ReownAppKitModal and use openNetworksView() instead') // Future openNetworks(BuildContext context); Future openNetworksView(); @@ -72,13 +72,13 @@ abstract class IAppKitModal with ChangeNotifier { Future reconnectRelay(); /// Sets the [selectedWallet] to be connected - void selectWallet(AppKitModalWalletInfo? walletInfo); + void selectWallet(ReownAppKitModalWalletInfo? walletInfo); /// Sets the [selectedChain] and gets the [chainBalance]. /// If the wallet is already connected, it will request the chain to be changed and will update the session with the new chain. /// If [chainInfo] is null this will disconnect the wallet. Future selectChain( - AppKitModalNetworkInfo? chainInfo, { + ReownAppKitModalNetworkInfo? chainInfo, { bool switchChain = false, }); @@ -142,8 +142,8 @@ abstract class IAppKitModal with ChangeNotifier { required SessionRequestParams request, }); - Future requestSwitchToChain(AppKitModalNetworkInfo newChain); - Future requestAddChain(AppKitModalNetworkInfo newChain); + Future requestSwitchToChain(ReownAppKitModalNetworkInfo newChain); + Future requestAddChain(ReownAppKitModalNetworkInfo newChain); /// Closes the modal. void closeModal({bool disconnectSession = false}); diff --git a/packages/reown_appkit/lib/modal/models/public/appkit_modal_events.dart b/packages/reown_appkit/lib/modal/models/public/appkit_modal_events.dart index 77c7fed..338d13a 100644 --- a/packages/reown_appkit/lib/modal/models/public/appkit_modal_events.dart +++ b/packages/reown_appkit/lib/modal/models/public/appkit_modal_events.dart @@ -1,7 +1,7 @@ import 'package:reown_appkit/reown_appkit.dart'; class ModalConnect extends EventArgs { - final AppKitModalSession session; + final ReownAppKitModalSession session; ModalConnect(this.session); @override diff --git a/packages/reown_appkit/lib/modal/models/public/appkit_modal_exceptions.dart b/packages/reown_appkit/lib/modal/models/public/appkit_modal_exceptions.dart index 72cf0b9..50b5657 100644 --- a/packages/reown_appkit/lib/modal/models/public/appkit_modal_exceptions.dart +++ b/packages/reown_appkit/lib/modal/models/public/appkit_modal_exceptions.dart @@ -1,5 +1,5 @@ -class AppKitModalException implements Exception { +class ReownAppKitModalException implements Exception { final dynamic message; final dynamic stackTrace; - AppKitModalException(this.message, [this.stackTrace]) : super(); + ReownAppKitModalException(this.message, [this.stackTrace]) : super(); } diff --git a/packages/reown_appkit/lib/modal/models/public/appkit_modal_session.dart b/packages/reown_appkit/lib/modal/models/public/appkit_modal_session.dart index 3d19e6f..cd94285 100644 --- a/packages/reown_appkit/lib/modal/models/public/appkit_modal_session.dart +++ b/packages/reown_appkit/lib/modal/models/public/appkit_modal_session.dart @@ -5,26 +5,26 @@ import 'package:reown_appkit/modal/services/magic_service/magic_service.dart'; import 'package:reown_appkit/modal/services/magic_service/models/magic_data.dart'; import 'package:reown_appkit/reown_appkit.dart'; -// TODO AppKitModal this should be hidden -enum AppKitModalConnector { +// TODO ReownAppKitModal this should be hidden +enum ReownAppKitModalConnector { wc, coinbase, magic, none; - bool get isWC => this == AppKitModalConnector.wc; - bool get isCoinbase => this == AppKitModalConnector.coinbase; - bool get isMagic => this == AppKitModalConnector.magic; - bool get noSession => this == AppKitModalConnector.none; + bool get isWC => this == ReownAppKitModalConnector.wc; + bool get isCoinbase => this == ReownAppKitModalConnector.coinbase; + bool get isMagic => this == ReownAppKitModalConnector.magic; + bool get noSession => this == ReownAppKitModalConnector.none; } -class AppKitModalSession { +class ReownAppKitModalSession { SessionData? _sessionData; CoinbaseData? _coinbaseData; MagicData? _magicData; SIWESession? _siweSession; - AppKitModalSession({ + ReownAppKitModalSession({ SessionData? sessionData, CoinbaseData? coinbaseData, MagicData? magicData, @@ -35,12 +35,12 @@ class AppKitModalSession { _siweSession = siweSession; /// USED TO READ THE SESSION FROM LOCAL STORAGE - factory AppKitModalSession.fromMap(Map map) { + factory ReownAppKitModalSession.fromMap(Map map) { final sessionDataString = map['sessionData']; final coinbaseDataString = map['coinbaseData']; final magicDataString = map['magicData']; final siweSession = map['siweSession']; - return AppKitModalSession( + return ReownAppKitModalSession( sessionData: sessionDataString != null ? SessionData.fromJson(sessionDataString) : null, @@ -54,13 +54,13 @@ class AppKitModalSession { ); } - AppKitModalSession copyWith({ + ReownAppKitModalSession copyWith({ SessionData? sessionData, CoinbaseData? coinbaseData, MagicData? magicData, SIWESession? siweSession, }) { - return AppKitModalSession( + return ReownAppKitModalSession( sessionData: sessionData ?? _sessionData, coinbaseData: coinbaseData ?? _coinbaseData, magicData: magicData ?? _magicData, @@ -68,18 +68,18 @@ class AppKitModalSession { ); } - AppKitModalConnector get sessionService { + ReownAppKitModalConnector get sessionService { if (_sessionData != null) { - return AppKitModalConnector.wc; + return ReownAppKitModalConnector.wc; } if (_coinbaseData != null) { - return AppKitModalConnector.coinbase; + return ReownAppKitModalConnector.coinbase; } if (_magicData != null) { - return AppKitModalConnector.magic; + return ReownAppKitModalConnector.magic; } - return AppKitModalConnector.none; + return ReownAppKitModalConnector.none; } bool hasSwitchMethod() { @@ -168,7 +168,7 @@ class AppKitModalSession { return _sessionData?.peer.metadata.redirect; } - // toJson() would convert AppKitModalSession to a SessionData kind of map + // toJson() would convert ReownAppKitModalSession to a SessionData kind of map // no matter if Coinbase Wallet or Email Wallet is connected Map toJson() => { if (topic != null) 'topic': topic, @@ -187,7 +187,7 @@ class AppKitModalSession { }; } -extension AppKitModalSessionExtension on AppKitModalSession { +extension ReownAppKitModalSessionExtension on ReownAppKitModalSession { String? get topic => _sessionData?.topic; String? get pairingTopic => _sessionData?.pairingTopic; Relay? get relay => _sessionData?.relay; diff --git a/packages/reown_appkit/lib/modal/models/public/appkit_network_info.dart b/packages/reown_appkit/lib/modal/models/public/appkit_network_info.dart index 84de4d6..ea75b30 100644 --- a/packages/reown_appkit/lib/modal/models/public/appkit_network_info.dart +++ b/packages/reown_appkit/lib/modal/models/public/appkit_network_info.dart @@ -3,8 +3,8 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'appkit_network_info.freezed.dart'; @freezed -class AppKitModalNetworkInfo with _$AppKitModalNetworkInfo { - factory AppKitModalNetworkInfo({ +class ReownAppKitModalNetworkInfo with _$ReownAppKitModalNetworkInfo { + factory ReownAppKitModalNetworkInfo({ required String name, required String chainId, required String currency, @@ -16,7 +16,7 @@ class AppKitModalNetworkInfo with _$AppKitModalNetworkInfo { }) = _AppKitNetworkInfo; } -extension AppKitNetworkInfoExtension on AppKitModalNetworkInfo { +extension AppKitNetworkInfoExtension on ReownAppKitModalNetworkInfo { String get chainHexId => '0x${int.parse(chainId).toRadixString(16)}'; Map toJson() { diff --git a/packages/reown_appkit/lib/modal/models/public/appkit_network_info.freezed.dart b/packages/reown_appkit/lib/modal/models/public/appkit_network_info.freezed.dart index 78db1b6..0f85a45 100644 --- a/packages/reown_appkit/lib/modal/models/public/appkit_network_info.freezed.dart +++ b/packages/reown_appkit/lib/modal/models/public/appkit_network_info.freezed.dart @@ -15,7 +15,7 @@ final _privateConstructorUsedError = UnsupportedError( 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc -mixin _$AppKitModalNetworkInfo { +mixin _$ReownAppKitModalNetworkInfo { String get name => throw _privateConstructorUsedError; String get chainId => throw _privateConstructorUsedError; String get currency => throw _privateConstructorUsedError; @@ -26,15 +26,17 @@ mixin _$AppKitModalNetworkInfo { String? get chainIcon => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $AppKitModalNetworkInfoCopyWith get copyWith => - throw _privateConstructorUsedError; + $ReownAppKitModalNetworkInfoCopyWith + get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $AppKitModalNetworkInfoCopyWith<$Res> { - factory $AppKitModalNetworkInfoCopyWith(AppKitModalNetworkInfo value, - $Res Function(AppKitModalNetworkInfo) then) = - _$AppKitModalNetworkInfoCopyWithImpl<$Res, AppKitModalNetworkInfo>; +abstract class $ReownAppKitModalNetworkInfoCopyWith<$Res> { + factory $ReownAppKitModalNetworkInfoCopyWith( + ReownAppKitModalNetworkInfo value, + $Res Function(ReownAppKitModalNetworkInfo) then) = + _$ReownAppKitModalNetworkInfoCopyWithImpl<$Res, + ReownAppKitModalNetworkInfo>; @useResult $Res call( {String name, @@ -48,10 +50,10 @@ abstract class $AppKitModalNetworkInfoCopyWith<$Res> { } /// @nodoc -class _$AppKitModalNetworkInfoCopyWithImpl<$Res, - $Val extends AppKitModalNetworkInfo> - implements $AppKitModalNetworkInfoCopyWith<$Res> { - _$AppKitModalNetworkInfoCopyWithImpl(this._value, this._then); +class _$ReownAppKitModalNetworkInfoCopyWithImpl<$Res, + $Val extends ReownAppKitModalNetworkInfo> + implements $ReownAppKitModalNetworkInfoCopyWith<$Res> { + _$ReownAppKitModalNetworkInfoCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; @@ -109,7 +111,7 @@ class _$AppKitModalNetworkInfoCopyWithImpl<$Res, /// @nodoc abstract class _$$AppKitNetworkInfoImplCopyWith<$Res> - implements $AppKitModalNetworkInfoCopyWith<$Res> { + implements $ReownAppKitModalNetworkInfoCopyWith<$Res> { factory _$$AppKitNetworkInfoImplCopyWith(_$AppKitNetworkInfoImpl value, $Res Function(_$AppKitNetworkInfoImpl) then) = __$$AppKitNetworkInfoImplCopyWithImpl<$Res>; @@ -128,7 +130,8 @@ abstract class _$$AppKitNetworkInfoImplCopyWith<$Res> /// @nodoc class __$$AppKitNetworkInfoImplCopyWithImpl<$Res> - extends _$AppKitModalNetworkInfoCopyWithImpl<$Res, _$AppKitNetworkInfoImpl> + extends _$ReownAppKitModalNetworkInfoCopyWithImpl<$Res, + _$AppKitNetworkInfoImpl> implements _$$AppKitNetworkInfoImplCopyWith<$Res> { __$$AppKitNetworkInfoImplCopyWithImpl(_$AppKitNetworkInfoImpl _value, $Res Function(_$AppKitNetworkInfoImpl) _then) @@ -222,7 +225,7 @@ class _$AppKitNetworkInfoImpl implements _AppKitNetworkInfo { @override String toString() { - return 'AppKitModalNetworkInfo(name: $name, chainId: $chainId, currency: $currency, rpcUrl: $rpcUrl, explorerUrl: $explorerUrl, extraRpcUrls: $extraRpcUrls, isTestNetwork: $isTestNetwork, chainIcon: $chainIcon)'; + return 'ReownAppKitModalNetworkInfo(name: $name, chainId: $chainId, currency: $currency, rpcUrl: $rpcUrl, explorerUrl: $explorerUrl, extraRpcUrls: $extraRpcUrls, isTestNetwork: $isTestNetwork, chainIcon: $chainIcon)'; } @override @@ -265,7 +268,7 @@ class _$AppKitNetworkInfoImpl implements _AppKitNetworkInfo { this, _$identity); } -abstract class _AppKitNetworkInfo implements AppKitModalNetworkInfo { +abstract class _AppKitNetworkInfo implements ReownAppKitModalNetworkInfo { factory _AppKitNetworkInfo( {required final String name, required final String chainId, diff --git a/packages/reown_appkit/lib/modal/models/public/appkit_wallet_info.dart b/packages/reown_appkit/lib/modal/models/public/appkit_wallet_info.dart index 64d087a..4e03364 100644 --- a/packages/reown_appkit/lib/modal/models/public/appkit_wallet_info.dart +++ b/packages/reown_appkit/lib/modal/models/public/appkit_wallet_info.dart @@ -6,18 +6,18 @@ part 'appkit_wallet_info.freezed.dart'; part 'appkit_wallet_info.g.dart'; @freezed -class AppKitModalWalletInfo with _$AppKitModalWalletInfo { - const factory AppKitModalWalletInfo({ +class ReownAppKitModalWalletInfo with _$ReownAppKitModalWalletInfo { + const factory ReownAppKitModalWalletInfo({ required Listing listing, required bool installed, required bool recent, - }) = _AppKitWalletInfo; + }) = _ReownAppKitModalWalletInfo; - factory AppKitModalWalletInfo.fromJson(Map json) => - _$AppKitModalWalletInfoFromJson(json); + factory ReownAppKitModalWalletInfo.fromJson(Map json) => + _$ReownAppKitModalWalletInfoFromJson(json); } -extension AppKitWalletInfoExtension on AppKitModalWalletInfo { +extension ReownAppKitWalletInfoExtension on ReownAppKitModalWalletInfo { bool get isCoinbase => listing.id == 'fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa'; diff --git a/packages/reown_appkit/lib/modal/models/public/appkit_wallet_info.freezed.dart b/packages/reown_appkit/lib/modal/models/public/appkit_wallet_info.freezed.dart index 29ecfe2..26c4386 100644 --- a/packages/reown_appkit/lib/modal/models/public/appkit_wallet_info.freezed.dart +++ b/packages/reown_appkit/lib/modal/models/public/appkit_wallet_info.freezed.dart @@ -14,37 +14,38 @@ T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); -AppKitModalWalletInfo _$AppKitModalWalletInfoFromJson( +ReownAppKitModalWalletInfo _$ReownAppKitModalWalletInfoFromJson( Map json) { - return _AppKitWalletInfo.fromJson(json); + return _ReownAppKitModalWalletInfo.fromJson(json); } /// @nodoc -mixin _$AppKitModalWalletInfo { +mixin _$ReownAppKitModalWalletInfo { Listing get listing => throw _privateConstructorUsedError; bool get installed => throw _privateConstructorUsedError; bool get recent => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $AppKitModalWalletInfoCopyWith get copyWith => - throw _privateConstructorUsedError; + $ReownAppKitModalWalletInfoCopyWith + get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $AppKitModalWalletInfoCopyWith<$Res> { - factory $AppKitModalWalletInfoCopyWith(AppKitModalWalletInfo value, - $Res Function(AppKitModalWalletInfo) then) = - _$AppKitModalWalletInfoCopyWithImpl<$Res, AppKitModalWalletInfo>; +abstract class $ReownAppKitModalWalletInfoCopyWith<$Res> { + factory $ReownAppKitModalWalletInfoCopyWith(ReownAppKitModalWalletInfo value, + $Res Function(ReownAppKitModalWalletInfo) then) = + _$ReownAppKitModalWalletInfoCopyWithImpl<$Res, + ReownAppKitModalWalletInfo>; @useResult $Res call({Listing listing, bool installed, bool recent}); } /// @nodoc -class _$AppKitModalWalletInfoCopyWithImpl<$Res, - $Val extends AppKitModalWalletInfo> - implements $AppKitModalWalletInfoCopyWith<$Res> { - _$AppKitModalWalletInfoCopyWithImpl(this._value, this._then); +class _$ReownAppKitModalWalletInfoCopyWithImpl<$Res, + $Val extends ReownAppKitModalWalletInfo> + implements $ReownAppKitModalWalletInfoCopyWith<$Res> { + _$ReownAppKitModalWalletInfoCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; @@ -76,22 +77,25 @@ class _$AppKitModalWalletInfoCopyWithImpl<$Res, } /// @nodoc -abstract class _$$AppKitWalletInfoImplCopyWith<$Res> - implements $AppKitModalWalletInfoCopyWith<$Res> { - factory _$$AppKitWalletInfoImplCopyWith(_$AppKitWalletInfoImpl value, - $Res Function(_$AppKitWalletInfoImpl) then) = - __$$AppKitWalletInfoImplCopyWithImpl<$Res>; +abstract class _$$ReownAppKitModalWalletInfoImplCopyWith<$Res> + implements $ReownAppKitModalWalletInfoCopyWith<$Res> { + factory _$$ReownAppKitModalWalletInfoImplCopyWith( + _$ReownAppKitModalWalletInfoImpl value, + $Res Function(_$ReownAppKitModalWalletInfoImpl) then) = + __$$ReownAppKitModalWalletInfoImplCopyWithImpl<$Res>; @override @useResult $Res call({Listing listing, bool installed, bool recent}); } /// @nodoc -class __$$AppKitWalletInfoImplCopyWithImpl<$Res> - extends _$AppKitModalWalletInfoCopyWithImpl<$Res, _$AppKitWalletInfoImpl> - implements _$$AppKitWalletInfoImplCopyWith<$Res> { - __$$AppKitWalletInfoImplCopyWithImpl(_$AppKitWalletInfoImpl _value, - $Res Function(_$AppKitWalletInfoImpl) _then) +class __$$ReownAppKitModalWalletInfoImplCopyWithImpl<$Res> + extends _$ReownAppKitModalWalletInfoCopyWithImpl<$Res, + _$ReownAppKitModalWalletInfoImpl> + implements _$$ReownAppKitModalWalletInfoImplCopyWith<$Res> { + __$$ReownAppKitModalWalletInfoImplCopyWithImpl( + _$ReownAppKitModalWalletInfoImpl _value, + $Res Function(_$ReownAppKitModalWalletInfoImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -101,7 +105,7 @@ class __$$AppKitWalletInfoImplCopyWithImpl<$Res> Object? installed = null, Object? recent = null, }) { - return _then(_$AppKitWalletInfoImpl( + return _then(_$ReownAppKitModalWalletInfoImpl( listing: null == listing ? _value.listing : listing // ignore: cast_nullable_to_non_nullable @@ -120,12 +124,13 @@ class __$$AppKitWalletInfoImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$AppKitWalletInfoImpl implements _AppKitWalletInfo { - const _$AppKitWalletInfoImpl( +class _$ReownAppKitModalWalletInfoImpl implements _ReownAppKitModalWalletInfo { + const _$ReownAppKitModalWalletInfoImpl( {required this.listing, required this.installed, required this.recent}); - factory _$AppKitWalletInfoImpl.fromJson(Map json) => - _$$AppKitWalletInfoImplFromJson(json); + factory _$ReownAppKitModalWalletInfoImpl.fromJson( + Map json) => + _$$ReownAppKitModalWalletInfoImplFromJson(json); @override final Listing listing; @@ -136,14 +141,14 @@ class _$AppKitWalletInfoImpl implements _AppKitWalletInfo { @override String toString() { - return 'AppKitModalWalletInfo(listing: $listing, installed: $installed, recent: $recent)'; + return 'ReownAppKitModalWalletInfo(listing: $listing, installed: $installed, recent: $recent)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$AppKitWalletInfoImpl && + other is _$ReownAppKitModalWalletInfoImpl && (identical(other.listing, listing) || other.listing == listing) && (identical(other.installed, installed) || other.installed == installed) && @@ -157,26 +162,27 @@ class _$AppKitWalletInfoImpl implements _AppKitWalletInfo { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$AppKitWalletInfoImplCopyWith<_$AppKitWalletInfoImpl> get copyWith => - __$$AppKitWalletInfoImplCopyWithImpl<_$AppKitWalletInfoImpl>( - this, _$identity); + _$$ReownAppKitModalWalletInfoImplCopyWith<_$ReownAppKitModalWalletInfoImpl> + get copyWith => __$$ReownAppKitModalWalletInfoImplCopyWithImpl< + _$ReownAppKitModalWalletInfoImpl>(this, _$identity); @override Map toJson() { - return _$$AppKitWalletInfoImplToJson( + return _$$ReownAppKitModalWalletInfoImplToJson( this, ); } } -abstract class _AppKitWalletInfo implements AppKitModalWalletInfo { - const factory _AppKitWalletInfo( +abstract class _ReownAppKitModalWalletInfo + implements ReownAppKitModalWalletInfo { + const factory _ReownAppKitModalWalletInfo( {required final Listing listing, required final bool installed, - required final bool recent}) = _$AppKitWalletInfoImpl; + required final bool recent}) = _$ReownAppKitModalWalletInfoImpl; - factory _AppKitWalletInfo.fromJson(Map json) = - _$AppKitWalletInfoImpl.fromJson; + factory _ReownAppKitModalWalletInfo.fromJson(Map json) = + _$ReownAppKitModalWalletInfoImpl.fromJson; @override Listing get listing; @@ -186,6 +192,6 @@ abstract class _AppKitWalletInfo implements AppKitModalWalletInfo { bool get recent; @override @JsonKey(ignore: true) - _$$AppKitWalletInfoImplCopyWith<_$AppKitWalletInfoImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ReownAppKitModalWalletInfoImplCopyWith<_$ReownAppKitModalWalletInfoImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/packages/reown_appkit/lib/modal/models/public/appkit_wallet_info.g.dart b/packages/reown_appkit/lib/modal/models/public/appkit_wallet_info.g.dart index 5ab9367..b3df4c3 100644 --- a/packages/reown_appkit/lib/modal/models/public/appkit_wallet_info.g.dart +++ b/packages/reown_appkit/lib/modal/models/public/appkit_wallet_info.g.dart @@ -6,16 +6,16 @@ part of 'appkit_wallet_info.dart'; // JsonSerializableGenerator // ************************************************************************** -_$AppKitWalletInfoImpl _$$AppKitWalletInfoImplFromJson( +_$ReownAppKitModalWalletInfoImpl _$$ReownAppKitModalWalletInfoImplFromJson( Map json) => - _$AppKitWalletInfoImpl( + _$ReownAppKitModalWalletInfoImpl( listing: Listing.fromJson(json['listing']), installed: json['installed'] as bool, recent: json['recent'] as bool, ); -Map _$$AppKitWalletInfoImplToJson( - _$AppKitWalletInfoImpl instance) => +Map _$$ReownAppKitModalWalletInfoImplToJson( + _$ReownAppKitModalWalletInfoImpl instance) => { 'listing': instance.listing.toJson(), 'installed': instance.installed, diff --git a/packages/reown_appkit/lib/modal/pages/account_page.dart b/packages/reown_appkit/lib/modal/pages/account_page.dart index a97538f..d656ee4 100644 --- a/packages/reown_appkit/lib/modal/pages/account_page.dart +++ b/packages/reown_appkit/lib/modal/pages/account_page.dart @@ -28,7 +28,7 @@ class AccountPage extends StatefulWidget { } class _AccountPageState extends State with WidgetsBindingObserver { - IAppKitModal? _service; + IReownAppKitModal? _service; @override void initState() { @@ -80,15 +80,15 @@ class _AccountPageState extends State with WidgetsBindingObserver { } class _DefaultAccountView extends StatelessWidget { - const _DefaultAccountView({required IAppKitModal service}) + const _DefaultAccountView({required IReownAppKitModal service}) : _service = service; - final IAppKitModal _service; + final IReownAppKitModal _service; @override Widget build(BuildContext context) { - final themeData = AppKitModalTheme.getDataOf(context); - final themeColors = AppKitModalTheme.colorsOf(context); - final radiuses = AppKitModalTheme.radiusesOf(context); + final themeData = ReownAppKitModalTheme.getDataOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); + final radiuses = ReownAppKitModalTheme.radiusesOf(context); final isEmailLogin = _service.session?.sessionService.isMagic ?? false; return Column( mainAxisSize: MainAxisSize.min, @@ -205,12 +205,12 @@ class _SelectNetworkButton extends StatelessWidget { @override Widget build(BuildContext context) { final service = ModalProvider.of(context).service; - final themeData = AppKitModalTheme.getDataOf(context); - final themeColors = AppKitModalTheme.colorsOf(context); + final themeData = ReownAppKitModalTheme.getDataOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); final chainId = service.selectedChain?.chainId ?? ''; - final imageId = AppKitModalNetworks.getNetworkIconId(chainId); + final imageId = ReownAppKitModalNetworks.getNetworkIconId(chainId); final tokenImage = explorerService.instance.getAssetImageUrl(imageId); - final radiuses = AppKitModalTheme.radiusesOf(context); + final radiuses = ReownAppKitModalTheme.radiusesOf(context); return AccountListItem( iconWidget: Padding( padding: const EdgeInsets.symmetric(horizontal: 4.0), @@ -232,7 +232,7 @@ class _SelectNetworkButton extends StatelessWidget { ), onTap: () { widgetStack.instance.push( - AppKitModalSelectNetworkPage(), + ReownAppKitModalSelectNetworkPage(), event: ClickNetworksEvent(), ); }, diff --git a/packages/reown_appkit/lib/modal/pages/approve_siwe.dart b/packages/reown_appkit/lib/modal/pages/approve_siwe.dart index 42485ce..49b9d5b 100644 --- a/packages/reown_appkit/lib/modal/pages/approve_siwe.dart +++ b/packages/reown_appkit/lib/modal/pages/approve_siwe.dart @@ -24,7 +24,7 @@ import 'package:reown_appkit/modal/widgets/navigation/navbar.dart'; import 'package:reown_appkit/reown_appkit.dart'; class ApproveSIWEPage extends StatefulWidget { - final Function(AppKitModalSession session) onSiweFinish; + final Function(ReownAppKitModalSession session) onSiweFinish; const ApproveSIWEPage({ required this.onSiweFinish, }) : super(key: KeyConstants.approveSiwePageKey); @@ -34,7 +34,7 @@ class ApproveSIWEPage extends StatefulWidget { } class _ApproveSIWEPageState extends State { - IAppKitModal? _appKitModal; + IReownAppKitModal? _appKitModal; double _position = 0.0; static const _duration = Duration(milliseconds: 1500); @@ -101,7 +101,7 @@ class _ApproveSIWEPageState extends State { // } on JsonRpcError catch (e) { _handleError(e.message); - } on AppKitModalException catch (e) { + } on ReownAppKitModalException catch (e) { _handleError(e.message); } catch (e) { _handleError(e.toString()); @@ -128,9 +128,9 @@ class _ApproveSIWEPageState extends State { Widget build(BuildContext context) { if (_appKitModal == null) return ContentLoading(); - final themeData = AppKitModalTheme.getDataOf(context); - final themeColors = AppKitModalTheme.colorsOf(context); - final radiuses = AppKitModalTheme.radiusesOf(context); + final themeData = ReownAppKitModalTheme.getDataOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); + final radiuses = ReownAppKitModalTheme.radiusesOf(context); String peerIcon; try { peerIcon = _appKitModal?.session?.peer?.metadata.icons.first ?? ''; diff --git a/packages/reown_appkit/lib/modal/pages/confirm_email_page.dart b/packages/reown_appkit/lib/modal/pages/confirm_email_page.dart index 493883c..f76f71b 100644 --- a/packages/reown_appkit/lib/modal/pages/confirm_email_page.dart +++ b/packages/reown_appkit/lib/modal/pages/confirm_email_page.dart @@ -122,9 +122,9 @@ class __VerifyDeviceViewState extends State<_VerifyDeviceView> { @override Widget build(BuildContext context) { - final themeColors = AppKitModalTheme.colorsOf(context); - final textStyles = AppKitModalTheme.getDataOf(context).textStyles; - final radiuses = AppKitModalTheme.radiusesOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); + final textStyles = ReownAppKitModalTheme.getDataOf(context).textStyles; + final radiuses = ReownAppKitModalTheme.radiusesOf(context); final borderRadiusIcon = radiuses.isSquare() ? 0.0 : 20.0; return Column( mainAxisSize: MainAxisSize.min, diff --git a/packages/reown_appkit/lib/modal/pages/connect_wallet_page.dart b/packages/reown_appkit/lib/modal/pages/connect_wallet_page.dart index 9ce28f4..5b804f5 100644 --- a/packages/reown_appkit/lib/modal/pages/connect_wallet_page.dart +++ b/packages/reown_appkit/lib/modal/pages/connect_wallet_page.dart @@ -32,7 +32,7 @@ class ConnectWalletPage extends StatefulWidget { class _ConnectWalletPageState extends State with WidgetsBindingObserver { - IAppKitModal? _service; + IReownAppKitModal? _service; SegmentOption _selectedSegment = SegmentOption.mobile; ModalError? errorEvent; @@ -79,8 +79,8 @@ class _ConnectWalletPageState extends State if (_service == null) { return ContentLoading(); } - final themeData = AppKitModalTheme.getDataOf(context); - final themeColors = AppKitModalTheme.colorsOf(context); + final themeData = ReownAppKitModalTheme.getDataOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); final isPortrait = ResponsiveData.isPortrait(context); final maxWidth = isPortrait ? ResponsiveData.maxWidthOf(context) @@ -312,7 +312,7 @@ class _WalletAvatar extends StatelessWidget { final String imageUrl; final bool errorConnection; - final AppKitModalColors themeColors; + final ReownAppKitModalColors themeColors; @override Widget build(BuildContext context) { diff --git a/packages/reown_appkit/lib/modal/pages/connet_network_page.dart b/packages/reown_appkit/lib/modal/pages/connet_network_page.dart index 27e01bb..ea4c3ad 100644 --- a/packages/reown_appkit/lib/modal/pages/connet_network_page.dart +++ b/packages/reown_appkit/lib/modal/pages/connet_network_page.dart @@ -19,7 +19,7 @@ import 'package:reown_appkit/modal/widgets/navigation/navbar.dart'; import 'package:reown_appkit/reown_appkit.dart'; class ConnectNetworkPage extends StatefulWidget { - final AppKitModalNetworkInfo chainInfo; + final ReownAppKitModalNetworkInfo chainInfo; const ConnectNetworkPage({ required this.chainInfo, }) : super(key: KeyConstants.connecNetworkPageKey); @@ -30,7 +30,7 @@ class ConnectNetworkPage extends StatefulWidget { class _ConnectNetworkPageState extends State with WidgetsBindingObserver { - IAppKitModal? _service; + IReownAppKitModal? _service; ModalError? errorEvent; @override @@ -51,7 +51,7 @@ class _ConnectNetworkPageState extends State try { await _service!.requestSwitchToChain(widget.chainInfo); final chainId = widget.chainInfo.chainId; - final chainInfo = AppKitModalNetworks.getNetworkById( + final chainInfo = ReownAppKitModalNetworks.getNetworkById( CoreConstants.namespace, chainId, ); @@ -94,8 +94,8 @@ class _ConnectNetworkPageState extends State if (_service == null) { return ContentLoading(); } - final themeData = AppKitModalTheme.getDataOf(context); - final themeColors = AppKitModalTheme.colorsOf(context); + final themeData = ReownAppKitModalTheme.getDataOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); final isPortrait = ResponsiveData.isPortrait(context); final maxWidth = isPortrait ? ResponsiveData.maxWidthOf(context) @@ -104,7 +104,7 @@ class _ConnectNetworkPageState extends State (kPadding16 * 2); // final chainId = widget.chainInfo.chainId; - final imageId = AppKitModalNetworks.getNetworkIconId(chainId); + final imageId = ReownAppKitModalNetworks.getNetworkIconId(chainId); final imageUrl = explorerService.instance.getAssetImageUrl(imageId); // return ModalNavbar( @@ -187,7 +187,7 @@ class _WalletAvatar extends StatelessWidget { final String imageUrl; final bool errorConnection; - final AppKitModalColors themeColors; + final ReownAppKitModalColors themeColors; @override Widget build(BuildContext context) { diff --git a/packages/reown_appkit/lib/modal/pages/get_wallet_page.dart b/packages/reown_appkit/lib/modal/pages/get_wallet_page.dart index 35ca109..478378a 100644 --- a/packages/reown_appkit/lib/modal/pages/get_wallet_page.dart +++ b/packages/reown_appkit/lib/modal/pages/get_wallet_page.dart @@ -23,7 +23,7 @@ class GetWalletPage extends StatelessWidget { @override Widget build(BuildContext context) { - final themeColors = AppKitModalTheme.colorsOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); final isPortrait = ResponsiveData.isPortrait(context); final maxHeight = isPortrait ? (kListItemHeight * 7) @@ -39,7 +39,7 @@ class GetWalletPage extends StatelessWidget { } final notInstalledItems = items - .where((GridItem w) => + .where((GridItem w) => !w.data.installed && !w.data.recent) .toList(); final itemsToShow = notInstalledItems diff --git a/packages/reown_appkit/lib/modal/pages/public/appkit_modal_all_wallets_page.dart b/packages/reown_appkit/lib/modal/pages/public/appkit_modal_all_wallets_page.dart index 4eada8a..c9c72b3 100644 --- a/packages/reown_appkit/lib/modal/pages/public/appkit_modal_all_wallets_page.dart +++ b/packages/reown_appkit/lib/modal/pages/public/appkit_modal_all_wallets_page.dart @@ -14,16 +14,17 @@ import 'package:reown_appkit/modal/widgets/value_listenable_builders/explorer_se import 'package:reown_appkit/modal/widgets/miscellaneous/all_wallets_header.dart'; import 'package:reown_appkit/modal/widgets/navigation/navbar.dart'; -class AppKitModalAllWalletsPage extends StatefulWidget { - const AppKitModalAllWalletsPage() +class ReownAppKitModalAllWalletsPage extends StatefulWidget { + const ReownAppKitModalAllWalletsPage() : super(key: KeyConstants.walletListLongPageKey); @override - State createState() => + State createState() => _AppKitModalAllWalletsPageState(); } -class _AppKitModalAllWalletsPageState extends State { +class _AppKitModalAllWalletsPageState + extends State { bool _paginating = false; final _controller = ScrollController(); diff --git a/packages/reown_appkit/lib/modal/pages/public/appkit_modal_main_wallets_page.dart b/packages/reown_appkit/lib/modal/pages/public/appkit_modal_main_wallets_page.dart index 00332fb..7ea68bb 100644 --- a/packages/reown_appkit/lib/modal/pages/public/appkit_modal_main_wallets_page.dart +++ b/packages/reown_appkit/lib/modal/pages/public/appkit_modal_main_wallets_page.dart @@ -24,17 +24,17 @@ import 'package:reown_appkit/modal/widgets/value_listenable_builders/explorer_se import 'package:reown_appkit/modal/widgets/navigation/navbar.dart'; import 'package:reown_appkit/reown_appkit.dart'; -class AppKitModalMainWalletsPage extends StatefulWidget { - const AppKitModalMainWalletsPage() +class ReownAppKitModalMainWalletsPage extends StatefulWidget { + const ReownAppKitModalMainWalletsPage() : super(key: KeyConstants.walletListShortPageKey); @override - State createState() => + State createState() => _AppKitModalMainWalletsPageState(); } class _AppKitModalMainWalletsPageState - extends State { + extends State { @override void initState() { super.initState(); @@ -114,7 +114,7 @@ class _AppKitModalMainWalletsPageState onTap: () { if (items.length <= kShortWalletListCount) { widgetStack.instance.push( - const AppKitModalQRCodePage(), + const ReownAppKitModalQRCodePage(), event: SelectWalletEvent( name: 'WalletConnect', platform: AnalyticsPlatform.qrcode, @@ -122,7 +122,7 @@ class _AppKitModalMainWalletsPageState ); } else { widgetStack.instance.push( - const AppKitModalAllWalletsPage(), + const ReownAppKitModalAllWalletsPage(), event: ClickAllWalletsEvent(), ); } @@ -140,8 +140,8 @@ class _AppKitModalMainWalletsPageState class _LoginDivider extends StatelessWidget { @override Widget build(BuildContext context) { - final themeColors = AppKitModalTheme.colorsOf(context); - final themeData = AppKitModalTheme.getDataOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); + final themeData = ReownAppKitModalTheme.getDataOf(context); return Row( children: [ Expanded( diff --git a/packages/reown_appkit/lib/modal/pages/public/appkit_modal_qrcode_page.dart b/packages/reown_appkit/lib/modal/pages/public/appkit_modal_qrcode_page.dart index 25d4b4e..f87e990 100644 --- a/packages/reown_appkit/lib/modal/pages/public/appkit_modal_qrcode_page.dart +++ b/packages/reown_appkit/lib/modal/pages/public/appkit_modal_qrcode_page.dart @@ -14,15 +14,16 @@ import 'package:reown_appkit/modal/widgets/navigation/navbar.dart'; import 'package:reown_appkit/modal/services/toast_service/models/toast_message.dart'; import 'package:reown_appkit/modal/services/toast_service/toast_service_singleton.dart'; -class AppKitModalQRCodePage extends StatefulWidget { - const AppKitModalQRCodePage() : super(key: KeyConstants.qrCodePageKey); +class ReownAppKitModalQRCodePage extends StatefulWidget { + const ReownAppKitModalQRCodePage() : super(key: KeyConstants.qrCodePageKey); @override - State createState() => _AppKitModalQRCodePageState(); + State createState() => + _AppKitModalQRCodePageState(); } -class _AppKitModalQRCodePageState extends State { - IAppKitModal? _service; +class _AppKitModalQRCodePageState extends State { + IReownAppKitModal? _service; Widget? _qrQodeWidget; // @@ -75,9 +76,9 @@ class _AppKitModalQRCodePageState extends State { @override Widget build(BuildContext context) { - final themeData = AppKitModalTheme.getDataOf(context); - final themeColors = AppKitModalTheme.colorsOf(context); - final radiuses = AppKitModalTheme.radiusesOf(context); + final themeData = ReownAppKitModalTheme.getDataOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); + final radiuses = ReownAppKitModalTheme.radiusesOf(context); final isPortrait = ResponsiveData.isPortrait(context); return ModalNavbar( diff --git a/packages/reown_appkit/lib/modal/pages/public/appkit_modal_select_network_page.dart b/packages/reown_appkit/lib/modal/pages/public/appkit_modal_select_network_page.dart index 961c47b..b3a5b50 100644 --- a/packages/reown_appkit/lib/modal/pages/public/appkit_modal_select_network_page.dart +++ b/packages/reown_appkit/lib/modal/pages/public/appkit_modal_select_network_page.dart @@ -16,15 +16,15 @@ import 'package:reown_appkit/modal/widgets/navigation/navbar.dart'; import 'package:reown_appkit/modal/widgets/modal_provider.dart'; import 'package:reown_appkit/reown_appkit.dart'; -class AppKitModalSelectNetworkPage extends StatelessWidget { - const AppKitModalSelectNetworkPage({ +class ReownAppKitModalSelectNetworkPage extends StatelessWidget { + const ReownAppKitModalSelectNetworkPage({ this.onTapNetwork, }) : super(key: KeyConstants.selectNetworkPage); - final Function(AppKitModalNetworkInfo)? onTapNetwork; + final Function(ReownAppKitModalNetworkInfo)? onTapNetwork; void _onSelectNetwork( - BuildContext context, AppKitModalNetworkInfo chainInfo) async { + BuildContext context, ReownAppKitModalNetworkInfo chainInfo) async { final service = ModalProvider.of(context).service; if (service.isConnected) { final approvedChains = service.session!.getApprovedChains() ?? []; @@ -45,8 +45,8 @@ class AppKitModalSelectNetworkPage extends StatelessWidget { @override Widget build(BuildContext context) { - final themeData = AppKitModalTheme.getDataOf(context); - final themeColors = AppKitModalTheme.colorsOf(context); + final themeData = ReownAppKitModalTheme.getDataOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); final service = ModalProvider.of(context).service; final isSwitch = service.selectedChain != null; final isPortrait = ResponsiveData.isPortrait(context); diff --git a/packages/reown_appkit/lib/modal/pages/upgrade_wallet_page.dart b/packages/reown_appkit/lib/modal/pages/upgrade_wallet_page.dart index d61c568..acfa922 100644 --- a/packages/reown_appkit/lib/modal/pages/upgrade_wallet_page.dart +++ b/packages/reown_appkit/lib/modal/pages/upgrade_wallet_page.dart @@ -15,8 +15,8 @@ class UpgradeWalletPage extends StatelessWidget { @override Widget build(BuildContext context) { - final textStyles = AppKitModalTheme.getDataOf(context).textStyles; - final themeColors = AppKitModalTheme.colorsOf(context); + final textStyles = ReownAppKitModalTheme.getDataOf(context).textStyles; + final themeColors = ReownAppKitModalTheme.colorsOf(context); return ModalNavbar( title: 'Upgrade your Wallet', safeAreaBottom: true, diff --git a/packages/reown_appkit/lib/modal/services/blockchain_service/blockchain_service.dart b/packages/reown_appkit/lib/modal/services/blockchain_service/blockchain_service.dart index b5d62b6..6923eed 100644 --- a/packages/reown_appkit/lib/modal/services/blockchain_service/blockchain_service.dart +++ b/packages/reown_appkit/lib/modal/services/blockchain_service/blockchain_service.dart @@ -116,7 +116,7 @@ class BlockChainService implements IBlockChainService { return jsonResponse.result; } throw jsonResponse.error ?? - // TODO AppKitModal change this error + // TODO ReownAppKitModal change this error ReownSignError( code: 0, message: 'Error parsing result', diff --git a/packages/reown_appkit/lib/modal/services/coinbase_service/coinbase_service.dart b/packages/reown_appkit/lib/modal/services/coinbase_service/coinbase_service.dart index 8e7bc6c..0db48ce 100644 --- a/packages/reown_appkit/lib/modal/services/coinbase_service/coinbase_service.dart +++ b/packages/reown_appkit/lib/modal/services/coinbase_service/coinbase_service.dart @@ -18,7 +18,7 @@ import 'package:reown_appkit/reown_appkit.dart'; class CoinbaseService implements ICoinbaseService { static const coinbasePackageName = 'org.toshi'; - static const defaultWalletData = AppKitModalWalletInfo( + static const defaultWalletData = ReownAppKitModalWalletInfo( listing: Listing( id: 'fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa', name: 'Coinbase Wallet', @@ -80,7 +80,7 @@ class CoinbaseService implements ICoinbaseService { late final PairingMetadata _metadata; late bool _enabled; - late AppKitModalWalletInfo _walletData; + late ReownAppKitModalWalletInfo _walletData; late final IReownCore _core; CoinbaseService({ @@ -315,7 +315,7 @@ extension on SessionRequestParams { case MethodsConstants.walletSwitchEthChain: case MethodsConstants.walletAddEthChain: try { - final chainInfo = AppKitModalNetworks.getNetworkById( + final chainInfo = ReownAppKitModalNetworks.getNetworkById( CoreConstants.namespace, chainId!, )!; diff --git a/packages/reown_appkit/lib/modal/services/explorer_service/explorer_service.dart b/packages/reown_appkit/lib/modal/services/explorer_service/explorer_service.dart index 39468ab..ac5c3fb 100644 --- a/packages/reown_appkit/lib/modal/services/explorer_service/explorer_service.dart +++ b/packages/reown_appkit/lib/modal/services/explorer_service/explorer_service.dart @@ -37,9 +37,9 @@ class ExplorerService implements IExplorerService { @override ValueNotifier totalListings = ValueNotifier(0); - List _listings = []; + List _listings = []; @override - ValueNotifier> listings = ValueNotifier([]); + ValueNotifier> listings = ValueNotifier([]); final _debouncer = Debouncer(milliseconds: 300); @@ -136,10 +136,10 @@ class ExplorerService implements IExplorerService { await _getRecentWalletAndOrder(); } - Future> _loadWCSampleWallets() async { + Future> _loadWCSampleWallets() async { // final platform = platformUtils.instance.getPlatformExact().name; // final platformName = platform.toString().toLowerCase(); - List sampleWallets = []; + List sampleWallets = []; for (var sampleWallet in WCSampleWallets.getSampleWallets()) { // final data = WCSampleWallets.nativeData[sampleWallet.listing.id]; // final schema = (data?[platformName]! as NativeAppData).schema ?? ''; @@ -155,13 +155,13 @@ class ExplorerService implements IExplorerService { } Future _getRecentWalletAndOrder() async { - AppKitModalWalletInfo? walletInfo; + ReownAppKitModalWalletInfo? walletInfo; if (_core.storage.has(StorageConstants.connectedWalletData)) { final walletData = _core.storage.get( StorageConstants.connectedWalletData, ); if (walletData != null) { - walletInfo = AppKitModalWalletInfo.fromJson(walletData); + walletInfo = ReownAppKitModalWalletInfo.fromJson(walletData); if (!walletInfo.installed) { walletInfo = null; } @@ -224,7 +224,7 @@ class ExplorerService implements IExplorerService { } } - Future> _fetchInstalledListings() async { + Future> _fetchInstalledListings() async { final pType = PlatformUtils.getPlatformType(); if (pType != PlatformType.mobile) { return []; @@ -248,7 +248,7 @@ class ExplorerService implements IExplorerService { return installedWallets.setInstalledFlag(); } - Future> _fetchFeaturedListings() async { + Future> _fetchFeaturedListings() async { if ((_featuredWalletsParam ?? '').isEmpty) { return []; } @@ -261,7 +261,7 @@ class ExplorerService implements IExplorerService { return await _fetchListings(params: params); } - Future> _fetchOtherListings() async { + Future> _fetchOtherListings() async { _requestParams = RequestParams( page: 1, entries: _defaultEntriesCount, @@ -272,7 +272,7 @@ class ExplorerService implements IExplorerService { return await _fetchListings(params: _requestParams); } - Future> _fetchListings({ + Future> _fetchListings({ RequestParams? params, bool updateCount = true, }) async { @@ -302,7 +302,7 @@ class ExplorerService implements IExplorerService { 'headers: $headers\n' 'queryParams $queryParams', ); - return []; + return []; } } catch (e) { _core.logger.d( @@ -314,7 +314,8 @@ class ExplorerService implements IExplorerService { } @override - Future storeConnectedWallet(AppKitModalWalletInfo? walletInfo) async { + Future storeConnectedWallet( + ReownAppKitModalWalletInfo? walletInfo) async { if (walletInfo == null) return; await _core.storage.set( StorageConstants.connectedWalletData, @@ -333,14 +334,14 @@ class ExplorerService implements IExplorerService { } @override - AppKitModalWalletInfo? getConnectedWallet() { + ReownAppKitModalWalletInfo? getConnectedWallet() { try { if (_core.storage.has(StorageConstants.connectedWalletData)) { final walletData = _core.storage.get( StorageConstants.connectedWalletData, ); if (walletData != null) { - return AppKitModalWalletInfo.fromJson(walletData); + return ReownAppKitModalWalletInfo.fromJson(walletData); } } } catch (e, s) { @@ -354,14 +355,14 @@ class ExplorerService implements IExplorerService { } Future _updateRecentWalletId( - AppKitModalWalletInfo? walletInfo, { + ReownAppKitModalWalletInfo? walletInfo, { String? walletId, }) async { try { final recentId = walletInfo?.listing.id ?? walletId; await storeRecentWalletId(recentId); - final currentListings = List.from( + final currentListings = List.from( _listings.map((e) => e.copyWith(recent: false)).toList(), ); final recentWallet = currentListings.firstWhereOrNull( @@ -419,7 +420,7 @@ class ExplorerService implements IExplorerService { } @override - Future getCoinbaseWalletObject() async { + Future getCoinbaseWalletObject() async { final results = await _fetchListings( params: RequestParams( page: 1, @@ -431,7 +432,8 @@ class ExplorerService implements IExplorerService { ); if (results.isNotEmpty) { - final wallet = AppKitModalWalletInfo.fromJson(results.first.toJson()); + final wallet = + ReownAppKitModalWalletInfo.fromJson(results.first.toJson()); final mobileLink = CoinbaseService.defaultWalletData.listing.mobileLink; bool installed = await uriService.instance.isInstalled(mobileLink); return wallet.copyWith( @@ -465,7 +467,7 @@ class ExplorerService implements IExplorerService { } @override - WalletRedirect? getWalletRedirect(AppKitModalWalletInfo? walletInfo) { + WalletRedirect? getWalletRedirect(ReownAppKitModalWalletInfo? walletInfo) { if (walletInfo == null) return null; if (walletInfo.listing.id == CoinbaseService.defaultWalletData.listing.id) { return WalletRedirect( @@ -500,9 +502,9 @@ class ExplorerService implements IExplorerService { } extension on List { - List toAppKitWalletInfo() { + List toAppKitWalletInfo() { return map( - (item) => AppKitModalWalletInfo( + (item) => ReownAppKitModalWalletInfo( listing: item, installed: false, recent: false, @@ -511,11 +513,11 @@ extension on List { } } -extension on List { - List sortByFeaturedIds( +extension on List { + List sortByFeaturedIds( Set? featuredWalletIds) { Map sortedMap = {}; - final auxList = List.from(this); + final auxList = List.from(this); for (var id in featuredWalletIds ?? {}) { final featured = auxList.firstWhereOrNull((e) => e.listing.id == id); @@ -528,7 +530,7 @@ extension on List { return [...sortedMap.values, ...auxList]; } - List setInstalledFlag() { + List setInstalledFlag() { return map((e) => e.copyWith(installed: true)).toList(); } } diff --git a/packages/reown_appkit/lib/modal/services/explorer_service/i_explorer_service.dart b/packages/reown_appkit/lib/modal/services/explorer_service/i_explorer_service.dart index a777e63..3207000 100644 --- a/packages/reown_appkit/lib/modal/services/explorer_service/i_explorer_service.dart +++ b/packages/reown_appkit/lib/modal/services/explorer_service/i_explorer_service.dart @@ -10,7 +10,7 @@ abstract class IExplorerService { ValueNotifier totalListings = ValueNotifier(0); - ValueNotifier> listings = ValueNotifier([]); + ValueNotifier> listings = ValueNotifier([]); /// If featuredWalletIds is set wallets from this list are going to be prioritized in the results Set? featuredWalletIds; @@ -37,15 +37,15 @@ abstract class IExplorerService { String get searchValue; /// update the recently used position to the top list - Future storeConnectedWallet(AppKitModalWalletInfo? walletInfo); + Future storeConnectedWallet(ReownAppKitModalWalletInfo? walletInfo); Future storeRecentWalletId(String? walletId); /// Get connected wallet data from local storage - AppKitModalWalletInfo? getConnectedWallet(); + ReownAppKitModalWalletInfo? getConnectedWallet(); /// Gets the WalletRedirect object from a wallet info data - WalletRedirect? getWalletRedirect(AppKitModalWalletInfo? walletInfo); + WalletRedirect? getWalletRedirect(ReownAppKitModalWalletInfo? walletInfo); /// Given an imageId it return the wallet app icon from our services String getWalletImageUrl(String imageId); @@ -53,5 +53,5 @@ abstract class IExplorerService { /// Given an imageId it return the chain icon from our services String getAssetImageUrl(String imageId); - Future getCoinbaseWalletObject(); + Future getCoinbaseWalletObject(); } diff --git a/packages/reown_appkit/lib/modal/services/explorer_service/models/wc_sample_wallets.dart b/packages/reown_appkit/lib/modal/services/explorer_service/models/wc_sample_wallets.dart index 8ebe403..f6a1247 100644 --- a/packages/reown_appkit/lib/modal/services/explorer_service/models/wc_sample_wallets.dart +++ b/packages/reown_appkit/lib/modal/services/explorer_service/models/wc_sample_wallets.dart @@ -77,9 +77,9 @@ class WCSampleWallets { }, ]; - static List getSampleWallets() { + static List getSampleWallets() { final wallets = _getSampleWallets().mapIndexed((index, entry) { - return AppKitModalWalletInfo( + return ReownAppKitModalWalletInfo( listing: Listing.fromJson({ 'id': index, 'name': entry['name'] as String?, @@ -94,7 +94,7 @@ class WCSampleWallets { recent: false, ); }).toList(); - return wallets.whereType().toList(); + return wallets.whereType().toList(); } static List> _getSampleWallets() { diff --git a/packages/reown_appkit/lib/modal/services/magic_service/i_magic_service.dart b/packages/reown_appkit/lib/modal/services/magic_service/i_magic_service.dart index 71f9ea6..9fc5354 100644 --- a/packages/reown_appkit/lib/modal/services/magic_service/i_magic_service.dart +++ b/packages/reown_appkit/lib/modal/services/magic_service/i_magic_service.dart @@ -16,7 +16,7 @@ abstract class IMagicService { Future updateEmailSecondaryOtp({required String otp}); Future connectOtp({required String otp}); Future getChainId(); - Future syncTheme(AppKitModalTheme? theme); + Future syncTheme(ReownAppKitModalTheme? theme); Future getUser({String? chainId}); Future switchNetwork({required String chainId}); Future request({ diff --git a/packages/reown_appkit/lib/modal/services/magic_service/magic_service.dart b/packages/reown_appkit/lib/modal/services/magic_service/magic_service.dart index 6c0d024..800f397 100644 --- a/packages/reown_appkit/lib/modal/services/magic_service/magic_service.dart +++ b/packages/reown_appkit/lib/modal/services/magic_service/magic_service.dart @@ -32,7 +32,7 @@ class MagicService implements IMagicService { 'wallet_switchEthereumChain', 'wallet_addEthereumChain', ]; - static const defaultWalletData = AppKitModalWalletInfo( + static const defaultWalletData = ReownAppKitModalWalletInfo( listing: Listing( id: '', name: 'Email Wallet', @@ -247,7 +247,7 @@ class MagicService implements IMagicService { } @override - Future syncTheme(AppKitModalTheme? theme) async { + Future syncTheme(ReownAppKitModalTheme? theme) async { if (!isEnabled.value || !isReady.value) return; final message = SyncTheme(theme: theme).toString(); await _webViewController.runJavaScript('sendMessage($message)'); diff --git a/packages/reown_appkit/lib/modal/services/magic_service/models/frame_message.dart b/packages/reown_appkit/lib/modal/services/magic_service/models/frame_message.dart index da6929e..c64ef98 100644 --- a/packages/reown_appkit/lib/modal/services/magic_service/models/frame_message.dart +++ b/packages/reown_appkit/lib/modal/services/magic_service/models/frame_message.dart @@ -238,14 +238,14 @@ class RpcRequest extends MessageData { } class SyncTheme extends MessageData { - final AppKitModalTheme? theme; + final ReownAppKitModalTheme? theme; SyncTheme({required this.theme}) : super(type: '@w3m-app/SYNC_THEME'); @override String toString() { final mode = theme?.isDarkMode == true ? 'dark' : 'light'; - final themeData = theme?.themeData ?? AppKitModalThemeData(); - late AppKitModalColors colors; + final themeData = theme?.themeData ?? ReownAppKitModalThemeData(); + late ReownAppKitModalColors colors; if (mode == 'dark') { colors = themeData.darkColors; } else { diff --git a/packages/reown_appkit/lib/modal/services/network_service/i_network_service.dart b/packages/reown_appkit/lib/modal/services/network_service/i_network_service.dart index 97a2c9f..6bd0947 100644 --- a/packages/reown_appkit/lib/modal/services/network_service/i_network_service.dart +++ b/packages/reown_appkit/lib/modal/services/network_service/i_network_service.dart @@ -4,7 +4,7 @@ import 'package:reown_appkit/modal/models/grid_item.dart'; import 'package:reown_appkit/modal/models/public/appkit_network_info.dart'; abstract class INetworkService { - abstract ValueNotifier>> itemList; + abstract ValueNotifier>> itemList; abstract ValueNotifier initialized; Future init(); diff --git a/packages/reown_appkit/lib/modal/services/network_service/network_service.dart b/packages/reown_appkit/lib/modal/services/network_service/network_service.dart index 30a9ade..3a51c51 100644 --- a/packages/reown_appkit/lib/modal/services/network_service/network_service.dart +++ b/packages/reown_appkit/lib/modal/services/network_service/network_service.dart @@ -11,17 +11,18 @@ class NetworkService implements INetworkService { @override ValueNotifier initialized = ValueNotifier(false); - List> itemListComplete = []; + List> itemListComplete = []; @override - ValueNotifier>> itemList = - ValueNotifier>>([]); + ValueNotifier>> itemList = + ValueNotifier>>([]); - String _getImageUrl(AppKitModalNetworkInfo chainInfo) { + String _getImageUrl(ReownAppKitModalNetworkInfo chainInfo) { if (chainInfo.chainIcon != null && chainInfo.chainIcon!.contains('http')) { return chainInfo.chainIcon!; } - final imageId = AppKitModalNetworks.getNetworkIconId(chainInfo.chainId); + final imageId = + ReownAppKitModalNetworks.getNetworkIconId(chainInfo.chainId); return explorerService.instance.getAssetImageUrl(imageId); } @@ -31,13 +32,13 @@ class NetworkService implements INetworkService { return; } - final networks = AppKitModalNetworks.getNetworks( + final networks = ReownAppKitModalNetworks.getNetworks( CoreConstants.namespace, ); for (var chain in networks) { final imageUrl = _getImageUrl(chain); itemListComplete.add( - GridItem( + GridItem( image: imageUrl, id: chain.chainId, title: RenderUtils.shorten(chain.name), diff --git a/packages/reown_appkit/lib/modal/services/siwe_service/i_siwe_service.dart b/packages/reown_appkit/lib/modal/services/siwe_service/i_siwe_service.dart index ccd3715..fd26a6c 100644 --- a/packages/reown_appkit/lib/modal/services/siwe_service/i_siwe_service.dart +++ b/packages/reown_appkit/lib/modal/services/siwe_service/i_siwe_service.dart @@ -19,7 +19,7 @@ abstract class ISiweService { Future signMessageRequest( String message, { - required AppKitModalSession session, + required ReownAppKitModalSession session, }); Future verifyMessage({ diff --git a/packages/reown_appkit/lib/modal/services/siwe_service/siwe_service.dart b/packages/reown_appkit/lib/modal/services/siwe_service/siwe_service.dart index 1d70bce..0241ff2 100644 --- a/packages/reown_appkit/lib/modal/services/siwe_service/siwe_service.dart +++ b/packages/reown_appkit/lib/modal/services/siwe_service/siwe_service.dart @@ -73,12 +73,12 @@ class SiweService implements ISiweService { @override Future signMessageRequest( String message, { - required AppKitModalSession session, + required ReownAppKitModalSession session, }) async { if (!enabled) throw Exception('siweConfig not enabled'); // final chainId = AuthSignature.getChainIdFromMessage(message); - final chainInfo = AppKitModalNetworks.getNetworkById( + final chainInfo = ReownAppKitModalNetworks.getNetworkById( CoreConstants.namespace, chainId, )!; @@ -132,7 +132,7 @@ class SiweService implements ISiweService { ); final isValid = await _siweConfig!.verifyMessage(verifyArgs); if (!isValid) { - throw AppKitModalException('Error verifying SIWE signature'); + throw ReownAppKitModalException('Error verifying SIWE signature'); } return true; } @@ -144,7 +144,7 @@ class SiweService implements ISiweService { try { final siweSession = await _siweConfig!.getSession(); if (siweSession == null) { - throw AppKitModalException('Error getting SIWE session'); + throw ReownAppKitModalException('Error getting SIWE session'); } _siweConfig!.onSignIn?.call(siweSession); @@ -160,7 +160,7 @@ class SiweService implements ISiweService { final success = await _siweConfig!.signOut(); if (!success) { - throw AppKitModalException('signOut() from siweConfig failed'); + throw ReownAppKitModalException('signOut() from siweConfig failed'); } _siweConfig!.onSignOut?.call(); } diff --git a/packages/reown_appkit/lib/modal/services/toast_service/models/toast_message.dart b/packages/reown_appkit/lib/modal/services/toast_service/models/toast_message.dart index 4bdcced..354691c 100644 --- a/packages/reown_appkit/lib/modal/services/toast_service/models/toast_message.dart +++ b/packages/reown_appkit/lib/modal/services/toast_service/models/toast_message.dart @@ -19,8 +19,8 @@ class ToastMessage { }); RoundedIcon icon(BuildContext context) { - final themeColors = AppKitModalTheme.colorsOf(context); - final radiuses = AppKitModalTheme.radiusesOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); + final radiuses = ReownAppKitModalTheme.radiusesOf(context); switch (type) { case ToastType.success: return RoundedIcon( diff --git a/packages/reown_appkit/lib/modal/theme/public/appkit_modal_colors.dart b/packages/reown_appkit/lib/modal/theme/public/appkit_modal_colors.dart index b31f668..4ba0c45 100644 --- a/packages/reown_appkit/lib/modal/theme/public/appkit_modal_colors.dart +++ b/packages/reown_appkit/lib/modal/theme/public/appkit_modal_colors.dart @@ -4,8 +4,8 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'appkit_modal_colors.freezed.dart'; @freezed -class AppKitModalColors with _$AppKitModalColors { - const factory AppKitModalColors({ +class ReownAppKitModalColors with _$ReownAppKitModalColors { + const factory ReownAppKitModalColors({ required Color accent100, required Color accent090, required Color accent080, @@ -44,7 +44,7 @@ class AppKitModalColors with _$AppKitModalColors { required Color yellow100, }) = _AppKitModalColors; - static const darkMode = AppKitModalColors( + static const darkMode = ReownAppKitModalColors( accent100: Color(0xFF667DFF), accent090: Color(0xFF7388FD), accent080: Color(0xFF7F92FA), @@ -83,7 +83,7 @@ class AppKitModalColors with _$AppKitModalColors { yellow100: Color(0xFFFAFF00), ); - static const lightMode = AppKitModalColors( + static const lightMode = ReownAppKitModalColors( accent100: Color(0xFF5570FF), accent090: Color(0xFF4F67E7), accent080: Color(0xFF485ED0), @@ -123,7 +123,7 @@ class AppKitModalColors with _$AppKitModalColors { ); } -extension AppKitColorsExtension on AppKitModalColors { +extension AppKitColorsExtension on ReownAppKitModalColors { Color get accenGlass090 => accent100.withOpacity(0.9); Color get accenGlass080 => accent100.withOpacity(0.8); Color get accenGlass020 => accent100.withOpacity(0.2); diff --git a/packages/reown_appkit/lib/modal/theme/public/appkit_modal_colors.freezed.dart b/packages/reown_appkit/lib/modal/theme/public/appkit_modal_colors.freezed.dart index cf007bc..1bdca02 100644 --- a/packages/reown_appkit/lib/modal/theme/public/appkit_modal_colors.freezed.dart +++ b/packages/reown_appkit/lib/modal/theme/public/appkit_modal_colors.freezed.dart @@ -15,7 +15,7 @@ final _privateConstructorUsedError = UnsupportedError( 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc -mixin _$AppKitModalColors { +mixin _$ReownAppKitModalColors { Color get accent100 => throw _privateConstructorUsedError; Color get accent090 => throw _privateConstructorUsedError; Color get accent080 => throw _privateConstructorUsedError; // @@ -50,15 +50,15 @@ mixin _$AppKitModalColors { Color get yellow100 => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $AppKitModalColorsCopyWith get copyWith => + $ReownAppKitModalColorsCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $AppKitModalColorsCopyWith<$Res> { - factory $AppKitModalColorsCopyWith( - AppKitModalColors value, $Res Function(AppKitModalColors) then) = - _$AppKitModalColorsCopyWithImpl<$Res, AppKitModalColors>; +abstract class $ReownAppKitModalColorsCopyWith<$Res> { + factory $ReownAppKitModalColorsCopyWith(ReownAppKitModalColors value, + $Res Function(ReownAppKitModalColors) then) = + _$ReownAppKitModalColorsCopyWithImpl<$Res, ReownAppKitModalColors>; @useResult $Res call( {Color accent100, @@ -96,9 +96,10 @@ abstract class $AppKitModalColorsCopyWith<$Res> { } /// @nodoc -class _$AppKitModalColorsCopyWithImpl<$Res, $Val extends AppKitModalColors> - implements $AppKitModalColorsCopyWith<$Res> { - _$AppKitModalColorsCopyWithImpl(this._value, this._then); +class _$ReownAppKitModalColorsCopyWithImpl<$Res, + $Val extends ReownAppKitModalColors> + implements $ReownAppKitModalColorsCopyWith<$Res> { + _$ReownAppKitModalColorsCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; @@ -276,7 +277,7 @@ class _$AppKitModalColorsCopyWithImpl<$Res, $Val extends AppKitModalColors> /// @nodoc abstract class _$$AppKitModalColorsImplCopyWith<$Res> - implements $AppKitModalColorsCopyWith<$Res> { + implements $ReownAppKitModalColorsCopyWith<$Res> { factory _$$AppKitModalColorsImplCopyWith(_$AppKitModalColorsImpl value, $Res Function(_$AppKitModalColorsImpl) then) = __$$AppKitModalColorsImplCopyWithImpl<$Res>; @@ -319,7 +320,7 @@ abstract class _$$AppKitModalColorsImplCopyWith<$Res> /// @nodoc class __$$AppKitModalColorsImplCopyWithImpl<$Res> - extends _$AppKitModalColorsCopyWithImpl<$Res, _$AppKitModalColorsImpl> + extends _$ReownAppKitModalColorsCopyWithImpl<$Res, _$AppKitModalColorsImpl> implements _$$AppKitModalColorsImplCopyWith<$Res> { __$$AppKitModalColorsImplCopyWithImpl(_$AppKitModalColorsImpl _value, $Res Function(_$AppKitModalColorsImpl) _then) @@ -602,7 +603,7 @@ class _$AppKitModalColorsImpl implements _AppKitModalColors { @override String toString() { - return 'AppKitModalColors(accent100: $accent100, accent090: $accent090, accent080: $accent080, grayGlass100: $grayGlass100, foreground100: $foreground100, foreground125: $foreground125, foreground150: $foreground150, foreground175: $foreground175, foreground200: $foreground200, foreground225: $foreground225, foreground250: $foreground250, foreground275: $foreground275, foreground300: $foreground300, background100: $background100, background125: $background125, background150: $background150, background175: $background175, background200: $background200, background225: $background225, background250: $background250, background275: $background275, background300: $background300, inverse100: $inverse100, inverse000: $inverse000, success100: $success100, error100: $error100, teal100: $teal100, magenta100: $magenta100, indigo100: $indigo100, orange100: $orange100, purple100: $purple100, yellow100: $yellow100)'; + return 'ReownAppKitModalColors(accent100: $accent100, accent090: $accent090, accent080: $accent080, grayGlass100: $grayGlass100, foreground100: $foreground100, foreground125: $foreground125, foreground150: $foreground150, foreground175: $foreground175, foreground200: $foreground200, foreground225: $foreground225, foreground250: $foreground250, foreground275: $foreground275, foreground300: $foreground300, background100: $background100, background125: $background125, background150: $background150, background175: $background175, background200: $background200, background225: $background225, background250: $background250, background275: $background275, background300: $background300, inverse100: $inverse100, inverse000: $inverse000, success100: $success100, error100: $error100, teal100: $teal100, magenta100: $magenta100, indigo100: $indigo100, orange100: $orange100, purple100: $purple100, yellow100: $yellow100)'; } @override @@ -720,7 +721,7 @@ class _$AppKitModalColorsImpl implements _AppKitModalColors { this, _$identity); } -abstract class _AppKitModalColors implements AppKitModalColors { +abstract class _AppKitModalColors implements ReownAppKitModalColors { const factory _AppKitModalColors( {required final Color accent100, required final Color accent090, diff --git a/packages/reown_appkit/lib/modal/theme/public/appkit_modal_radiuses.dart b/packages/reown_appkit/lib/modal/theme/public/appkit_modal_radiuses.dart index 8d999ab..b0c44c1 100644 --- a/packages/reown_appkit/lib/modal/theme/public/appkit_modal_radiuses.dart +++ b/packages/reown_appkit/lib/modal/theme/public/appkit_modal_radiuses.dart @@ -3,8 +3,8 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'appkit_modal_radiuses.freezed.dart'; @freezed -class AppKitModalRadiuses with _$AppKitModalRadiuses { - const factory AppKitModalRadiuses({ +class ReownAppKitModalRadiuses with _$ReownAppKitModalRadiuses { + const factory ReownAppKitModalRadiuses({ @Default(6.0) double radius4XS, @Default(8.0) double radius3XS, @Default(12.0) double radius2XS, @@ -13,9 +13,9 @@ class AppKitModalRadiuses with _$AppKitModalRadiuses { @Default(28.0) double radiusM, @Default(36.0) double radiusL, @Default(80.0) double radius3XL, - }) = _AppKitModalRadiuses; + }) = _ReownAppKitModalRadiuses; - static const square = AppKitModalRadiuses( + static const square = ReownAppKitModalRadiuses( radius4XS: 0.0, radius3XS: 0.0, radius2XS: 0.0, @@ -26,7 +26,7 @@ class AppKitModalRadiuses with _$AppKitModalRadiuses { radius3XL: 0.0, ); - static const circular = AppKitModalRadiuses( + static const circular = ReownAppKitModalRadiuses( radius4XS: 100.0, radius3XS: 100.0, radius2XS: 100.0, @@ -38,7 +38,7 @@ class AppKitModalRadiuses with _$AppKitModalRadiuses { ); } -extension AppKitModalRadiusesExtension on AppKitModalRadiuses { +extension ReownAppKitModalRadiusesExtension on ReownAppKitModalRadiuses { bool isSquare() { return radius4XS == 0.0 && radius3XS == 0.0 && diff --git a/packages/reown_appkit/lib/modal/theme/public/appkit_modal_radiuses.freezed.dart b/packages/reown_appkit/lib/modal/theme/public/appkit_modal_radiuses.freezed.dart index a8620aa..ab06883 100644 --- a/packages/reown_appkit/lib/modal/theme/public/appkit_modal_radiuses.freezed.dart +++ b/packages/reown_appkit/lib/modal/theme/public/appkit_modal_radiuses.freezed.dart @@ -15,7 +15,7 @@ final _privateConstructorUsedError = UnsupportedError( 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc -mixin _$AppKitModalRadiuses { +mixin _$ReownAppKitModalRadiuses { double get radius4XS => throw _privateConstructorUsedError; double get radius3XS => throw _privateConstructorUsedError; double get radius2XS => throw _privateConstructorUsedError; @@ -26,15 +26,15 @@ mixin _$AppKitModalRadiuses { double get radius3XL => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $AppKitModalRadiusesCopyWith get copyWith => + $ReownAppKitModalRadiusesCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $AppKitModalRadiusesCopyWith<$Res> { - factory $AppKitModalRadiusesCopyWith( - AppKitModalRadiuses value, $Res Function(AppKitModalRadiuses) then) = - _$AppKitModalRadiusesCopyWithImpl<$Res, AppKitModalRadiuses>; +abstract class $ReownAppKitModalRadiusesCopyWith<$Res> { + factory $ReownAppKitModalRadiusesCopyWith(ReownAppKitModalRadiuses value, + $Res Function(ReownAppKitModalRadiuses) then) = + _$ReownAppKitModalRadiusesCopyWithImpl<$Res, ReownAppKitModalRadiuses>; @useResult $Res call( {double radius4XS, @@ -48,9 +48,10 @@ abstract class $AppKitModalRadiusesCopyWith<$Res> { } /// @nodoc -class _$AppKitModalRadiusesCopyWithImpl<$Res, $Val extends AppKitModalRadiuses> - implements $AppKitModalRadiusesCopyWith<$Res> { - _$AppKitModalRadiusesCopyWithImpl(this._value, this._then); +class _$ReownAppKitModalRadiusesCopyWithImpl<$Res, + $Val extends ReownAppKitModalRadiuses> + implements $ReownAppKitModalRadiusesCopyWith<$Res> { + _$ReownAppKitModalRadiusesCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; @@ -107,11 +108,12 @@ class _$AppKitModalRadiusesCopyWithImpl<$Res, $Val extends AppKitModalRadiuses> } /// @nodoc -abstract class _$$AppKitModalRadiusesImplCopyWith<$Res> - implements $AppKitModalRadiusesCopyWith<$Res> { - factory _$$AppKitModalRadiusesImplCopyWith(_$AppKitModalRadiusesImpl value, - $Res Function(_$AppKitModalRadiusesImpl) then) = - __$$AppKitModalRadiusesImplCopyWithImpl<$Res>; +abstract class _$$ReownAppKitModalRadiusesImplCopyWith<$Res> + implements $ReownAppKitModalRadiusesCopyWith<$Res> { + factory _$$ReownAppKitModalRadiusesImplCopyWith( + _$ReownAppKitModalRadiusesImpl value, + $Res Function(_$ReownAppKitModalRadiusesImpl) then) = + __$$ReownAppKitModalRadiusesImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -126,11 +128,13 @@ abstract class _$$AppKitModalRadiusesImplCopyWith<$Res> } /// @nodoc -class __$$AppKitModalRadiusesImplCopyWithImpl<$Res> - extends _$AppKitModalRadiusesCopyWithImpl<$Res, _$AppKitModalRadiusesImpl> - implements _$$AppKitModalRadiusesImplCopyWith<$Res> { - __$$AppKitModalRadiusesImplCopyWithImpl(_$AppKitModalRadiusesImpl _value, - $Res Function(_$AppKitModalRadiusesImpl) _then) +class __$$ReownAppKitModalRadiusesImplCopyWithImpl<$Res> + extends _$ReownAppKitModalRadiusesCopyWithImpl<$Res, + _$ReownAppKitModalRadiusesImpl> + implements _$$ReownAppKitModalRadiusesImplCopyWith<$Res> { + __$$ReownAppKitModalRadiusesImplCopyWithImpl( + _$ReownAppKitModalRadiusesImpl _value, + $Res Function(_$ReownAppKitModalRadiusesImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -145,7 +149,7 @@ class __$$AppKitModalRadiusesImplCopyWithImpl<$Res> Object? radiusL = null, Object? radius3XL = null, }) { - return _then(_$AppKitModalRadiusesImpl( + return _then(_$ReownAppKitModalRadiusesImpl( radius4XS: null == radius4XS ? _value.radius4XS : radius4XS // ignore: cast_nullable_to_non_nullable @@ -184,8 +188,8 @@ class __$$AppKitModalRadiusesImplCopyWithImpl<$Res> /// @nodoc -class _$AppKitModalRadiusesImpl implements _AppKitModalRadiuses { - const _$AppKitModalRadiusesImpl( +class _$ReownAppKitModalRadiusesImpl implements _ReownAppKitModalRadiuses { + const _$ReownAppKitModalRadiusesImpl( {this.radius4XS = 6.0, this.radius3XS = 8.0, this.radius2XS = 12.0, @@ -222,14 +226,14 @@ class _$AppKitModalRadiusesImpl implements _AppKitModalRadiuses { @override String toString() { - return 'AppKitModalRadiuses(radius4XS: $radius4XS, radius3XS: $radius3XS, radius2XS: $radius2XS, radiusXS: $radiusXS, radiusS: $radiusS, radiusM: $radiusM, radiusL: $radiusL, radius3XL: $radius3XL)'; + return 'ReownAppKitModalRadiuses(radius4XS: $radius4XS, radius3XS: $radius3XS, radius2XS: $radius2XS, radiusXS: $radiusXS, radiusS: $radiusS, radiusM: $radiusM, radiusL: $radiusL, radius3XL: $radius3XL)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$AppKitModalRadiusesImpl && + other is _$ReownAppKitModalRadiusesImpl && (identical(other.radius4XS, radius4XS) || other.radius4XS == radius4XS) && (identical(other.radius3XS, radius3XS) || @@ -252,13 +256,13 @@ class _$AppKitModalRadiusesImpl implements _AppKitModalRadiuses { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$AppKitModalRadiusesImplCopyWith<_$AppKitModalRadiusesImpl> get copyWith => - __$$AppKitModalRadiusesImplCopyWithImpl<_$AppKitModalRadiusesImpl>( - this, _$identity); + _$$ReownAppKitModalRadiusesImplCopyWith<_$ReownAppKitModalRadiusesImpl> + get copyWith => __$$ReownAppKitModalRadiusesImplCopyWithImpl< + _$ReownAppKitModalRadiusesImpl>(this, _$identity); } -abstract class _AppKitModalRadiuses implements AppKitModalRadiuses { - const factory _AppKitModalRadiuses( +abstract class _ReownAppKitModalRadiuses implements ReownAppKitModalRadiuses { + const factory _ReownAppKitModalRadiuses( {final double radius4XS, final double radius3XS, final double radius2XS, @@ -266,7 +270,7 @@ abstract class _AppKitModalRadiuses implements AppKitModalRadiuses { final double radiusS, final double radiusM, final double radiusL, - final double radius3XL}) = _$AppKitModalRadiusesImpl; + final double radius3XL}) = _$ReownAppKitModalRadiusesImpl; @override double get radius4XS; @@ -286,6 +290,6 @@ abstract class _AppKitModalRadiuses implements AppKitModalRadiuses { double get radius3XL; @override @JsonKey(ignore: true) - _$$AppKitModalRadiusesImplCopyWith<_$AppKitModalRadiusesImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ReownAppKitModalRadiusesImplCopyWith<_$ReownAppKitModalRadiusesImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/packages/reown_appkit/lib/modal/theme/public/appkit_modal_text_styles.dart b/packages/reown_appkit/lib/modal/theme/public/appkit_modal_text_styles.dart index d678df1..66cb612 100644 --- a/packages/reown_appkit/lib/modal/theme/public/appkit_modal_text_styles.dart +++ b/packages/reown_appkit/lib/modal/theme/public/appkit_modal_text_styles.dart @@ -4,8 +4,8 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'appkit_modal_text_styles.freezed.dart'; @freezed -class AppKitModalTextStyles with _$AppKitModalTextStyles { - const factory AppKitModalTextStyles({ +class ReownAppKitModalTextStyles with _$ReownAppKitModalTextStyles { + const factory ReownAppKitModalTextStyles({ required String fontFamily, required TextStyle title400, required TextStyle title500, @@ -24,11 +24,11 @@ class AppKitModalTextStyles with _$AppKitModalTextStyles { required TextStyle tiny600, required TextStyle micro600, required TextStyle micro700, - }) = _AppKitModalTextStyles; + }) = _ReownAppKitModalTextStyles; static const _ff = '.SF Pro Text'; - static const textStyle = AppKitModalTextStyles( + static const textStyle = ReownAppKitModalTextStyles( fontFamily: _ff, title400: TextStyle( fontFamily: _ff, diff --git a/packages/reown_appkit/lib/modal/theme/public/appkit_modal_text_styles.freezed.dart b/packages/reown_appkit/lib/modal/theme/public/appkit_modal_text_styles.freezed.dart index 96f2a05..fff05e3 100644 --- a/packages/reown_appkit/lib/modal/theme/public/appkit_modal_text_styles.freezed.dart +++ b/packages/reown_appkit/lib/modal/theme/public/appkit_modal_text_styles.freezed.dart @@ -15,7 +15,7 @@ final _privateConstructorUsedError = UnsupportedError( 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc -mixin _$AppKitModalTextStyles { +mixin _$ReownAppKitModalTextStyles { String get fontFamily => throw _privateConstructorUsedError; TextStyle get title400 => throw _privateConstructorUsedError; TextStyle get title500 => throw _privateConstructorUsedError; @@ -36,15 +36,16 @@ mixin _$AppKitModalTextStyles { TextStyle get micro700 => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $AppKitModalTextStylesCopyWith get copyWith => - throw _privateConstructorUsedError; + $ReownAppKitModalTextStylesCopyWith + get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $AppKitModalTextStylesCopyWith<$Res> { - factory $AppKitModalTextStylesCopyWith(AppKitModalTextStyles value, - $Res Function(AppKitModalTextStyles) then) = - _$AppKitModalTextStylesCopyWithImpl<$Res, AppKitModalTextStyles>; +abstract class $ReownAppKitModalTextStylesCopyWith<$Res> { + factory $ReownAppKitModalTextStylesCopyWith(ReownAppKitModalTextStyles value, + $Res Function(ReownAppKitModalTextStyles) then) = + _$ReownAppKitModalTextStylesCopyWithImpl<$Res, + ReownAppKitModalTextStyles>; @useResult $Res call( {String fontFamily, @@ -68,10 +69,10 @@ abstract class $AppKitModalTextStylesCopyWith<$Res> { } /// @nodoc -class _$AppKitModalTextStylesCopyWithImpl<$Res, - $Val extends AppKitModalTextStyles> - implements $AppKitModalTextStylesCopyWith<$Res> { - _$AppKitModalTextStylesCopyWithImpl(this._value, this._then); +class _$ReownAppKitModalTextStylesCopyWithImpl<$Res, + $Val extends ReownAppKitModalTextStyles> + implements $ReownAppKitModalTextStylesCopyWith<$Res> { + _$ReownAppKitModalTextStylesCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; @@ -178,12 +179,12 @@ class _$AppKitModalTextStylesCopyWithImpl<$Res, } /// @nodoc -abstract class _$$AppKitModalTextStylesImplCopyWith<$Res> - implements $AppKitModalTextStylesCopyWith<$Res> { - factory _$$AppKitModalTextStylesImplCopyWith( - _$AppKitModalTextStylesImpl value, - $Res Function(_$AppKitModalTextStylesImpl) then) = - __$$AppKitModalTextStylesImplCopyWithImpl<$Res>; +abstract class _$$ReownAppKitModalTextStylesImplCopyWith<$Res> + implements $ReownAppKitModalTextStylesCopyWith<$Res> { + factory _$$ReownAppKitModalTextStylesImplCopyWith( + _$ReownAppKitModalTextStylesImpl value, + $Res Function(_$ReownAppKitModalTextStylesImpl) then) = + __$$ReownAppKitModalTextStylesImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -208,12 +209,13 @@ abstract class _$$AppKitModalTextStylesImplCopyWith<$Res> } /// @nodoc -class __$$AppKitModalTextStylesImplCopyWithImpl<$Res> - extends _$AppKitModalTextStylesCopyWithImpl<$Res, - _$AppKitModalTextStylesImpl> - implements _$$AppKitModalTextStylesImplCopyWith<$Res> { - __$$AppKitModalTextStylesImplCopyWithImpl(_$AppKitModalTextStylesImpl _value, - $Res Function(_$AppKitModalTextStylesImpl) _then) +class __$$ReownAppKitModalTextStylesImplCopyWithImpl<$Res> + extends _$ReownAppKitModalTextStylesCopyWithImpl<$Res, + _$ReownAppKitModalTextStylesImpl> + implements _$$ReownAppKitModalTextStylesImplCopyWith<$Res> { + __$$ReownAppKitModalTextStylesImplCopyWithImpl( + _$ReownAppKitModalTextStylesImpl _value, + $Res Function(_$ReownAppKitModalTextStylesImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -238,7 +240,7 @@ class __$$AppKitModalTextStylesImplCopyWithImpl<$Res> Object? micro600 = null, Object? micro700 = null, }) { - return _then(_$AppKitModalTextStylesImpl( + return _then(_$ReownAppKitModalTextStylesImpl( fontFamily: null == fontFamily ? _value.fontFamily : fontFamily // ignore: cast_nullable_to_non_nullable @@ -317,8 +319,8 @@ class __$$AppKitModalTextStylesImplCopyWithImpl<$Res> /// @nodoc -class _$AppKitModalTextStylesImpl implements _AppKitModalTextStyles { - const _$AppKitModalTextStylesImpl( +class _$ReownAppKitModalTextStylesImpl implements _ReownAppKitModalTextStyles { + const _$ReownAppKitModalTextStylesImpl( {required this.fontFamily, required this.title400, required this.title500, @@ -377,14 +379,14 @@ class _$AppKitModalTextStylesImpl implements _AppKitModalTextStyles { @override String toString() { - return 'AppKitModalTextStyles(fontFamily: $fontFamily, title400: $title400, title500: $title500, title600: $title600, large400: $large400, large500: $large500, large600: $large600, paragraph400: $paragraph400, paragraph500: $paragraph500, paragraph600: $paragraph600, small400: $small400, small500: $small500, small600: $small600, tiny400: $tiny400, tiny500: $tiny500, tiny600: $tiny600, micro600: $micro600, micro700: $micro700)'; + return 'ReownAppKitModalTextStyles(fontFamily: $fontFamily, title400: $title400, title500: $title500, title600: $title600, large400: $large400, large500: $large500, large600: $large600, paragraph400: $paragraph400, paragraph500: $paragraph500, paragraph600: $paragraph600, small400: $small400, small500: $small500, small600: $small600, tiny400: $tiny400, tiny500: $tiny500, tiny600: $tiny600, micro600: $micro600, micro700: $micro700)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$AppKitModalTextStylesImpl && + other is _$ReownAppKitModalTextStylesImpl && (identical(other.fontFamily, fontFamily) || other.fontFamily == fontFamily) && (identical(other.title400, title400) || @@ -445,13 +447,14 @@ class _$AppKitModalTextStylesImpl implements _AppKitModalTextStyles { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$AppKitModalTextStylesImplCopyWith<_$AppKitModalTextStylesImpl> - get copyWith => __$$AppKitModalTextStylesImplCopyWithImpl< - _$AppKitModalTextStylesImpl>(this, _$identity); + _$$ReownAppKitModalTextStylesImplCopyWith<_$ReownAppKitModalTextStylesImpl> + get copyWith => __$$ReownAppKitModalTextStylesImplCopyWithImpl< + _$ReownAppKitModalTextStylesImpl>(this, _$identity); } -abstract class _AppKitModalTextStyles implements AppKitModalTextStyles { - const factory _AppKitModalTextStyles( +abstract class _ReownAppKitModalTextStyles + implements ReownAppKitModalTextStyles { + const factory _ReownAppKitModalTextStyles( {required final String fontFamily, required final TextStyle title400, required final TextStyle title500, @@ -469,7 +472,7 @@ abstract class _AppKitModalTextStyles implements AppKitModalTextStyles { required final TextStyle tiny500, required final TextStyle tiny600, required final TextStyle micro600, - required final TextStyle micro700}) = _$AppKitModalTextStylesImpl; + required final TextStyle micro700}) = _$ReownAppKitModalTextStylesImpl; @override String get fontFamily; @@ -509,6 +512,6 @@ abstract class _AppKitModalTextStyles implements AppKitModalTextStyles { TextStyle get micro700; @override @JsonKey(ignore: true) - _$$AppKitModalTextStylesImplCopyWith<_$AppKitModalTextStylesImpl> + _$$ReownAppKitModalTextStylesImplCopyWith<_$ReownAppKitModalTextStylesImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/packages/reown_appkit/lib/modal/theme/public/appkit_modal_theme_data.dart b/packages/reown_appkit/lib/modal/theme/public/appkit_modal_theme_data.dart index aece6b9..b9a21f4 100644 --- a/packages/reown_appkit/lib/modal/theme/public/appkit_modal_theme_data.dart +++ b/packages/reown_appkit/lib/modal/theme/public/appkit_modal_theme_data.dart @@ -6,11 +6,13 @@ import 'package:reown_appkit/modal/theme/public/appkit_modal_text_styles.dart'; part 'appkit_modal_theme_data.freezed.dart'; @freezed -class AppKitModalThemeData with _$AppKitModalThemeData { - const factory AppKitModalThemeData({ - @Default(AppKitModalColors.lightMode) AppKitModalColors lightColors, - @Default(AppKitModalColors.darkMode) AppKitModalColors darkColors, - @Default(AppKitModalTextStyles.textStyle) AppKitModalTextStyles textStyles, - @Default(AppKitModalRadiuses()) AppKitModalRadiuses radiuses, - }) = _AppKitModalThemeData; +class ReownAppKitModalThemeData with _$ReownAppKitModalThemeData { + const factory ReownAppKitModalThemeData({ + @Default(ReownAppKitModalColors.lightMode) + ReownAppKitModalColors lightColors, + @Default(ReownAppKitModalColors.darkMode) ReownAppKitModalColors darkColors, + @Default(ReownAppKitModalTextStyles.textStyle) + ReownAppKitModalTextStyles textStyles, + @Default(ReownAppKitModalRadiuses()) ReownAppKitModalRadiuses radiuses, + }) = _ReownAppKitModalThemeData; } diff --git a/packages/reown_appkit/lib/modal/theme/public/appkit_modal_theme_data.freezed.dart b/packages/reown_appkit/lib/modal/theme/public/appkit_modal_theme_data.freezed.dart index 6c39a05..650c244 100644 --- a/packages/reown_appkit/lib/modal/theme/public/appkit_modal_theme_data.freezed.dart +++ b/packages/reown_appkit/lib/modal/theme/public/appkit_modal_theme_data.freezed.dart @@ -15,40 +15,41 @@ final _privateConstructorUsedError = UnsupportedError( 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc -mixin _$AppKitModalThemeData { - AppKitModalColors get lightColors => throw _privateConstructorUsedError; - AppKitModalColors get darkColors => throw _privateConstructorUsedError; - AppKitModalTextStyles get textStyles => throw _privateConstructorUsedError; - AppKitModalRadiuses get radiuses => throw _privateConstructorUsedError; +mixin _$ReownAppKitModalThemeData { + ReownAppKitModalColors get lightColors => throw _privateConstructorUsedError; + ReownAppKitModalColors get darkColors => throw _privateConstructorUsedError; + ReownAppKitModalTextStyles get textStyles => + throw _privateConstructorUsedError; + ReownAppKitModalRadiuses get radiuses => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $AppKitModalThemeDataCopyWith get copyWith => + $ReownAppKitModalThemeDataCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $AppKitModalThemeDataCopyWith<$Res> { - factory $AppKitModalThemeDataCopyWith(AppKitModalThemeData value, - $Res Function(AppKitModalThemeData) then) = - _$AppKitModalThemeDataCopyWithImpl<$Res, AppKitModalThemeData>; +abstract class $ReownAppKitModalThemeDataCopyWith<$Res> { + factory $ReownAppKitModalThemeDataCopyWith(ReownAppKitModalThemeData value, + $Res Function(ReownAppKitModalThemeData) then) = + _$ReownAppKitModalThemeDataCopyWithImpl<$Res, ReownAppKitModalThemeData>; @useResult $Res call( - {AppKitModalColors lightColors, - AppKitModalColors darkColors, - AppKitModalTextStyles textStyles, - AppKitModalRadiuses radiuses}); - - $AppKitModalColorsCopyWith<$Res> get lightColors; - $AppKitModalColorsCopyWith<$Res> get darkColors; - $AppKitModalTextStylesCopyWith<$Res> get textStyles; - $AppKitModalRadiusesCopyWith<$Res> get radiuses; + {ReownAppKitModalColors lightColors, + ReownAppKitModalColors darkColors, + ReownAppKitModalTextStyles textStyles, + ReownAppKitModalRadiuses radiuses}); + + $ReownAppKitModalColorsCopyWith<$Res> get lightColors; + $ReownAppKitModalColorsCopyWith<$Res> get darkColors; + $ReownAppKitModalTextStylesCopyWith<$Res> get textStyles; + $ReownAppKitModalRadiusesCopyWith<$Res> get radiuses; } /// @nodoc -class _$AppKitModalThemeDataCopyWithImpl<$Res, - $Val extends AppKitModalThemeData> - implements $AppKitModalThemeDataCopyWith<$Res> { - _$AppKitModalThemeDataCopyWithImpl(this._value, this._then); +class _$ReownAppKitModalThemeDataCopyWithImpl<$Res, + $Val extends ReownAppKitModalThemeData> + implements $ReownAppKitModalThemeDataCopyWith<$Res> { + _$ReownAppKitModalThemeDataCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; @@ -67,85 +68,89 @@ class _$AppKitModalThemeDataCopyWithImpl<$Res, lightColors: null == lightColors ? _value.lightColors : lightColors // ignore: cast_nullable_to_non_nullable - as AppKitModalColors, + as ReownAppKitModalColors, darkColors: null == darkColors ? _value.darkColors : darkColors // ignore: cast_nullable_to_non_nullable - as AppKitModalColors, + as ReownAppKitModalColors, textStyles: null == textStyles ? _value.textStyles : textStyles // ignore: cast_nullable_to_non_nullable - as AppKitModalTextStyles, + as ReownAppKitModalTextStyles, radiuses: null == radiuses ? _value.radiuses : radiuses // ignore: cast_nullable_to_non_nullable - as AppKitModalRadiuses, + as ReownAppKitModalRadiuses, ) as $Val); } @override @pragma('vm:prefer-inline') - $AppKitModalColorsCopyWith<$Res> get lightColors { - return $AppKitModalColorsCopyWith<$Res>(_value.lightColors, (value) { + $ReownAppKitModalColorsCopyWith<$Res> get lightColors { + return $ReownAppKitModalColorsCopyWith<$Res>(_value.lightColors, (value) { return _then(_value.copyWith(lightColors: value) as $Val); }); } @override @pragma('vm:prefer-inline') - $AppKitModalColorsCopyWith<$Res> get darkColors { - return $AppKitModalColorsCopyWith<$Res>(_value.darkColors, (value) { + $ReownAppKitModalColorsCopyWith<$Res> get darkColors { + return $ReownAppKitModalColorsCopyWith<$Res>(_value.darkColors, (value) { return _then(_value.copyWith(darkColors: value) as $Val); }); } @override @pragma('vm:prefer-inline') - $AppKitModalTextStylesCopyWith<$Res> get textStyles { - return $AppKitModalTextStylesCopyWith<$Res>(_value.textStyles, (value) { + $ReownAppKitModalTextStylesCopyWith<$Res> get textStyles { + return $ReownAppKitModalTextStylesCopyWith<$Res>(_value.textStyles, + (value) { return _then(_value.copyWith(textStyles: value) as $Val); }); } @override @pragma('vm:prefer-inline') - $AppKitModalRadiusesCopyWith<$Res> get radiuses { - return $AppKitModalRadiusesCopyWith<$Res>(_value.radiuses, (value) { + $ReownAppKitModalRadiusesCopyWith<$Res> get radiuses { + return $ReownAppKitModalRadiusesCopyWith<$Res>(_value.radiuses, (value) { return _then(_value.copyWith(radiuses: value) as $Val); }); } } /// @nodoc -abstract class _$$AppKitModalThemeDataImplCopyWith<$Res> - implements $AppKitModalThemeDataCopyWith<$Res> { - factory _$$AppKitModalThemeDataImplCopyWith(_$AppKitModalThemeDataImpl value, - $Res Function(_$AppKitModalThemeDataImpl) then) = - __$$AppKitModalThemeDataImplCopyWithImpl<$Res>; +abstract class _$$ReownAppKitModalThemeDataImplCopyWith<$Res> + implements $ReownAppKitModalThemeDataCopyWith<$Res> { + factory _$$ReownAppKitModalThemeDataImplCopyWith( + _$ReownAppKitModalThemeDataImpl value, + $Res Function(_$ReownAppKitModalThemeDataImpl) then) = + __$$ReownAppKitModalThemeDataImplCopyWithImpl<$Res>; @override @useResult $Res call( - {AppKitModalColors lightColors, - AppKitModalColors darkColors, - AppKitModalTextStyles textStyles, - AppKitModalRadiuses radiuses}); + {ReownAppKitModalColors lightColors, + ReownAppKitModalColors darkColors, + ReownAppKitModalTextStyles textStyles, + ReownAppKitModalRadiuses radiuses}); @override - $AppKitModalColorsCopyWith<$Res> get lightColors; + $ReownAppKitModalColorsCopyWith<$Res> get lightColors; @override - $AppKitModalColorsCopyWith<$Res> get darkColors; + $ReownAppKitModalColorsCopyWith<$Res> get darkColors; @override - $AppKitModalTextStylesCopyWith<$Res> get textStyles; + $ReownAppKitModalTextStylesCopyWith<$Res> get textStyles; @override - $AppKitModalRadiusesCopyWith<$Res> get radiuses; + $ReownAppKitModalRadiusesCopyWith<$Res> get radiuses; } /// @nodoc -class __$$AppKitModalThemeDataImplCopyWithImpl<$Res> - extends _$AppKitModalThemeDataCopyWithImpl<$Res, _$AppKitModalThemeDataImpl> - implements _$$AppKitModalThemeDataImplCopyWith<$Res> { - __$$AppKitModalThemeDataImplCopyWithImpl(_$AppKitModalThemeDataImpl _value, - $Res Function(_$AppKitModalThemeDataImpl) _then) +class __$$ReownAppKitModalThemeDataImplCopyWithImpl<$Res> + extends _$ReownAppKitModalThemeDataCopyWithImpl<$Res, + _$ReownAppKitModalThemeDataImpl> + implements _$$ReownAppKitModalThemeDataImplCopyWith<$Res> { + __$$ReownAppKitModalThemeDataImplCopyWithImpl( + _$ReownAppKitModalThemeDataImpl _value, + $Res Function(_$ReownAppKitModalThemeDataImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -156,59 +161,59 @@ class __$$AppKitModalThemeDataImplCopyWithImpl<$Res> Object? textStyles = null, Object? radiuses = null, }) { - return _then(_$AppKitModalThemeDataImpl( + return _then(_$ReownAppKitModalThemeDataImpl( lightColors: null == lightColors ? _value.lightColors : lightColors // ignore: cast_nullable_to_non_nullable - as AppKitModalColors, + as ReownAppKitModalColors, darkColors: null == darkColors ? _value.darkColors : darkColors // ignore: cast_nullable_to_non_nullable - as AppKitModalColors, + as ReownAppKitModalColors, textStyles: null == textStyles ? _value.textStyles : textStyles // ignore: cast_nullable_to_non_nullable - as AppKitModalTextStyles, + as ReownAppKitModalTextStyles, radiuses: null == radiuses ? _value.radiuses : radiuses // ignore: cast_nullable_to_non_nullable - as AppKitModalRadiuses, + as ReownAppKitModalRadiuses, )); } } /// @nodoc -class _$AppKitModalThemeDataImpl implements _AppKitModalThemeData { - const _$AppKitModalThemeDataImpl( - {this.lightColors = AppKitModalColors.lightMode, - this.darkColors = AppKitModalColors.darkMode, - this.textStyles = AppKitModalTextStyles.textStyle, - this.radiuses = const AppKitModalRadiuses()}); +class _$ReownAppKitModalThemeDataImpl implements _ReownAppKitModalThemeData { + const _$ReownAppKitModalThemeDataImpl( + {this.lightColors = ReownAppKitModalColors.lightMode, + this.darkColors = ReownAppKitModalColors.darkMode, + this.textStyles = ReownAppKitModalTextStyles.textStyle, + this.radiuses = const ReownAppKitModalRadiuses()}); @override @JsonKey() - final AppKitModalColors lightColors; + final ReownAppKitModalColors lightColors; @override @JsonKey() - final AppKitModalColors darkColors; + final ReownAppKitModalColors darkColors; @override @JsonKey() - final AppKitModalTextStyles textStyles; + final ReownAppKitModalTextStyles textStyles; @override @JsonKey() - final AppKitModalRadiuses radiuses; + final ReownAppKitModalRadiuses radiuses; @override String toString() { - return 'AppKitModalThemeData(lightColors: $lightColors, darkColors: $darkColors, textStyles: $textStyles, radiuses: $radiuses)'; + return 'ReownAppKitModalThemeData(lightColors: $lightColors, darkColors: $darkColors, textStyles: $textStyles, radiuses: $radiuses)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$AppKitModalThemeDataImpl && + other is _$ReownAppKitModalThemeDataImpl && (identical(other.lightColors, lightColors) || other.lightColors == lightColors) && (identical(other.darkColors, darkColors) || @@ -226,29 +231,29 @@ class _$AppKitModalThemeDataImpl implements _AppKitModalThemeData { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$AppKitModalThemeDataImplCopyWith<_$AppKitModalThemeDataImpl> - get copyWith => - __$$AppKitModalThemeDataImplCopyWithImpl<_$AppKitModalThemeDataImpl>( - this, _$identity); + _$$ReownAppKitModalThemeDataImplCopyWith<_$ReownAppKitModalThemeDataImpl> + get copyWith => __$$ReownAppKitModalThemeDataImplCopyWithImpl< + _$ReownAppKitModalThemeDataImpl>(this, _$identity); } -abstract class _AppKitModalThemeData implements AppKitModalThemeData { - const factory _AppKitModalThemeData( - {final AppKitModalColors lightColors, - final AppKitModalColors darkColors, - final AppKitModalTextStyles textStyles, - final AppKitModalRadiuses radiuses}) = _$AppKitModalThemeDataImpl; +abstract class _ReownAppKitModalThemeData implements ReownAppKitModalThemeData { + const factory _ReownAppKitModalThemeData( + {final ReownAppKitModalColors lightColors, + final ReownAppKitModalColors darkColors, + final ReownAppKitModalTextStyles textStyles, + final ReownAppKitModalRadiuses radiuses}) = + _$ReownAppKitModalThemeDataImpl; @override - AppKitModalColors get lightColors; + ReownAppKitModalColors get lightColors; @override - AppKitModalColors get darkColors; + ReownAppKitModalColors get darkColors; @override - AppKitModalTextStyles get textStyles; + ReownAppKitModalTextStyles get textStyles; @override - AppKitModalRadiuses get radiuses; + ReownAppKitModalRadiuses get radiuses; @override @JsonKey(ignore: true) - _$$AppKitModalThemeDataImplCopyWith<_$AppKitModalThemeDataImpl> + _$$ReownAppKitModalThemeDataImplCopyWith<_$ReownAppKitModalThemeDataImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/packages/reown_appkit/lib/modal/theme/public/appkit_modal_theme_widget.dart b/packages/reown_appkit/lib/modal/theme/public/appkit_modal_theme_widget.dart index ae01844..bc142e6 100644 --- a/packages/reown_appkit/lib/modal/theme/public/appkit_modal_theme_widget.dart +++ b/packages/reown_appkit/lib/modal/theme/public/appkit_modal_theme_widget.dart @@ -3,48 +3,48 @@ import 'package:reown_appkit/modal/theme/public/appkit_modal_colors.dart'; import 'package:reown_appkit/modal/theme/public/appkit_modal_radiuses.dart'; import 'package:reown_appkit/modal/theme/public/appkit_modal_theme_data.dart'; -class AppKitModalTheme extends InheritedWidget { - const AppKitModalTheme({ +class ReownAppKitModalTheme extends InheritedWidget { + const ReownAppKitModalTheme({ super.key, required super.child, this.themeData, this.isDarkMode = false, }); - final AppKitModalThemeData? themeData; + final ReownAppKitModalThemeData? themeData; final bool isDarkMode; - static AppKitModalTheme of(BuildContext context) { - final AppKitModalTheme? result = maybeOf(context); - assert(result != null, 'No AppKitModalTheme found in context'); + static ReownAppKitModalTheme of(BuildContext context) { + final ReownAppKitModalTheme? result = maybeOf(context); + assert(result != null, 'No ReownAppKitModalTheme found in context'); return result!; } static bool isCustomTheme(BuildContext context) { - final AppKitModalTheme? theme = maybeOf(context); + final ReownAppKitModalTheme? theme = maybeOf(context); return theme?.themeData != null; } - static AppKitModalTheme? maybeOf(BuildContext context) { - return context.dependOnInheritedWidgetOfExactType(); + static ReownAppKitModalTheme? maybeOf(BuildContext context) { + return context.dependOnInheritedWidgetOfExactType(); } - static AppKitModalThemeData getDataOf(BuildContext context) { - final AppKitModalTheme? theme = maybeOf(context); - return theme?.themeData ?? const AppKitModalThemeData(); + static ReownAppKitModalThemeData getDataOf(BuildContext context) { + final ReownAppKitModalTheme? theme = maybeOf(context); + return theme?.themeData ?? const ReownAppKitModalThemeData(); } - static AppKitModalColors colorsOf(BuildContext context) { - final AppKitModalTheme? theme = maybeOf(context); + static ReownAppKitModalColors colorsOf(BuildContext context) { + final ReownAppKitModalTheme? theme = maybeOf(context); if (theme?.isDarkMode == true) { - return theme?.themeData?.darkColors ?? AppKitModalColors.darkMode; + return theme?.themeData?.darkColors ?? ReownAppKitModalColors.darkMode; } - return theme?.themeData?.lightColors ?? AppKitModalColors.lightMode; + return theme?.themeData?.lightColors ?? ReownAppKitModalColors.lightMode; } - static AppKitModalRadiuses radiusesOf(BuildContext context) { - final AppKitModalTheme? theme = maybeOf(context); - return theme?.themeData?.radiuses ?? const AppKitModalRadiuses(); + static ReownAppKitModalRadiuses radiusesOf(BuildContext context) { + final ReownAppKitModalTheme? theme = maybeOf(context); + return theme?.themeData?.radiuses ?? const ReownAppKitModalRadiuses(); } @override diff --git a/packages/reown_appkit/lib/modal/utils/asset_util.dart b/packages/reown_appkit/lib/modal/utils/asset_util.dart index 31d0af7..63f7788 100644 --- a/packages/reown_appkit/lib/modal/utils/asset_util.dart +++ b/packages/reown_appkit/lib/modal/utils/asset_util.dart @@ -4,7 +4,7 @@ import 'package:reown_appkit/modal/theme/public/appkit_modal_theme.dart'; class AssetUtils { static String getThemedAsset(BuildContext context, String assetName) { - if (AppKitModalTheme.maybeOf(context)?.isDarkMode == true) { + if (ReownAppKitModalTheme.maybeOf(context)?.isDarkMode == true) { return 'lib/modal/assets/dark/$assetName'; } return 'lib/modal/assets/light/$assetName'; diff --git a/packages/reown_appkit/lib/modal/utils/public/appkit_modal_default_networks.dart b/packages/reown_appkit/lib/modal/utils/public/appkit_modal_default_networks.dart index 528889d..85df557 100644 --- a/packages/reown_appkit/lib/modal/utils/public/appkit_modal_default_networks.dart +++ b/packages/reown_appkit/lib/modal/utils/public/appkit_modal_default_networks.dart @@ -1,11 +1,11 @@ import 'package:collection/collection.dart'; import 'package:reown_appkit/modal/models/public/appkit_network_info.dart'; -class AppKitModalNetworks { +class ReownAppKitModalNetworks { // https://github.com/WalletConnect/blockchain-api/blob/master/SUPPORTED_CHAINS.md - static Map> supported = { + static Map> supported = { 'eip155': [ - AppKitModalNetworkInfo( + ReownAppKitModalNetworkInfo( name: 'Ethereum', chainId: '1', chainIcon: chainImagesId['1'], @@ -13,7 +13,7 @@ class AppKitModalNetworks { rpcUrl: 'https://ethereum-rpc.publicnode.com', explorerUrl: 'https://etherscan.io', ), - AppKitModalNetworkInfo( + ReownAppKitModalNetworkInfo( name: 'Optimism', chainId: '10', chainIcon: chainImagesId['10'], @@ -21,7 +21,7 @@ class AppKitModalNetworks { rpcUrl: 'https://mainnet.optimism.io/', explorerUrl: 'https://optimistic.etherscan.io', ), - AppKitModalNetworkInfo( + ReownAppKitModalNetworkInfo( name: 'Binance Smart Chain', chainId: '56', chainIcon: chainImagesId['56'], @@ -29,7 +29,7 @@ class AppKitModalNetworks { rpcUrl: 'https://bsc-dataseed.binance.org/', explorerUrl: 'https://bscscan.com', ), - AppKitModalNetworkInfo( + ReownAppKitModalNetworkInfo( name: 'Gnosis Chain', chainId: '100', chainIcon: chainImagesId['100'], @@ -37,7 +37,7 @@ class AppKitModalNetworks { rpcUrl: 'https://rpc.gnosischain.com', explorerUrl: 'https://gnosis.blockscout.com', ), - AppKitModalNetworkInfo( + ReownAppKitModalNetworkInfo( name: 'Polygon', chainId: '137', chainIcon: chainImagesId['137'], @@ -45,7 +45,7 @@ class AppKitModalNetworks { rpcUrl: 'https://polygon.drpc.org', explorerUrl: 'https://polygonscan.com', ), - AppKitModalNetworkInfo( + ReownAppKitModalNetworkInfo( name: 'zkSync Era', chainId: '324', chainIcon: chainImagesId['324'], @@ -53,7 +53,7 @@ class AppKitModalNetworks { rpcUrl: 'https://mainnet.era.zksync.io', explorerUrl: 'https://explorer.zksync.io', ), - AppKitModalNetworkInfo( + ReownAppKitModalNetworkInfo( name: 'Polygon zkEVM', chainId: '1101', chainIcon: chainImagesId['1101'], @@ -61,7 +61,7 @@ class AppKitModalNetworks { rpcUrl: 'https://rpc-mainnet.matic.network', explorerUrl: 'https://explorer-evm.polygon.technology', ), - AppKitModalNetworkInfo( + ReownAppKitModalNetworkInfo( name: 'Mantle', chainId: '5000', chainIcon: chainImagesId['5000'], @@ -69,7 +69,7 @@ class AppKitModalNetworks { rpcUrl: 'https://rpc.mantlenetwork.io', explorerUrl: 'https://explorer.mantlenetwork.io', ), - AppKitModalNetworkInfo( + ReownAppKitModalNetworkInfo( name: 'Klaytn Mainnet', chainId: '8217', chainIcon: chainImagesId['8217'], @@ -77,7 +77,7 @@ class AppKitModalNetworks { rpcUrl: 'https://public-node-api.klaytnapi.com/v1/cypress', explorerUrl: 'https://scope.klaytn.com', ), - AppKitModalNetworkInfo( + ReownAppKitModalNetworkInfo( name: 'Base', chainId: '8453', chainIcon: chainImagesId['8453'], @@ -85,7 +85,7 @@ class AppKitModalNetworks { rpcUrl: 'https://mainnet.base.org', explorerUrl: 'https://basescan.org', ), - AppKitModalNetworkInfo( + ReownAppKitModalNetworkInfo( name: 'Arbitrum', chainId: '42161', chainIcon: chainImagesId['42161'], @@ -93,7 +93,7 @@ class AppKitModalNetworks { rpcUrl: 'https://arbitrum.blockpi.network/v1/rpc/public', explorerUrl: 'https://arbiscan.io/', ), - AppKitModalNetworkInfo( + ReownAppKitModalNetworkInfo( name: 'Celo', chainId: '42220', chainIcon: chainImagesId['42220'], @@ -101,7 +101,7 @@ class AppKitModalNetworks { rpcUrl: 'https://forno.celo.org', explorerUrl: 'https://explorer.celo.org/mainnet', ), - AppKitModalNetworkInfo( + ReownAppKitModalNetworkInfo( name: 'Avalanche', chainId: '43114', chainIcon: chainImagesId['43114'], @@ -109,7 +109,7 @@ class AppKitModalNetworks { rpcUrl: 'https://api.avax.network/ext/bc/C/rpc', explorerUrl: 'https://snowtrace.io', ), - AppKitModalNetworkInfo( + ReownAppKitModalNetworkInfo( name: 'Linea', chainId: '59144', chainIcon: chainImagesId['59144'], @@ -117,7 +117,7 @@ class AppKitModalNetworks { rpcUrl: 'https://rpc.linea.build', explorerUrl: 'https://explorer.linea.build', ), - AppKitModalNetworkInfo( + ReownAppKitModalNetworkInfo( name: 'Zora', chainId: '7777777', chainIcon: chainImagesId['7777777'], @@ -125,7 +125,7 @@ class AppKitModalNetworks { rpcUrl: 'https://rpc.zora.energy', explorerUrl: 'https://explorer.zora.energy', ), - AppKitModalNetworkInfo( + ReownAppKitModalNetworkInfo( name: 'Aurora', chainId: '1313161554', chainIcon: chainImagesId['1313161554'], @@ -136,9 +136,9 @@ class AppKitModalNetworks { ], }; - static Map> extra = { + static Map> extra = { 'eip155': [ - AppKitModalNetworkInfo( + ReownAppKitModalNetworkInfo( name: 'Fantom', chainId: '250', chainIcon: chainImagesId['250'], @@ -146,7 +146,7 @@ class AppKitModalNetworks { rpcUrl: 'https://rpc.ftm.tools/', explorerUrl: 'https://ftmscan.com', ), - AppKitModalNetworkInfo( + ReownAppKitModalNetworkInfo( name: 'EVMos', chainId: '9001', chainIcon: chainImagesId['9001'], @@ -154,7 +154,7 @@ class AppKitModalNetworks { rpcUrl: 'https://evmos-evm.publicnode.com', explorerUrl: '', ), - AppKitModalNetworkInfo( + ReownAppKitModalNetworkInfo( name: 'Iotx', chainId: '4689', chainIcon: chainImagesId['4689'], @@ -162,7 +162,7 @@ class AppKitModalNetworks { rpcUrl: 'https://rpc.ankr.com/iotex', explorerUrl: 'https://iotexscan.io', ), - AppKitModalNetworkInfo( + ReownAppKitModalNetworkInfo( name: 'Metis', chainId: '1088', chainIcon: chainImagesId['1088'], @@ -173,9 +173,9 @@ class AppKitModalNetworks { ] }; - static Map> test = { + static Map> test = { 'eip155': [ - AppKitModalNetworkInfo( + ReownAppKitModalNetworkInfo( name: 'Sepolia', chainId: '11155111', currency: 'SEP', @@ -183,7 +183,7 @@ class AppKitModalNetworks { explorerUrl: 'https://sepolia.etherscan.io/', isTestNetwork: true, ), - AppKitModalNetworkInfo( + ReownAppKitModalNetworkInfo( name: 'Holesky', chainId: '17000', chainIcon: chainImagesId['17000'], @@ -192,7 +192,7 @@ class AppKitModalNetworks { explorerUrl: 'https://explorer.holesky.test', isTestNetwork: true, ), - AppKitModalNetworkInfo( + ReownAppKitModalNetworkInfo( name: 'Mumbai', chainId: '80001', currency: 'MATIC', @@ -205,7 +205,7 @@ class AppKitModalNetworks { explorerUrl: 'https://mumbai.polygonscan.com', isTestNetwork: true, ), - AppKitModalNetworkInfo( + ReownAppKitModalNetworkInfo( name: 'Amoy', chainId: '80002', currency: 'MATIC', @@ -266,14 +266,14 @@ class AppKitModalNetworks { '1313161554': '3ff73439-a619-4894-9262-4470c773a100', }; - static AppKitModalNetworkInfo? getNetworkById( + static ReownAppKitModalNetworkInfo? getNetworkById( String namespace, String chainId, ) { return supported[namespace]?.firstWhere((e) => e.chainId == chainId); } - static List getNetworks(String namespace) { + static List getNetworks(String namespace) { return supported[namespace] ?? []; } diff --git a/packages/reown_appkit/lib/modal/widgets/avatars/account_avatar.dart b/packages/reown_appkit/lib/modal/widgets/avatars/account_avatar.dart index f4bda0e..e48875c 100644 --- a/packages/reown_appkit/lib/modal/widgets/avatars/account_avatar.dart +++ b/packages/reown_appkit/lib/modal/widgets/avatars/account_avatar.dart @@ -13,7 +13,7 @@ class AccountAvatar extends StatefulWidget { this.disabled = false, }); - final IAppKitModal service; + final IReownAppKitModal service; final double size; final bool disabled; @@ -40,7 +40,7 @@ class _AccountAvatarState extends State { @override Widget build(BuildContext context) { - final themeColors = AppKitModalTheme.colorsOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); return SizedBox( width: widget.size, height: widget.size, @@ -86,7 +86,7 @@ class GradientOrb extends StatelessWidget { @override Widget build(BuildContext context) { List colors = RenderUtils.generateAvatarColors(address); - final themeColors = AppKitModalTheme.colorsOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); return Stack( children: [ Container( diff --git a/packages/reown_appkit/lib/modal/widgets/avatars/account_orb.dart b/packages/reown_appkit/lib/modal/widgets/avatars/account_orb.dart index 24c1218..7123f8a 100644 --- a/packages/reown_appkit/lib/modal/widgets/avatars/account_orb.dart +++ b/packages/reown_appkit/lib/modal/widgets/avatars/account_orb.dart @@ -9,7 +9,7 @@ class Orb extends StatelessWidget { @override Widget build(BuildContext context) { - final themeColors = AppKitModalTheme.colorsOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); final service = ModalProvider.of(context).service; return Container( width: size, diff --git a/packages/reown_appkit/lib/modal/widgets/avatars/loading_border.dart b/packages/reown_appkit/lib/modal/widgets/avatars/loading_border.dart index 470081a..feecba1 100644 --- a/packages/reown_appkit/lib/modal/widgets/avatars/loading_border.dart +++ b/packages/reown_appkit/lib/modal/widgets/avatars/loading_border.dart @@ -65,7 +65,7 @@ class _LoadingBorderState extends State @override Widget build(BuildContext context) { - final themeColors = AppKitModalTheme.colorsOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); return Stack( alignment: Alignment.center, children: [ diff --git a/packages/reown_appkit/lib/modal/widgets/avatars/wallet_avatar.dart b/packages/reown_appkit/lib/modal/widgets/avatars/wallet_avatar.dart index 0f4dab4..90a2873 100644 --- a/packages/reown_appkit/lib/modal/widgets/avatars/wallet_avatar.dart +++ b/packages/reown_appkit/lib/modal/widgets/avatars/wallet_avatar.dart @@ -22,8 +22,8 @@ class ListAvatar extends StatelessWidget { @override Widget build(BuildContext context) { - final themeColors = AppKitModalTheme.colorsOf(context); - final radiuses = AppKitModalTheme.radiusesOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); + final radiuses = ReownAppKitModalTheme.radiusesOf(context); final radius = borderRadius ?? radiuses.radiusM; final projectId = explorerService.instance.projectId; return Stack( diff --git a/packages/reown_appkit/lib/modal/widgets/buttons/address_button.dart b/packages/reown_appkit/lib/modal/widgets/buttons/address_button.dart index 78d2dae..dc20e2d 100644 --- a/packages/reown_appkit/lib/modal/widgets/buttons/address_button.dart +++ b/packages/reown_appkit/lib/modal/widgets/buttons/address_button.dart @@ -12,7 +12,7 @@ class AddressButton extends StatefulWidget { this.size = BaseButtonSize.regular, this.onTap, }); - final IAppKitModal service; + final IReownAppKitModal service; final BaseButtonSize size; final VoidCallback? onTap; @@ -44,7 +44,7 @@ class _AddressButtonState extends State { @override Widget build(BuildContext context) { - final themeColors = AppKitModalTheme.colorsOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); return BaseButton( size: widget.size, onTap: widget.onTap, diff --git a/packages/reown_appkit/lib/modal/widgets/buttons/address_copy_button.dart b/packages/reown_appkit/lib/modal/widgets/buttons/address_copy_button.dart index ec590f2..616ac19 100644 --- a/packages/reown_appkit/lib/modal/widgets/buttons/address_copy_button.dart +++ b/packages/reown_appkit/lib/modal/widgets/buttons/address_copy_button.dart @@ -15,8 +15,8 @@ class AddressCopyButton extends StatelessWidget { @override Widget build(BuildContext context) { final service = ModalProvider.of(context).service; - final themeData = AppKitModalTheme.getDataOf(context); - final themeColors = AppKitModalTheme.colorsOf(context); + final themeData = ReownAppKitModalTheme.getDataOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); return GestureDetector( onTap: () async { await Clipboard.setData(ClipboardData(text: service.session!.address!)); diff --git a/packages/reown_appkit/lib/modal/widgets/buttons/balance_button.dart b/packages/reown_appkit/lib/modal/widgets/buttons/balance_button.dart index cda8d64..2c100d7 100644 --- a/packages/reown_appkit/lib/modal/widgets/buttons/balance_button.dart +++ b/packages/reown_appkit/lib/modal/widgets/buttons/balance_button.dart @@ -17,7 +17,7 @@ class BalanceButton extends StatefulWidget { this.onTap, }); - final IAppKitModal service; + final IReownAppKitModal service; final BaseButtonSize size; final VoidCallback? onTap; @@ -46,7 +46,7 @@ class _BalanceButtonState extends State { void _modalNotifyListener() { setState(() { final chainId = widget.service.selectedChain?.chainId ?? '1'; - final imageId = AppKitModalNetworks.getNetworkIconId(chainId); + final imageId = ReownAppKitModalNetworks.getNetworkIconId(chainId); _tokenImage = explorerService.instance.getAssetImageUrl(imageId); _balance = widget.service.chainBalance; _tokenName = widget.service.selectedChain?.currency; @@ -55,7 +55,7 @@ class _BalanceButtonState extends State { @override Widget build(BuildContext context) { - final themeColors = AppKitModalTheme.colorsOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); return BaseButton( size: widget.size, onTap: widget.onTap, diff --git a/packages/reown_appkit/lib/modal/widgets/buttons/base_button.dart b/packages/reown_appkit/lib/modal/widgets/buttons/base_button.dart index 67e1435..f94a184 100644 --- a/packages/reown_appkit/lib/modal/widgets/buttons/base_button.dart +++ b/packages/reown_appkit/lib/modal/widgets/buttons/base_button.dart @@ -46,7 +46,7 @@ class BaseButton extends StatelessWidget { @override Widget build(BuildContext context) { - final themeData = AppKitModalTheme.getDataOf(context); + final themeData = ReownAppKitModalTheme.getDataOf(context); final textStyle = size == BaseButtonSize.small ? themeData.textStyles.small600 : themeData.textStyles.paragraph600; diff --git a/packages/reown_appkit/lib/modal/widgets/buttons/connect_button.dart b/packages/reown_appkit/lib/modal/widgets/buttons/connect_button.dart index 9d1b80f..669ae4d 100644 --- a/packages/reown_appkit/lib/modal/widgets/buttons/connect_button.dart +++ b/packages/reown_appkit/lib/modal/widgets/buttons/connect_button.dart @@ -20,23 +20,23 @@ class ConnectButton extends StatelessWidget { super.key, this.size = BaseButtonSize.regular, this.state = ConnectButtonState.idle, - this.serviceStatus = AppKitModalStatus.idle, + this.serviceStatus = ReownAppKitModalStatus.idle, this.titleOverride, this.onTap, }); final BaseButtonSize size; final ConnectButtonState state; - final AppKitModalStatus serviceStatus; + final ReownAppKitModalStatus serviceStatus; final String? titleOverride; final VoidCallback? onTap; @override Widget build(BuildContext context) { - final themeColors = AppKitModalTheme.colorsOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); final connecting = state == ConnectButtonState.connecting; final disabled = state == ConnectButtonState.disabled; final connected = state == ConnectButtonState.connected; - final radiuses = AppKitModalTheme.radiusesOf(context); + final radiuses = ReownAppKitModalTheme.radiusesOf(context); final borderRadius = radiuses.isSquare() ? 0.0 : size.height / 2; final showLoading = connecting || serviceStatus.isLoading; return BaseButton( diff --git a/packages/reown_appkit/lib/modal/widgets/buttons/network_button.dart b/packages/reown_appkit/lib/modal/widgets/buttons/network_button.dart index 61bd877..6266cbf 100644 --- a/packages/reown_appkit/lib/modal/widgets/buttons/network_button.dart +++ b/packages/reown_appkit/lib/modal/widgets/buttons/network_button.dart @@ -15,31 +15,32 @@ class NetworkButton extends StatelessWidget { const NetworkButton({ super.key, this.size = BaseButtonSize.regular, - this.serviceStatus = AppKitModalStatus.idle, + this.serviceStatus = ReownAppKitModalStatus.idle, this.chainInfo, this.onTap, }); - final AppKitModalNetworkInfo? chainInfo; + final ReownAppKitModalNetworkInfo? chainInfo; final BaseButtonSize size; - final AppKitModalStatus serviceStatus; + final ReownAppKitModalStatus serviceStatus; final VoidCallback? onTap; - String _getImageUrl(AppKitModalNetworkInfo chainInfo) { + String _getImageUrl(ReownAppKitModalNetworkInfo chainInfo) { if (chainInfo.chainIcon != null && chainInfo.chainIcon!.contains('http')) { return chainInfo.chainIcon!; } - final imageId = AppKitModalNetworks.getNetworkIconId(chainInfo.chainId); + final imageId = + ReownAppKitModalNetworks.getNetworkIconId(chainInfo.chainId); return explorerService.instance.getAssetImageUrl(imageId); } @override Widget build(BuildContext context) { - final themeColors = AppKitModalTheme.colorsOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); String imageUrl = ''; if (chainInfo != null && (chainInfo!.chainIcon ?? '').isNotEmpty) { imageUrl = _getImageUrl(chainInfo!); } - final radiuses = AppKitModalTheme.radiusesOf(context); + final radiuses = ReownAppKitModalTheme.radiusesOf(context); final borderRadius = radiuses.isSquare() ? 0.0 : size.height / 2; return BaseButton( size: size, diff --git a/packages/reown_appkit/lib/modal/widgets/buttons/primary_button.dart b/packages/reown_appkit/lib/modal/widgets/buttons/primary_button.dart index 108e95a..ba7a548 100644 --- a/packages/reown_appkit/lib/modal/widgets/buttons/primary_button.dart +++ b/packages/reown_appkit/lib/modal/widgets/buttons/primary_button.dart @@ -15,8 +15,8 @@ class PrimaryButton extends StatelessWidget { @override Widget build(BuildContext context) { - final themeColors = AppKitModalTheme.colorsOf(context); - final radiuses = AppKitModalTheme.radiusesOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); + final radiuses = ReownAppKitModalTheme.radiusesOf(context); return BaseButton( size: BaseButtonSize.big, child: loading diff --git a/packages/reown_appkit/lib/modal/widgets/buttons/secondary_button.dart b/packages/reown_appkit/lib/modal/widgets/buttons/secondary_button.dart index c1fa504..8526385 100644 --- a/packages/reown_appkit/lib/modal/widgets/buttons/secondary_button.dart +++ b/packages/reown_appkit/lib/modal/widgets/buttons/secondary_button.dart @@ -13,8 +13,8 @@ class SecondaryButton extends StatelessWidget { @override Widget build(BuildContext context) { - final themeColors = AppKitModalTheme.colorsOf(context); - final radiuses = AppKitModalTheme.radiusesOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); + final radiuses = ReownAppKitModalTheme.radiusesOf(context); return BaseButton( size: BaseButtonSize.big, child: Text(title), diff --git a/packages/reown_appkit/lib/modal/widgets/buttons/simple_icon_button.dart b/packages/reown_appkit/lib/modal/widgets/buttons/simple_icon_button.dart index 7caa407..7454606 100644 --- a/packages/reown_appkit/lib/modal/widgets/buttons/simple_icon_button.dart +++ b/packages/reown_appkit/lib/modal/widgets/buttons/simple_icon_button.dart @@ -30,9 +30,9 @@ class SimpleIconButton extends StatelessWidget { @override Widget build(BuildContext context) { - final themeColors = AppKitModalTheme.colorsOf(context); - final textStyles = AppKitModalTheme.getDataOf(context).textStyles; - final radiuses = AppKitModalTheme.radiusesOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); + final textStyles = ReownAppKitModalTheme.getDataOf(context).textStyles; + final radiuses = ReownAppKitModalTheme.radiusesOf(context); final borderRadius = radiuses.isSquare() ? 0.0 : (BaseButtonSize.regular.height / 2); return BaseButton( diff --git a/packages/reown_appkit/lib/modal/widgets/circular_loader.dart b/packages/reown_appkit/lib/modal/widgets/circular_loader.dart index f2a50a5..87e104b 100644 --- a/packages/reown_appkit/lib/modal/widgets/circular_loader.dart +++ b/packages/reown_appkit/lib/modal/widgets/circular_loader.dart @@ -14,7 +14,7 @@ class CircularLoader extends StatelessWidget { @override Widget build(BuildContext context) { - final themeColors = AppKitModalTheme.colorsOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); return Container( padding: padding ?? const EdgeInsets.all(0.0), width: size, diff --git a/packages/reown_appkit/lib/modal/widgets/help/help_section.dart b/packages/reown_appkit/lib/modal/widgets/help/help_section.dart index 51fd913..57838b6 100644 --- a/packages/reown_appkit/lib/modal/widgets/help/help_section.dart +++ b/packages/reown_appkit/lib/modal/widgets/help/help_section.dart @@ -15,8 +15,8 @@ class HelpSection extends StatelessWidget { @override Widget build(BuildContext context) { - final themeData = AppKitModalTheme.getDataOf(context); - final themeColors = AppKitModalTheme.colorsOf(context); + final themeData = ReownAppKitModalTheme.getDataOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); return Container( padding: const EdgeInsets.all(kPadding12), child: Column( diff --git a/packages/reown_appkit/lib/modal/widgets/icons/rounded_icon.dart b/packages/reown_appkit/lib/modal/widgets/icons/rounded_icon.dart index 8158661..27944d6 100644 --- a/packages/reown_appkit/lib/modal/widgets/icons/rounded_icon.dart +++ b/packages/reown_appkit/lib/modal/widgets/icons/rounded_icon.dart @@ -24,7 +24,7 @@ class RoundedIcon extends StatelessWidget { @override Widget build(BuildContext context) { - final themeColors = AppKitModalTheme.colorsOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); final projectId = explorerService.instance.projectId; final radius = borderRadius ?? size; return Container( diff --git a/packages/reown_appkit/lib/modal/widgets/icons/themed_icon.dart b/packages/reown_appkit/lib/modal/widgets/icons/themed_icon.dart index 79bd42c..74ecf46 100644 --- a/packages/reown_appkit/lib/modal/widgets/icons/themed_icon.dart +++ b/packages/reown_appkit/lib/modal/widgets/icons/themed_icon.dart @@ -14,8 +14,8 @@ class ThemedIcon extends StatelessWidget { @override Widget build(BuildContext context) { - final themeColors = AppKitModalTheme.colorsOf(context); - final radiuses = AppKitModalTheme.radiusesOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); + final radiuses = ReownAppKitModalTheme.radiusesOf(context); return Container( width: size, height: size, @@ -55,8 +55,8 @@ class ThemedButton extends StatelessWidget { @override Widget build(BuildContext context) { - final themeColors = AppKitModalTheme.colorsOf(context); - final radiuses = AppKitModalTheme.radiusesOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); + final radiuses = ReownAppKitModalTheme.radiusesOf(context); return TextButton( onPressed: onPressed, clipBehavior: Clip.antiAlias, diff --git a/packages/reown_appkit/lib/modal/widgets/lists/grid_items/base_grid_item.dart b/packages/reown_appkit/lib/modal/widgets/lists/grid_items/base_grid_item.dart index e395f0b..1285f2c 100644 --- a/packages/reown_appkit/lib/modal/widgets/lists/grid_items/base_grid_item.dart +++ b/packages/reown_appkit/lib/modal/widgets/lists/grid_items/base_grid_item.dart @@ -17,8 +17,8 @@ class BaseGridItem extends StatelessWidget { @override Widget build(BuildContext context) { - final themeColors = AppKitModalTheme.colorsOf(context); - final radiuses = AppKitModalTheme.radiusesOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); + final radiuses = ReownAppKitModalTheme.radiusesOf(context); final maxRadius = min(radiuses.radiusXS, 32.0); return FilledButton( onPressed: onTap, diff --git a/packages/reown_appkit/lib/modal/widgets/lists/grid_items/wallet_grid_item.dart b/packages/reown_appkit/lib/modal/widgets/lists/grid_items/wallet_grid_item.dart index 99d8627..8cc65f7 100644 --- a/packages/reown_appkit/lib/modal/widgets/lists/grid_items/wallet_grid_item.dart +++ b/packages/reown_appkit/lib/modal/widgets/lists/grid_items/wallet_grid_item.dart @@ -26,9 +26,9 @@ class WalletGridItem extends StatelessWidget { @override Widget build(BuildContext context) { - final themeData = AppKitModalTheme.getDataOf(context); - final themeColors = AppKitModalTheme.colorsOf(context); - final radiuses = AppKitModalTheme.radiusesOf(context); + final themeData = ReownAppKitModalTheme.getDataOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); + final radiuses = ReownAppKitModalTheme.radiusesOf(context); return BaseGridItem( onTap: onTap, isSelected: isSelected, diff --git a/packages/reown_appkit/lib/modal/widgets/lists/list_items/account_list_item.dart b/packages/reown_appkit/lib/modal/widgets/lists/list_items/account_list_item.dart index 0d63873..8636bb0 100644 --- a/packages/reown_appkit/lib/modal/widgets/lists/list_items/account_list_item.dart +++ b/packages/reown_appkit/lib/modal/widgets/lists/list_items/account_list_item.dart @@ -38,9 +38,9 @@ class AccountListItem extends StatelessWidget { @override Widget build(BuildContext context) { - final themeData = AppKitModalTheme.getDataOf(context); - final themeColors = AppKitModalTheme.colorsOf(context); - final radiuses = AppKitModalTheme.radiusesOf(context); + final themeData = ReownAppKitModalTheme.getDataOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); + final radiuses = ReownAppKitModalTheme.radiusesOf(context); return BaseListItem( onTap: onTap, hightlighted: hightlighted, diff --git a/packages/reown_appkit/lib/modal/widgets/lists/list_items/all_wallets_item.dart b/packages/reown_appkit/lib/modal/widgets/lists/list_items/all_wallets_item.dart index 33adb6e..4abbc06 100644 --- a/packages/reown_appkit/lib/modal/widgets/lists/list_items/all_wallets_item.dart +++ b/packages/reown_appkit/lib/modal/widgets/lists/list_items/all_wallets_item.dart @@ -17,8 +17,8 @@ class AllWalletsItem extends StatelessWidget { @override Widget build(BuildContext context) { - final themeData = AppKitModalTheme.getDataOf(context); - final themeColors = AppKitModalTheme.colorsOf(context); + final themeData = ReownAppKitModalTheme.getDataOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); return BaseListItem( onTap: onTap, child: Row( diff --git a/packages/reown_appkit/lib/modal/widgets/lists/list_items/base_list_item.dart b/packages/reown_appkit/lib/modal/widgets/lists/list_items/base_list_item.dart index 67670ed..faad699 100644 --- a/packages/reown_appkit/lib/modal/widgets/lists/list_items/base_list_item.dart +++ b/packages/reown_appkit/lib/modal/widgets/lists/list_items/base_list_item.dart @@ -21,8 +21,8 @@ class BaseListItem extends StatelessWidget { @override Widget build(BuildContext context) { - final themeColors = AppKitModalTheme.colorsOf(context); - final radiuses = AppKitModalTheme.radiusesOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); + final radiuses = ReownAppKitModalTheme.radiusesOf(context); return FilledButton( onPressed: onTap, style: ButtonStyle( diff --git a/packages/reown_appkit/lib/modal/widgets/lists/list_items/download_wallet_item.dart b/packages/reown_appkit/lib/modal/widgets/lists/list_items/download_wallet_item.dart index 08044c1..dc117d0 100644 --- a/packages/reown_appkit/lib/modal/widgets/lists/list_items/download_wallet_item.dart +++ b/packages/reown_appkit/lib/modal/widgets/lists/list_items/download_wallet_item.dart @@ -14,7 +14,7 @@ class DownloadWalletItem extends StatelessWidget { required this.walletInfo, this.webOnly = false, }); - final AppKitModalWalletInfo walletInfo; + final ReownAppKitModalWalletInfo walletInfo; final bool webOnly; String get _storeUrl { @@ -32,7 +32,7 @@ class DownloadWalletItem extends StatelessWidget { @override Widget build(BuildContext context) { - final themeColors = AppKitModalTheme.colorsOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); if (_storeUrl.isEmpty) { return SizedBox.shrink(); } diff --git a/packages/reown_appkit/lib/modal/widgets/lists/list_items/wallet_connect_item.dart b/packages/reown_appkit/lib/modal/widgets/lists/list_items/wallet_connect_item.dart index 1b966b8..370ec6b 100644 --- a/packages/reown_appkit/lib/modal/widgets/lists/list_items/wallet_connect_item.dart +++ b/packages/reown_appkit/lib/modal/widgets/lists/list_items/wallet_connect_item.dart @@ -15,8 +15,8 @@ class WalletConnectItem extends StatelessWidget { @override Widget build(BuildContext context) { - final themeData = AppKitModalTheme.getDataOf(context); - final themeColors = AppKitModalTheme.colorsOf(context); + final themeData = ReownAppKitModalTheme.getDataOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); return BaseListItem( onTap: onTap, child: Row( diff --git a/packages/reown_appkit/lib/modal/widgets/lists/list_items/wallet_item_chip.dart b/packages/reown_appkit/lib/modal/widgets/lists/list_items/wallet_item_chip.dart index 3a13df1..daaca04 100644 --- a/packages/reown_appkit/lib/modal/widgets/lists/list_items/wallet_item_chip.dart +++ b/packages/reown_appkit/lib/modal/widgets/lists/list_items/wallet_item_chip.dart @@ -14,9 +14,9 @@ class WalletItemChip extends StatelessWidget { @override Widget build(BuildContext context) { - final themeData = AppKitModalTheme.getDataOf(context); - final themeColors = AppKitModalTheme.colorsOf(context); - final radiuses = AppKitModalTheme.radiusesOf(context); + final themeData = ReownAppKitModalTheme.getDataOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); + final radiuses = ReownAppKitModalTheme.radiusesOf(context); return Container( decoration: BoxDecoration( color: color ?? themeColors.grayGlass010, diff --git a/packages/reown_appkit/lib/modal/widgets/lists/list_items/wallet_list_item.dart b/packages/reown_appkit/lib/modal/widgets/lists/list_items/wallet_list_item.dart index 71d9248..4177c8f 100644 --- a/packages/reown_appkit/lib/modal/widgets/lists/list_items/wallet_list_item.dart +++ b/packages/reown_appkit/lib/modal/widgets/lists/list_items/wallet_list_item.dart @@ -25,9 +25,9 @@ class WalletListItem extends StatelessWidget { @override Widget build(BuildContext context) { - final themeData = AppKitModalTheme.getDataOf(context); - final themeColors = AppKitModalTheme.colorsOf(context); - final radiuses = AppKitModalTheme.radiusesOf(context); + final themeData = ReownAppKitModalTheme.getDataOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); + final radiuses = ReownAppKitModalTheme.radiusesOf(context); return BaseListItem( onTap: onTap, padding: const EdgeInsets.all(0.0), diff --git a/packages/reown_appkit/lib/modal/widgets/lists/list_items/wallet_list_item_simple.dart b/packages/reown_appkit/lib/modal/widgets/lists/list_items/wallet_list_item_simple.dart index 5493519..6c645f3 100644 --- a/packages/reown_appkit/lib/modal/widgets/lists/list_items/wallet_list_item_simple.dart +++ b/packages/reown_appkit/lib/modal/widgets/lists/list_items/wallet_list_item_simple.dart @@ -17,8 +17,8 @@ class WalletListItemSimple extends StatelessWidget { @override Widget build(BuildContext context) { - final themeData = AppKitModalTheme.getDataOf(context); - final themeColors = AppKitModalTheme.colorsOf(context); + final themeData = ReownAppKitModalTheme.getDataOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); return BaseListItem( onTap: onTap, child: Row( diff --git a/packages/reown_appkit/lib/modal/widgets/lists/networks_grid.dart b/packages/reown_appkit/lib/modal/widgets/lists/networks_grid.dart index 749f1ae..e095723 100644 --- a/packages/reown_appkit/lib/modal/widgets/lists/networks_grid.dart +++ b/packages/reown_appkit/lib/modal/widgets/lists/networks_grid.dart @@ -13,15 +13,15 @@ class NetworksGrid extends StatelessWidget { required this.itemList, this.onTapNetwork, }); - final List> itemList; - final Function(AppKitModalNetworkInfo)? onTapNetwork; + final List> itemList; + final Function(ReownAppKitModalNetworkInfo)? onTapNetwork; @override Widget build(BuildContext context) { final service = ModalProvider.of(context).service; final itemSize = ResponsiveData.gridItemSzieOf(context); - // final themeData = AppKitModalTheme.getDataOf(context); - // final themeColors = AppKitModalTheme.colorsOf(context); + // final themeData = ReownAppKitModalTheme.getDataOf(context); + // final themeColors = ReownAppKitModalTheme.colorsOf(context); final children = itemList .map( (info) => WalletGridItem( diff --git a/packages/reown_appkit/lib/modal/widgets/lists/wallets_grid.dart b/packages/reown_appkit/lib/modal/widgets/lists/wallets_grid.dart index 17278d6..056df38 100644 --- a/packages/reown_appkit/lib/modal/widgets/lists/wallets_grid.dart +++ b/packages/reown_appkit/lib/modal/widgets/lists/wallets_grid.dart @@ -17,8 +17,8 @@ class WalletsGrid extends StatelessWidget { this.scrollController, this.paddingTop = 0.0, }); - final List> itemList; - final Function(AppKitModalWalletInfo walletInfo)? onTapWallet; + final List> itemList; + final Function(ReownAppKitModalWalletInfo walletInfo)? onTapWallet; final bool showLoading; final int loadingCount; final ScrollController? scrollController; @@ -26,7 +26,7 @@ class WalletsGrid extends StatelessWidget { @override Widget build(BuildContext context) { - final themeColors = AppKitModalTheme.colorsOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); final List children = itemList .map( (info) => SizedBox( diff --git a/packages/reown_appkit/lib/modal/widgets/lists/wallets_list.dart b/packages/reown_appkit/lib/modal/widgets/lists/wallets_list.dart index fe641b6..0b474ac 100644 --- a/packages/reown_appkit/lib/modal/widgets/lists/wallets_list.dart +++ b/packages/reown_appkit/lib/modal/widgets/lists/wallets_list.dart @@ -16,15 +16,15 @@ class WalletsList extends StatelessWidget { this.onTapWallet, this.isLoading = false, }); - final List> itemList; + final List> itemList; final Widget? firstItem; final List bottomItems; - final Function(AppKitModalWalletInfo walletInfo)? onTapWallet; + final Function(ReownAppKitModalWalletInfo walletInfo)? onTapWallet; final bool isLoading; @override Widget build(BuildContext context) { - final themeColors = AppKitModalTheme.colorsOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); final loadingList = [ const WalletListItem(title: ''), const WalletListItem(title: ''), diff --git a/packages/reown_appkit/lib/modal/widgets/miscellaneous/all_wallets_header.dart b/packages/reown_appkit/lib/modal/widgets/miscellaneous/all_wallets_header.dart index abeb6f3..2d6e5f2 100644 --- a/packages/reown_appkit/lib/modal/widgets/miscellaneous/all_wallets_header.dart +++ b/packages/reown_appkit/lib/modal/widgets/miscellaneous/all_wallets_header.dart @@ -37,7 +37,7 @@ class AllWalletsHeader extends StatelessWidget { iconPath: 'lib/modal/assets/icons/code.svg', onPressed: () { widgetStack.instance.push( - const AppKitModalQRCodePage(), + const ReownAppKitModalQRCodePage(), event: SelectWalletEvent( name: 'WalletConnect', platform: AnalyticsPlatform.qrcode, diff --git a/packages/reown_appkit/lib/modal/widgets/miscellaneous/input_email.dart b/packages/reown_appkit/lib/modal/widgets/miscellaneous/input_email.dart index ec2e8ed..e01cbe2 100644 --- a/packages/reown_appkit/lib/modal/widgets/miscellaneous/input_email.dart +++ b/packages/reown_appkit/lib/modal/widgets/miscellaneous/input_email.dart @@ -64,7 +64,7 @@ class _InputEmailWidgetState extends State { @override Widget build(BuildContext context) { - final themeColors = AppKitModalTheme.colorsOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); return ModalSearchBar( enabled: !_timedOut && _ready && !_submitted, controller: _controller, diff --git a/packages/reown_appkit/lib/modal/widgets/miscellaneous/searchbar.dart b/packages/reown_appkit/lib/modal/widgets/miscellaneous/searchbar.dart index 17a27a4..1c1d622 100644 --- a/packages/reown_appkit/lib/modal/widgets/miscellaneous/searchbar.dart +++ b/packages/reown_appkit/lib/modal/widgets/miscellaneous/searchbar.dart @@ -109,8 +109,8 @@ class _ModalSearchBarState extends State } void _setDecoration() { - final themeColors = AppKitModalTheme.colorsOf(context); - final radiuses = AppKitModalTheme.radiusesOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); + final radiuses = ReownAppKitModalTheme.radiusesOf(context); _decorationTween = DecorationTween( begin: BoxDecoration( borderRadius: BorderRadius.circular(radiuses.radiusXS), @@ -170,9 +170,9 @@ class _ModalSearchBarState extends State @override Widget build(BuildContext context) { - final themeData = AppKitModalTheme.getDataOf(context); - final themeColors = AppKitModalTheme.colorsOf(context); - final radiuses = AppKitModalTheme.radiusesOf(context); + final themeData = ReownAppKitModalTheme.getDataOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); + final radiuses = ReownAppKitModalTheme.radiusesOf(context); final unfocusedBorder = OutlineInputBorder( borderSide: BorderSide(color: themeColors.grayGlass005, width: 1.0), borderRadius: BorderRadius.circular(radiuses.radius2XS), diff --git a/packages/reown_appkit/lib/modal/widgets/miscellaneous/segmented_control.dart b/packages/reown_appkit/lib/modal/widgets/miscellaneous/segmented_control.dart index f1492fc..56f4527 100644 --- a/packages/reown_appkit/lib/modal/widgets/miscellaneous/segmented_control.dart +++ b/packages/reown_appkit/lib/modal/widgets/miscellaneous/segmented_control.dart @@ -24,9 +24,9 @@ class _SegmentedControlState extends State { @override Widget build(BuildContext context) { - final themeData = AppKitModalTheme.getDataOf(context); - final themeColors = AppKitModalTheme.colorsOf(context); - final radiuses = AppKitModalTheme.radiusesOf(context); + final themeData = ReownAppKitModalTheme.getDataOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); + final radiuses = ReownAppKitModalTheme.radiusesOf(context); return SizedBox( height: 32.0, child: CustomSlidingSegmentedControl( diff --git a/packages/reown_appkit/lib/modal/widgets/miscellaneous/verify_otp_view.dart b/packages/reown_appkit/lib/modal/widgets/miscellaneous/verify_otp_view.dart index 29e018e..d02c099 100644 --- a/packages/reown_appkit/lib/modal/widgets/miscellaneous/verify_otp_view.dart +++ b/packages/reown_appkit/lib/modal/widgets/miscellaneous/verify_otp_view.dart @@ -112,8 +112,8 @@ class _VerifyOtpViewState extends State @override Widget build(BuildContext context) { - final themeColors = AppKitModalTheme.colorsOf(context); - final textStyles = AppKitModalTheme.getDataOf(context).textStyles; + final themeColors = ReownAppKitModalTheme.colorsOf(context); + final textStyles = ReownAppKitModalTheme.getDataOf(context).textStyles; return Column( mainAxisSize: MainAxisSize.min, children: [ diff --git a/packages/reown_appkit/lib/modal/widgets/modal_container.dart b/packages/reown_appkit/lib/modal/widgets/modal_container.dart index e4f5067..966855b 100644 --- a/packages/reown_appkit/lib/modal/widgets/modal_container.dart +++ b/packages/reown_appkit/lib/modal/widgets/modal_container.dart @@ -57,8 +57,8 @@ class _ModalContainerState extends State { @override Widget build(BuildContext context) { - final themeColors = AppKitModalTheme.colorsOf(context); - final radiuses = AppKitModalTheme.radiusesOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); + final radiuses = ReownAppKitModalTheme.radiusesOf(context); final bottomSheet = PlatformUtils.isBottomSheet(); final isTabletSize = PlatformUtils.isTablet(context); final maxRadius = min(radiuses.radiusM, 36.0); diff --git a/packages/reown_appkit/lib/modal/widgets/modal_provider.dart b/packages/reown_appkit/lib/modal/widgets/modal_provider.dart index a9b01b9..6cb3b54 100644 --- a/packages/reown_appkit/lib/modal/widgets/modal_provider.dart +++ b/packages/reown_appkit/lib/modal/widgets/modal_provider.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:reown_appkit/modal/i_appkit_modal_impl.dart'; class ModalProvider extends InheritedWidget { - final IAppKitModal service; + final IReownAppKitModal service; const ModalProvider({ super.key, diff --git a/packages/reown_appkit/lib/modal/widgets/navigation/navbar.dart b/packages/reown_appkit/lib/modal/widgets/navigation/navbar.dart index 6b1a4e1..fe1f893 100644 --- a/packages/reown_appkit/lib/modal/widgets/navigation/navbar.dart +++ b/packages/reown_appkit/lib/modal/widgets/navigation/navbar.dart @@ -30,8 +30,8 @@ class ModalNavbar extends StatelessWidget { @override Widget build(BuildContext context) { - final themeData = AppKitModalTheme.getDataOf(context); - final themeColors = AppKitModalTheme.colorsOf(context); + final themeData = ReownAppKitModalTheme.getDataOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); final keyboardOpened = ResponsiveData.isKeyboardShown(context); final paddingBottom = keyboardOpened ? ResponsiveData.paddingBottomOf(context) : 0.0; diff --git a/packages/reown_appkit/lib/modal/widgets/navigation/navbar_action_button.dart b/packages/reown_appkit/lib/modal/widgets/navigation/navbar_action_button.dart index 741bbd5..7c0f998 100644 --- a/packages/reown_appkit/lib/modal/widgets/navigation/navbar_action_button.dart +++ b/packages/reown_appkit/lib/modal/widgets/navigation/navbar_action_button.dart @@ -16,7 +16,7 @@ class NavbarActionButton extends StatelessWidget { @override Widget build(BuildContext context) { - final themeColors = AppKitModalTheme.colorsOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); return SizedBox.square( dimension: kNavbarHeight, child: IconButton( diff --git a/packages/reown_appkit/lib/modal/widgets/public/appkit_modal_account_button.dart b/packages/reown_appkit/lib/modal/widgets/public/appkit_modal_account_button.dart index b3b6017..fe3244e 100644 --- a/packages/reown_appkit/lib/modal/widgets/public/appkit_modal_account_button.dart +++ b/packages/reown_appkit/lib/modal/widgets/public/appkit_modal_account_button.dart @@ -25,7 +25,7 @@ class AppKitModalAccountButton extends StatefulWidget { this.custom, }); - final IAppKitModal service; + final IReownAppKitModal service; final BaseButtonSize size; final String? avatar; final BuildContext? context; @@ -47,7 +47,7 @@ class _AppKitModalAccountButtonState extends State { super.initState(); _modalNotifyListener(); widget.service.addListener(_modalNotifyListener); - // TODO [AppKitModalAccountButton] this should go in AppKitModal but for that, init() method of AppKitModal should receive a BuildContext, which would be a breaking change + // TODO [AppKitModalAccountButton] this should go in ReownAppKitModal but for that, init() method of ReownAppKitModal should receive a BuildContext, which would be a breaking change magicService.instance.onMagicRpcRequest.subscribe(_approveSign); magicService.instance.onMagicLoginRequest.subscribe(_loginRequested); } @@ -64,7 +64,7 @@ class _AppKitModalAccountButtonState extends State { setState(() { _address = widget.service.session?.address ?? ''; final chainId = widget.service.selectedChain?.chainId ?? ''; - final imageId = AppKitModalNetworks.getNetworkIconId(chainId); + final imageId = ReownAppKitModalNetworks.getNetworkIconId(chainId); _tokenImage = explorerService.instance.getAssetImageUrl(imageId); _balance = widget.service.chainBalance; _tokenName = widget.service.selectedChain?.currency; @@ -98,8 +98,8 @@ class _AppKitModalAccountButtonState extends State { if (widget.custom != null) { return widget.custom!; } - final themeColors = AppKitModalTheme.colorsOf(context); - final radiuses = AppKitModalTheme.radiusesOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); + final radiuses = ReownAppKitModalTheme.radiusesOf(context); final borderRadius = radiuses.isSquare() ? 0.0 : widget.size.height / 2; final enabled = _address.isNotEmpty && widget.service.status.isInitialized; // TODO [AppKitModalAccountButton] this button should be able to be disable by passing a null onTap action @@ -173,19 +173,19 @@ class _AddressButton extends StatelessWidget { final BaseButtonSize buttonSize; final VoidCallback? onTap; final String address; - final IAppKitModal service; + final IReownAppKitModal service; @override Widget build(BuildContext context) { if (address.isEmpty) { return SizedBox.shrink(); } - final themeData = AppKitModalTheme.getDataOf(context); + final themeData = ReownAppKitModalTheme.getDataOf(context); final textStyle = buttonSize == BaseButtonSize.small ? themeData.textStyles.small600 : themeData.textStyles.paragraph600; - final themeColors = AppKitModalTheme.colorsOf(context); - final radiuses = AppKitModalTheme.radiusesOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); + final radiuses = ReownAppKitModalTheme.radiusesOf(context); final innerBorderRadius = radiuses.isSquare() ? 0.0 : BaseButtonSize.small.height / 2; return Padding( @@ -289,8 +289,8 @@ class _BalanceButton extends StatelessWidget { @override Widget build(BuildContext context) { - final themeColors = AppKitModalTheme.colorsOf(context); - final themeData = AppKitModalTheme.getDataOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); + final themeData = ReownAppKitModalTheme.getDataOf(context); final textStyle = buttonSize == BaseButtonSize.small ? themeData.textStyles.small600 : themeData.textStyles.paragraph600; diff --git a/packages/reown_appkit/lib/modal/widgets/public/appkit_modal_connect_button.dart b/packages/reown_appkit/lib/modal/widgets/public/appkit_modal_connect_button.dart index a8abf14..2c946bf 100644 --- a/packages/reown_appkit/lib/modal/widgets/public/appkit_modal_connect_button.dart +++ b/packages/reown_appkit/lib/modal/widgets/public/appkit_modal_connect_button.dart @@ -15,7 +15,7 @@ class AppKitModalConnectButton extends StatefulWidget { this.custom, }); - final IAppKitModal service; + final IReownAppKitModal service; final BaseButtonSize size; final ConnectButtonState? state; final BuildContext? context; @@ -82,7 +82,7 @@ class _AppKitModalConnectButtonState extends State { return; } // Case 0: init error - if (widget.service.status == AppKitModalStatus.error) { + if (widget.service.status == ReownAppKitModalStatus.error) { return setState(() => _state = ConnectButtonState.error); } // Case 1: Is connected diff --git a/packages/reown_appkit/lib/modal/widgets/public/appkit_modal_network_select_button.dart b/packages/reown_appkit/lib/modal/widgets/public/appkit_modal_network_select_button.dart index 10b7b73..388d397 100644 --- a/packages/reown_appkit/lib/modal/widgets/public/appkit_modal_network_select_button.dart +++ b/packages/reown_appkit/lib/modal/widgets/public/appkit_modal_network_select_button.dart @@ -18,7 +18,7 @@ class AppKitModalNetworkSelectButton extends StatefulWidget { this.custom, }); - final IAppKitModal service; + final IReownAppKitModal service; final BaseButtonSize size; final BuildContext? context; final Widget? custom; @@ -30,7 +30,7 @@ class AppKitModalNetworkSelectButton extends StatefulWidget { class _AppKitModalNetworkSelectButtonState extends State { - AppKitModalNetworkInfo? _selectedChain; + ReownAppKitModalNetworkInfo? _selectedChain; @override void initState() { @@ -59,7 +59,7 @@ class _AppKitModalNetworkSelectButtonState void _onConnectPressed() { analyticsService.instance.sendEvent(ClickNetworksEvent()); widget.service.openModalView( - AppKitModalSelectNetworkPage( + ReownAppKitModalSelectNetworkPage( onTapNetwork: (info) { widget.service.selectChain(info); widgetStack.instance.addDefault(); diff --git a/packages/reown_appkit/lib/modal/widgets/qr_code_view.dart b/packages/reown_appkit/lib/modal/widgets/qr_code_view.dart index 2fa4003..7f15697 100644 --- a/packages/reown_appkit/lib/modal/widgets/qr_code_view.dart +++ b/packages/reown_appkit/lib/modal/widgets/qr_code_view.dart @@ -18,10 +18,11 @@ class QRCodeView extends StatelessWidget { @override Widget build(BuildContext context) { - final radiuses = AppKitModalTheme.radiusesOf(context); + final radiuses = ReownAppKitModalTheme.radiusesOf(context); final responsiveData = ResponsiveData.of(context); final isPortrait = ResponsiveData.isPortrait(context); - final isDarkMode = AppKitModalTheme.maybeOf(context)?.isDarkMode ?? false; + final isDarkMode = + ReownAppKitModalTheme.maybeOf(context)?.isDarkMode ?? false; final imageSize = isPortrait ? 80.0 : 60.0; final maxRadius = min(radiuses.radiusL, 36.0); return Container( diff --git a/packages/reown_appkit/lib/modal/widgets/text/appkit_address.dart b/packages/reown_appkit/lib/modal/widgets/text/appkit_address.dart index 42e4967..814cc3e 100644 --- a/packages/reown_appkit/lib/modal/widgets/text/appkit_address.dart +++ b/packages/reown_appkit/lib/modal/widgets/text/appkit_address.dart @@ -10,7 +10,7 @@ class Address extends StatefulWidget { this.style, }); - final IAppKitModal service; + final IReownAppKitModal service; final TextStyle? style; @override @@ -35,8 +35,8 @@ class _AddressState extends State
{ @override Widget build(BuildContext context) { - final themeData = AppKitModalTheme.getDataOf(context); - final themeColors = AppKitModalTheme.colorsOf(context); + final themeData = ReownAppKitModalTheme.getDataOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); return Text( RenderUtils.truncate(_address ?? ''), style: widget.style ?? diff --git a/packages/reown_appkit/lib/modal/widgets/text/appkit_balance.dart b/packages/reown_appkit/lib/modal/widgets/text/appkit_balance.dart index c5b9aab..ee5f1db 100644 --- a/packages/reown_appkit/lib/modal/widgets/text/appkit_balance.dart +++ b/packages/reown_appkit/lib/modal/widgets/text/appkit_balance.dart @@ -22,7 +22,7 @@ class BalanceText extends StatefulWidget { class _BalanceTextState extends State { String _balance = BalanceButton.balanceDefault; String? _tokenName; - IAppKitModal? _service; + IReownAppKitModal? _service; @override void initState() { @@ -50,8 +50,8 @@ class _BalanceTextState extends State { @override Widget build(BuildContext context) { - final themeData = AppKitModalTheme.getDataOf(context); - final themeColors = AppKitModalTheme.colorsOf(context); + final themeData = ReownAppKitModalTheme.getDataOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); return Text( '$_balance ${_tokenName ?? ''}', style: themeData.textStyles.paragraph500.copyWith( diff --git a/packages/reown_appkit/lib/modal/widgets/toast/toast.dart b/packages/reown_appkit/lib/modal/widgets/toast/toast.dart index f82a9f1..ed3f6f7 100644 --- a/packages/reown_appkit/lib/modal/widgets/toast/toast.dart +++ b/packages/reown_appkit/lib/modal/widgets/toast/toast.dart @@ -50,9 +50,9 @@ class _ToastWidgetState extends State @override Widget build(BuildContext context) { - final themeData = AppKitModalTheme.getDataOf(context); - final themeColors = AppKitModalTheme.colorsOf(context); - final radiuses = AppKitModalTheme.radiusesOf(context); + final themeData = ReownAppKitModalTheme.getDataOf(context); + final themeColors = ReownAppKitModalTheme.colorsOf(context); + final radiuses = ReownAppKitModalTheme.radiusesOf(context); return Positioned( top: 10.0, left: 20.0, diff --git a/packages/reown_appkit/lib/modal/widgets/value_listenable_builders/explorer_service_items_listener.dart b/packages/reown_appkit/lib/modal/widgets/value_listenable_builders/explorer_service_items_listener.dart index e6e753f..cd64279 100644 --- a/packages/reown_appkit/lib/modal/widgets/value_listenable_builders/explorer_service_items_listener.dart +++ b/packages/reown_appkit/lib/modal/widgets/value_listenable_builders/explorer_service_items_listener.dart @@ -13,7 +13,7 @@ class ExplorerServiceItemsListener extends StatefulWidget { final Function( BuildContext context, bool initialised, - List> items, + List> items, bool searching, ) builder; final bool listen; @@ -25,7 +25,7 @@ class ExplorerServiceItemsListener extends StatefulWidget { class _ExplorerServiceItemsListenerState extends State { - List> _items = []; + List> _items = []; @override Widget build(BuildContext context) { @@ -41,7 +41,7 @@ class _ExplorerServiceItemsListenerState if (searching) { return widget.builder(context, initialised, _items, searching); } - return ValueListenableBuilder>( + return ValueListenableBuilder>( valueListenable: explorerService.instance.listings, builder: (context, items, _) { if (widget.listen) { @@ -57,12 +57,12 @@ class _ExplorerServiceItemsListenerState } } -extension on List { - List> toGridItems() { - List> gridItems = []; - for (AppKitModalWalletInfo item in this) { +extension on List { + List> toGridItems() { + List> gridItems = []; + for (ReownAppKitModalWalletInfo item in this) { gridItems.add( - GridItem( + GridItem( title: item.listing.name, id: item.listing.id, image: explorerService.instance.getWalletImageUrl( diff --git a/packages/reown_appkit/lib/modal/widgets/value_listenable_builders/network_service_items_listener.dart b/packages/reown_appkit/lib/modal/widgets/value_listenable_builders/network_service_items_listener.dart index 8eeed82..b2f5b16 100644 --- a/packages/reown_appkit/lib/modal/widgets/value_listenable_builders/network_service_items_listener.dart +++ b/packages/reown_appkit/lib/modal/widgets/value_listenable_builders/network_service_items_listener.dart @@ -14,7 +14,7 @@ class NetworkServiceItemsListener extends StatelessWidget { final Function( BuildContext context, bool initialised, - List> items, + List> items, ) builder; @override diff --git a/packages/reown_appkit/lib/modal/widgets/widget_stack/widget_stack.dart b/packages/reown_appkit/lib/modal/widgets/widget_stack/widget_stack.dart index 917d664..34b7089 100644 --- a/packages/reown_appkit/lib/modal/widgets/widget_stack/widget_stack.dart +++ b/packages/reown_appkit/lib/modal/widgets/widget_stack/widget_stack.dart @@ -85,10 +85,10 @@ class WidgetStack extends IWidgetStack { // Choose the state based on platform if (pType == PlatformType.mobile) { - push(const AppKitModalMainWalletsPage(), renderScreen: true); + push(const ReownAppKitModalMainWalletsPage(), renderScreen: true); } else if (pType == PlatformType.desktop || pType == PlatformType.web) { // add(const QRCodeAndWalletListPage()); - push(const AppKitModalMainWalletsPage(), renderScreen: true); + push(const ReownAppKitModalMainWalletsPage(), renderScreen: true); // TODO [WidgetStack] fix non mobile page } } diff --git a/packages/reown_core/test/relay_client_test.dart b/packages/reown_core/test/relay_client_test.dart index 4bf118b..eeaba6e 100644 --- a/packages/reown_core/test/relay_client_test.dart +++ b/packages/reown_core/test/relay_client_test.dart @@ -1,3 +1,5 @@ +@Timeout(Duration(seconds: 45)) + import 'dart:async'; import 'package:flutter_test/flutter_test.dart'; diff --git a/packages/reown_core/test/shared/shared_test_values.dart b/packages/reown_core/test/shared/shared_test_values.dart index dcbf96f..0a52e43 100644 --- a/packages/reown_core/test/shared/shared_test_values.dart +++ b/packages/reown_core/test/shared/shared_test_values.dart @@ -2,7 +2,7 @@ import 'package:reown_core/reown_core.dart'; const TEST_RELAY_URL = String.fromEnvironment( 'RELAY_ENDPOINT', - defaultValue: 'wss://relay.walletconnect.com', + defaultValue: 'wss://relay.walletconnect.org', ); const TEST_PROJECT_ID = String.fromEnvironment( 'PROJECT_ID', diff --git a/packages/reown_walletkit/example/ios/Runner.xcodeproj/project.pbxproj b/packages/reown_walletkit/example/ios/Runner.xcodeproj/project.pbxproj index 351d509..840ce50 100644 --- a/packages/reown_walletkit/example/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/reown_walletkit/example/ios/Runner.xcodeproj/project.pbxproj @@ -10,11 +10,11 @@ 091D8F542C4A7A5000904D6C /* Info-internal.plist in Resources */ = {isa = PBXBuildFile; fileRef = 091D8F532C4A7A5000904D6C /* Info-internal.plist */; }; 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 447C5CC95A69FF12C9257FB2 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E43D910A8FBDD1B3B8B6C184 /* Pods_Runner.framework */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; + F365BF06E4DE29C1A0F4AD37 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EF6040A31B9B3427F677A357 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -33,14 +33,16 @@ /* Begin PBXFileReference section */ 091D8F532C4A7A5000904D6C /* Info-internal.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Info-internal.plist"; sourceTree = ""; }; 0978D7E02C6B682E00E3593C /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = ""; }; + 0E20F27B4E3388DD85D34092 /* Pods-Runner.release-production.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release-production.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release-production.xcconfig"; 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 = ""; }; - 185E31E9E1993EC9DBB17D37 /* Pods-Runner.profile-internal.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile-internal.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile-internal.xcconfig"; sourceTree = ""; }; + 20CD993D7628781A98BB8D61 /* Pods-Runner.debug-production.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug-production.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug-production.xcconfig"; sourceTree = ""; }; + 33A9948EB0CFBAFABF34B419 /* Pods-Runner.profile-internal.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile-internal.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile-internal.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 656A2411F3E3051676FAC963 /* Pods-Runner.release-production.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release-production.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release-production.xcconfig"; sourceTree = ""; }; + 3E9187E4CC4327422CCED505 /* Pods-Runner.debug-internal.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug-internal.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug-internal.xcconfig"; sourceTree = ""; }; + 66ECDE59C59320EEB27649AF /* Pods-Runner.profile-production.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile-production.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile-production.xcconfig"; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 76F793943EFFF5235AF71708 /* Pods-Runner.profile-production.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile-production.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile-production.xcconfig"; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; @@ -49,10 +51,8 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - D6B8C418156194DCF6D1361F /* Pods-Runner.release-internal.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release-internal.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release-internal.xcconfig"; sourceTree = ""; }; - E43D910A8FBDD1B3B8B6C184 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - E9361510BEE04590867C8035 /* Pods-Runner.debug-production.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug-production.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug-production.xcconfig"; sourceTree = ""; }; - F6774BF43109D664FE09CA64 /* Pods-Runner.debug-internal.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug-internal.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug-internal.xcconfig"; sourceTree = ""; }; + EF6040A31B9B3427F677A357 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + F5AC233C8E5D1E9A7F17CFAA /* Pods-Runner.release-internal.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release-internal.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release-internal.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -60,13 +60,21 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 447C5CC95A69FF12C9257FB2 /* Pods_Runner.framework in Frameworks */, + F365BF06E4DE29C1A0F4AD37 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 015F8837FF8EA120C0AE0C84 /* Frameworks */ = { + isa = PBXGroup; + children = ( + EF6040A31B9B3427F677A357 /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -85,7 +93,7 @@ 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, C4281BF2C021B5570082F0DC /* Pods */, - A0935CDFC0C13DB809C6DE2B /* Frameworks */, + 015F8837FF8EA120C0AE0C84 /* Frameworks */, ); sourceTree = ""; }; @@ -114,23 +122,15 @@ path = Runner; sourceTree = ""; }; - A0935CDFC0C13DB809C6DE2B /* Frameworks */ = { - isa = PBXGroup; - children = ( - E43D910A8FBDD1B3B8B6C184 /* Pods_Runner.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; C4281BF2C021B5570082F0DC /* Pods */ = { isa = PBXGroup; children = ( - E9361510BEE04590867C8035 /* Pods-Runner.debug-production.xcconfig */, - F6774BF43109D664FE09CA64 /* Pods-Runner.debug-internal.xcconfig */, - 656A2411F3E3051676FAC963 /* Pods-Runner.release-production.xcconfig */, - D6B8C418156194DCF6D1361F /* Pods-Runner.release-internal.xcconfig */, - 76F793943EFFF5235AF71708 /* Pods-Runner.profile-production.xcconfig */, - 185E31E9E1993EC9DBB17D37 /* Pods-Runner.profile-internal.xcconfig */, + 20CD993D7628781A98BB8D61 /* Pods-Runner.debug-production.xcconfig */, + 3E9187E4CC4327422CCED505 /* Pods-Runner.debug-internal.xcconfig */, + 0E20F27B4E3388DD85D34092 /* Pods-Runner.release-production.xcconfig */, + F5AC233C8E5D1E9A7F17CFAA /* Pods-Runner.release-internal.xcconfig */, + 66ECDE59C59320EEB27649AF /* Pods-Runner.profile-production.xcconfig */, + 33A9948EB0CFBAFABF34B419 /* Pods-Runner.profile-internal.xcconfig */, ); path = Pods; sourceTree = ""; @@ -142,14 +142,14 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - 0B3C922396DEC17ABDDD7EE8 /* [CP] Check Pods Manifest.lock */, + BAE7788E4A5C5B329046004F /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - EA6335612301A0C8F3C1D191 /* [CP] Embed Pods Frameworks */, + C948911BA5852B342BB16807 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -209,60 +209,60 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 0B3C922396DEC17ABDDD7EE8 /* [CP] Check Pods Manifest.lock */ = { + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); - inputFileListPaths = ( - ); inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); + name = "Thin Binary"; outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( - "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); - name = "Thin Binary"; + name = "Run Script"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - 9740EEB61CF901F6004384FC /* Run Script */ = { + BAE7788E4A5C5B329046004F /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); + inputFileListPaths = ( + ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( ); - name = "Run Script"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; }; - EA6335612301A0C8F3C1D191 /* [CP] Embed Pods Frameworks */ = { + C948911BA5852B342BB16807 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = (