├── ios ├── Assets │ └── .gitkeep ├── Classes │ ├── Web3AuthFlutterPlugin.h │ ├── Web3AuthFlutterPlugin.m │ └── SwiftWeb3AuthFlutterPlugin.swift ├── .gitignore └── web3auth_flutter.podspec ├── android ├── settings.gradle ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ └── kotlin │ │ └── com │ │ └── web3auth │ │ └── flutter │ │ └── web3auth_flutter │ │ └── Web3AuthFlutterPlugin.kt ├── .gitignore ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── build.gradle ├── consumer_rules.pro └── proguard-rules.pro ├── .pubignore ├── example ├── ios │ ├── Runner │ │ ├── Runner-Bridging-Header.h │ │ ├── Assets.xcassets │ │ │ ├── LaunchImage.imageset │ │ │ │ ├── LaunchImage.png │ │ │ │ ├── LaunchImage@2x.png │ │ │ │ ├── LaunchImage@3x.png │ │ │ │ ├── README.md │ │ │ │ └── Contents.json │ │ │ └── AppIcon.appiconset │ │ │ │ ├── Icon-App-20x20@1x.png │ │ │ │ ├── Icon-App-20x20@2x.png │ │ │ │ ├── Icon-App-20x20@3x.png │ │ │ │ ├── Icon-App-29x29@1x.png │ │ │ │ ├── Icon-App-29x29@2x.png │ │ │ │ ├── Icon-App-29x29@3x.png │ │ │ │ ├── Icon-App-40x40@1x.png │ │ │ │ ├── Icon-App-40x40@2x.png │ │ │ │ ├── Icon-App-40x40@3x.png │ │ │ │ ├── Icon-App-60x60@2x.png │ │ │ │ ├── Icon-App-60x60@3x.png │ │ │ │ ├── Icon-App-76x76@1x.png │ │ │ │ ├── Icon-App-76x76@2x.png │ │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ │ └── Contents.json │ │ ├── AppDelegate.swift │ │ ├── Base.lproj │ │ │ ├── Main.storyboard │ │ │ └── LaunchScreen.storyboard │ │ └── Info.plist │ ├── Flutter │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── AppFrameworkInfo.plist │ ├── Runner.xcodeproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ ├── xcshareddata │ │ │ └── xcschemes │ │ │ │ └── Runner.xcscheme │ │ └── project.pbxproj │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── .gitignore │ ├── Podfile.lock │ └── Podfile ├── android │ ├── app │ │ ├── src │ │ │ ├── main │ │ │ │ ├── res │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── drawable │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ ├── drawable-v21 │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ ├── values │ │ │ │ │ │ └── styles.xml │ │ │ │ │ └── values-night │ │ │ │ │ │ └── styles.xml │ │ │ │ ├── kotlin │ │ │ │ │ └── com │ │ │ │ │ │ └── openlogin │ │ │ │ │ │ └── flutter │ │ │ │ │ │ └── openlogin_flutter_example │ │ │ │ │ │ └── MainActivity.kt │ │ │ │ └── AndroidManifest.xml │ │ │ ├── debug │ │ │ │ └── AndroidManifest.xml │ │ │ └── profile │ │ │ │ └── AndroidManifest.xml │ │ └── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ ├── .gitignore │ ├── build.gradle │ ├── settings.gradle │ └── gradle.properties ├── README.md ├── .gitignore ├── test │ └── widget_test.dart ├── analysis_options.yaml ├── .metadata ├── pubspec.yaml ├── pubspec.lock └── lib │ └── main.dart ├── .vscode └── settings.json ├── analysis_options.yaml ├── .metadata ├── test └── web3auth_flutter_test.dart ├── LICENSE ├── pubspec.yaml ├── lib ├── enums.dart ├── output.dart ├── web3auth_flutter.dart └── input.dart ├── CHANGELOG.md ├── README.md └── .gitignore /ios/Assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'web3auth_flutter' 2 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.pubignore: -------------------------------------------------------------------------------- 1 | example/ 2 | customauth.iml 3 | test/ 4 | .idea/ 5 | build/ -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "lldb.library": "/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/LLDB" 3 | } 4 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /ios/Classes/Web3AuthFlutterPlugin.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface Web3AuthFlutterPlugin : NSObject 4 | @end 5 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Web3Auth/web3auth-flutter-sdk/HEAD/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Web3Auth/web3auth-flutter-sdk/HEAD/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Web3Auth/web3auth-flutter-sdk/HEAD/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Web3Auth/web3auth-flutter-sdk/HEAD/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Web3Auth/web3auth-flutter-sdk/HEAD/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Web3Auth/web3auth-flutter-sdk/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Web3Auth/web3auth-flutter-sdk/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Web3Auth/web3auth-flutter-sdk/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Web3Auth/web3auth-flutter-sdk/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Web3Auth/web3auth-flutter-sdk/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Web3Auth/web3auth-flutter-sdk/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Web3Auth/web3auth-flutter-sdk/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Web3Auth/web3auth-flutter-sdk/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Web3Auth/web3auth-flutter-sdk/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Web3Auth/web3auth-flutter-sdk/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Web3Auth/web3auth-flutter-sdk/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Web3Auth/web3auth-flutter-sdk/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Web3Auth/web3auth-flutter-sdk/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Web3Auth/web3auth-flutter-sdk/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Web3Auth/web3auth-flutter-sdk/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Web3Auth/web3auth-flutter-sdk/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Web3Auth/web3auth-flutter-sdk/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Web3Auth/web3auth-flutter-sdk/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/com/openlogin/flutter/openlogin_flutter_example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.openlogin.flutter.openlogin_flutter_example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | # Additional information about this file can be found at 4 | # https://dart.dev/guides/language/analysis-options 5 | linter: 6 | rules: 7 | constant_identifier_names: false 8 | non_constant_identifier_names: false 9 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 77d935af4db863f6abd0b9c31c7e6df2a13de57b 8 | channel: stable 9 | 10 | project_type: plugin 11 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | allprojects { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | } 6 | } 7 | 8 | rootProject.buildDir = '../build' 9 | subprojects { 10 | project.buildDir = "${rootProject.buildDir}/${project.name}" 11 | } 12 | subprojects { 13 | project.evaluationDependsOn(':app') 14 | } 15 | 16 | tasks.register("clean", Delete) { 17 | delete rootProject.buildDir 18 | } 19 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | import UIKit 3 | 4 | @main 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test/web3auth_flutter_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/services.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | 4 | void main() { 5 | const MethodChannel channel = MethodChannel('web3auth_flutter'); 6 | 7 | TestWidgetsFlutterBinding.ensureInitialized(); 8 | 9 | setUp(() { 10 | channel.setMockMethodCallHandler((MethodCall methodCall) async { 11 | return '42'; 12 | }); 13 | }); 14 | 15 | tearDown(() { 16 | channel.setMockMethodCallHandler(null); 17 | }); 18 | } 19 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/Generated.xcconfig 37 | /Flutter/ephemeral/ 38 | /Flutter/flutter_export_environment.sh -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # web3auth_flutter_example 2 | 3 | Demonstrates how to use the web3auth_flutter plugin. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /ios/Classes/Web3AuthFlutterPlugin.m: -------------------------------------------------------------------------------- 1 | #import "Web3AuthFlutterPlugin.h" 2 | #if __has_include() 3 | #import 4 | #else 5 | // Support project import fallback if the generated compatibility header 6 | // is not copied when this plugin is created as a library. 7 | // https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816 8 | #import "web3auth_flutter-Swift.h" 9 | #endif 10 | 11 | @implementation Web3AuthFlutterPlugin 12 | + (void)registerWithRegistrar:(NSObject*)registrar { 13 | [SwiftWeb3AuthFlutterPlugin registerWithRegistrar:registrar]; 14 | } 15 | @end 16 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | def flutterSdkPath = { 3 | def properties = new Properties() 4 | file("local.properties").withInputStream { properties.load(it) } 5 | def flutterSdkPath = properties.getProperty("flutter.sdk") 6 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 7 | return flutterSdkPath 8 | }() 9 | 10 | includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") 11 | 12 | repositories { 13 | google() 14 | mavenCentral() 15 | gradlePluginPortal() 16 | } 17 | } 18 | 19 | plugins { 20 | id "com.android.application" version "8.1.4" apply false 21 | id "org.jetbrains.kotlin.android" version "1.9.24" apply false 22 | id "dev.flutter.flutter-plugin-loader" version "1.0.0" 23 | } 24 | 25 | include ":app" 26 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 12.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | ## For more details on how to configure your build environment visit 2 | # http://www.gradle.org/docs/current/userguide/build_environment.html 3 | # 4 | # Specifies the JVM arguments used for the daemon process. 5 | # The setting is particularly useful for tweaking memory settings. 6 | # Default value: -Xmx1024m -XX:MaxPermSize=256m 7 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 8 | # 9 | # When configured, Gradle will run in incubating parallel mode. 10 | # This option should only be used with decoupled projects. More details, visit 11 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 12 | # org.gradle.parallel=true 13 | #Thu Feb 03 10:03:40 HKT 2022 14 | org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M" 15 | android.useAndroidX=true 16 | android.enableJetifier=true 17 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Android Studio will place build artifacts here 44 | /android/app/debug 45 | /android/app/profile 46 | /android/app/release 47 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:web3auth_flutter_example/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Verify Platform version', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(const MyApp()); 17 | 18 | // Verify that platform version is retrieved. 19 | expect( 20 | find.byWidgetPredicate( 21 | (Widget widget) => 22 | widget is Text && widget.data!.startsWith('Running on:'), 23 | ), 24 | findsOneWidget, 25 | ); 26 | }); 27 | } 28 | -------------------------------------------------------------------------------- /ios/web3auth_flutter.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. 3 | # Run `pod lib lint web3auth_flutter.podspec` to validate before publishing. 4 | # 5 | Pod::Spec.new do |s| 6 | s.name = 'web3auth_flutter' 7 | s.version = '2.0.1' 8 | s.summary = 'Flutter SDK for Torus Web3Auth' 9 | s.description = <<-DESC 10 | Flutter SDK for Torus Web3Auth (OpenLogin) 11 | DESC 12 | s.homepage = 'https://web3auth.io' 13 | s.license = { :file => '../LICENSE' } 14 | s.author = { 'Web3Auth' => 'hello@web3auth.io' } 15 | s.source = { :path => '.' } 16 | s.source_files = 'Classes/**/*' 17 | s.dependency 'Flutter' 18 | s.dependency 'Web3Auth', '~> 11.1.0' 19 | s.platform = :ios, '14.0' 20 | 21 | # Flutter.framework does not contain a i386 slice. 22 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } 23 | s.swift_version = '5.0' 24 | end 25 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Torus Labs Private Limited 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | group 'com.web3auth.flutter.web3auth_flutter' 2 | version '1.0-SNAPSHOT' 3 | 4 | buildscript { 5 | ext.kotlin_version = '1.9.24' 6 | repositories { 7 | google() 8 | mavenCentral() 9 | } 10 | 11 | dependencies { 12 | classpath 'com.android.tools.build:gradle:8.1.4' 13 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 14 | } 15 | } 16 | 17 | rootProject.allprojects { 18 | repositories { 19 | google() 20 | mavenCentral() 21 | maven { url "https://jitpack.io" } 22 | } 23 | } 24 | 25 | apply plugin: 'com.android.library' 26 | apply plugin: 'kotlin-android' 27 | 28 | android { 29 | namespace = "com.web3auth.flutter.web3auth_flutter" 30 | 31 | compileSdkVersion 34 32 | 33 | compileOptions { 34 | sourceCompatibility JavaVersion.VERSION_1_8 35 | targetCompatibility JavaVersion.VERSION_1_8 36 | } 37 | 38 | kotlinOptions { 39 | jvmTarget = '1.8' 40 | } 41 | 42 | sourceSets { 43 | main.java.srcDirs += 'src/main/kotlin' 44 | } 45 | 46 | defaultConfig { 47 | minSdkVersion 26 48 | } 49 | } 50 | 51 | dependencies { 52 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 53 | implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3' 54 | implementation 'com.github.Web3Auth:web3auth-android-sdk:9.1.3' 55 | implementation 'com.google.code.gson:gson:2.10.1' 56 | } 57 | -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - BigInt (5.2.0) 3 | - curvelib.swift (2.0.0) 4 | - Flutter (1.0.0) 5 | - KeychainSwift (20.0.0) 6 | - TorusSessionManager (6.0.2): 7 | - curvelib.swift (~> 2.0.0) 8 | - KeychainSwift (~> 20.0.0) 9 | - Web3Auth (11.0.5): 10 | - BigInt (~> 5.2.0) 11 | - curvelib.swift (~> 2.0.0) 12 | - KeychainSwift (~> 20.0.0) 13 | - TorusSessionManager (~> 6.0.2) 14 | - web3auth_flutter (2.0.1): 15 | - Flutter 16 | - Web3Auth (~> 11.0.5) 17 | 18 | DEPENDENCIES: 19 | - Flutter (from `Flutter`) 20 | - web3auth_flutter (from `.symlinks/plugins/web3auth_flutter/ios`) 21 | 22 | SPEC REPOS: 23 | https://github.com/CocoaPods/Specs.git: 24 | - BigInt 25 | - curvelib.swift 26 | - KeychainSwift 27 | - TorusSessionManager 28 | - Web3Auth 29 | 30 | EXTERNAL SOURCES: 31 | Flutter: 32 | :path: Flutter 33 | web3auth_flutter: 34 | :path: ".symlinks/plugins/web3auth_flutter/ios" 35 | 36 | SPEC CHECKSUMS: 37 | BigInt: f668a80089607f521586bbe29513d708491ef2f7 38 | curvelib.swift: b9223e5cac801effed8a5fe8968e952b3fe427a5 39 | Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 40 | KeychainSwift: 0ce6a4d13f7228054d1a71bb1b500448fb2ab837 41 | TorusSessionManager: 3c47c2a4c4d6173a10006eb0af4b86317ee45ff8 42 | Web3Auth: cf501e2bccf63d7a9746c0e53eb98cf143841a5c 43 | web3auth_flutter: 79be94bbb719a1837c79e0c07e793abd64e11dd7 44 | 45 | PODFILE CHECKSUM: 1d58595b82b880200a7ded05da9181d30ef8c1b7 46 | 47 | COCOAPODS: 1.14.2 48 | -------------------------------------------------------------------------------- /android/consumer_rules.pro: -------------------------------------------------------------------------------- 1 | # Keep Kotlin metadata 2 | -keepclassmembers class ** { 3 | @kotlin.Metadata *; 4 | } 5 | 6 | # Keep public classes and members of your SDK 7 | -keep class com.web3auth.** { *; } 8 | 9 | # If using Gson (for JSON parsing) 10 | -keep class com.google.gson.** { *; } 11 | -keepattributes *Annotation* 12 | -keepclassmembers class * { 13 | @com.google.gson.annotations.SerializedName ; 14 | } 15 | 16 | # Keep method names and constructor params 17 | -keepattributes Signature, InnerClasses, EnclosingMethod, *Annotation*, SourceFile, LineNumberTable 18 | 19 | # If you use coroutines or lambdas 20 | -keep class kotlinx.coroutines.** { *; } 21 | -dontwarn kotlinx.coroutines.** 22 | 23 | # To avoid stripping methods like getError(), setCustomTabsClosed(), etc. 24 | -keepclassmembers class ** { 25 | *** getError(...); 26 | void setCustomTabsClosed(...); 27 | } 28 | 29 | # Preserve Kotlin metadata and parameter names 30 | -keepattributes *Annotation*, Signature, InnerClasses, EnclosingMethod 31 | -keep class kotlin.Metadata { *; } 32 | -keepclassmembers class ** { 33 | @kotlin.Metadata *; 34 | } 35 | 36 | # Optional: Keep your SDK class and its methods fully 37 | -keep class com.web3auth.flutter.web3auth_flutter.Web3AuthFlutterPlugin { 38 | *; 39 | } 40 | 41 | -keepclassmembers class com.web3auth.core.Web3Auth { 42 | public static ; 43 | } 44 | 45 | # Preserve the entire Kotlin object class (prevents it from being removed/renamed) 46 | -keep class com.web3auth.core.types.Web3AuthError { 47 | *; 48 | } 49 | -------------------------------------------------------------------------------- /android/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Keep Kotlin metadata 2 | -keepclassmembers class ** { 3 | @kotlin.Metadata *; 4 | } 5 | 6 | # Keep public classes and members of your SDK 7 | -keep class com.web3auth.** { *; } 8 | 9 | # If using Gson (for JSON parsing) 10 | -keep class com.google.gson.** { *; } 11 | -keepattributes *Annotation* 12 | -keepclassmembers class * { 13 | @com.google.gson.annotations.SerializedName ; 14 | } 15 | 16 | # Keep method names and constructor params 17 | -keepattributes Signature, InnerClasses, EnclosingMethod, *Annotation*, SourceFile, LineNumberTable 18 | 19 | # If you use coroutines or lambdas 20 | -keep class kotlinx.coroutines.** { *; } 21 | -dontwarn kotlinx.coroutines.** 22 | 23 | # To avoid stripping methods like getError(), setCustomTabsClosed(), etc. 24 | -keepclassmembers class ** { 25 | *** getError(...); 26 | void setCustomTabsClosed(...); 27 | } 28 | 29 | # Preserve Kotlin metadata and parameter names 30 | -keepattributes *Annotation*, Signature, InnerClasses, EnclosingMethod 31 | -keep class kotlin.Metadata { *; } 32 | -keepclassmembers class ** { 33 | @kotlin.Metadata *; 34 | } 35 | 36 | # Optional: Keep your SDK class and its methods fully 37 | -keep class com.web3auth.flutter.web3auth_flutter.Web3AuthFlutterPlugin { 38 | *; 39 | } 40 | 41 | -keepclassmembers class com.web3auth.core.Web3Auth { 42 | public static ; 43 | } 44 | 45 | # Preserve the entire Kotlin object class (prevents it from being removed/renamed) 46 | -keep class com.web3auth.core.types.Web3AuthError { 47 | *; 48 | } 49 | -------------------------------------------------------------------------------- /example/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | platform :ios, '14.0' 3 | 4 | source 'https://github.com/CocoaPods/Specs.git' 5 | 6 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 7 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 8 | 9 | project 'Runner', { 10 | 'Debug' => :debug, 11 | 'Profile' => :release, 12 | 'Release' => :release, 13 | } 14 | 15 | def flutter_root 16 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 17 | unless File.exist?(generated_xcode_build_settings_path) 18 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 19 | end 20 | 21 | File.foreach(generated_xcode_build_settings_path) do |line| 22 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 23 | return matches[1].strip if matches 24 | end 25 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 26 | end 27 | 28 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 29 | 30 | flutter_ios_podfile_setup 31 | 32 | target 'Runner' do 33 | use_frameworks! 34 | use_modular_headers! 35 | 36 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 37 | end 38 | 39 | post_install do |installer| 40 | installer.pods_project.targets.each do |target| 41 | flutter_additional_ios_build_settings(target) 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: "2663184aa79047d0a33a14a3b607954f8fdd8730" 8 | channel: "stable" 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730 17 | base_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730 18 | - platform: android 19 | create_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730 20 | base_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730 21 | - platform: ios 22 | create_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730 23 | base_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730 24 | - platform: linux 25 | create_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730 26 | base_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730 27 | - platform: macos 28 | create_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730 29 | base_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730 30 | - platform: web 31 | create_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730 32 | base_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730 33 | - platform: windows 34 | create_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730 35 | base_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730 36 | 37 | # User provided section 38 | 39 | # List of Local paths (relative to this file) that should be 40 | # ignored by the migrate tool. 41 | # 42 | # Files that are not part of the templates will be ignored by default. 43 | unmanaged_files: 44 | - 'lib/main.dart' 45 | - 'ios/Runner.xcodeproj/project.pbxproj' 46 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "com.android.application" 3 | id "kotlin-android" 4 | id "dev.flutter.flutter-gradle-plugin" 5 | } 6 | 7 | def localProperties = new Properties() 8 | def localPropertiesFile = rootProject.file('local.properties') 9 | if (localPropertiesFile.exists()) { 10 | localPropertiesFile.withReader('UTF-8') { reader -> 11 | localProperties.load(reader) 12 | } 13 | } 14 | 15 | 16 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 17 | if (flutterVersionCode == null) { 18 | flutterVersionCode = '1' 19 | } 20 | 21 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 22 | if (flutterVersionName == null) { 23 | flutterVersionName = '1.0' 24 | } 25 | 26 | android { 27 | namespace "com.web3auth.flutter.web3auth_flutter_example" 28 | compileSdkVersion flutter.compileSdkVersion 29 | 30 | compileOptions { 31 | sourceCompatibility JavaVersion.VERSION_1_8 32 | targetCompatibility JavaVersion.VERSION_1_8 33 | } 34 | 35 | kotlinOptions { 36 | jvmTarget = '1.8' 37 | } 38 | 39 | sourceSets { 40 | main.java.srcDirs += 'src/main/kotlin' 41 | } 42 | 43 | defaultConfig { 44 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 45 | compileSdkVersion 34 46 | applicationId "com.web3auth.flutter.web3auth_flutter_example" 47 | minSdkVersion 26 48 | targetSdkVersion flutter.targetSdkVersion 49 | versionCode flutterVersionCode.toInteger() 50 | versionName flutterVersionName 51 | } 52 | 53 | buildTypes { 54 | release { 55 | // TODO: Add your own signing config for the release build. 56 | // Signing with the debug keys for now, so `flutter run --release` works. 57 | signingConfig signingConfigs.debug 58 | } 59 | } 60 | } 61 | 62 | flutter { 63 | source '../..' 64 | } 65 | 66 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CADisableMinimumFrameDurationOnPhone 6 | 7 | CFBundleDevelopmentRegion 8 | $(DEVELOPMENT_LANGUAGE) 9 | CFBundleDisplayName 10 | Web3Auth Flutter 11 | CFBundleExecutable 12 | $(EXECUTABLE_NAME) 13 | CFBundleIdentifier 14 | $(PRODUCT_BUNDLE_IDENTIFIER) 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | web3auth_flutter_example 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | $(FLUTTER_BUILD_NAME) 23 | CFBundleSignature 24 | ???? 25 | CFBundleURLTypes 26 | 27 | 28 | CFBundleTypeRole 29 | Editor 30 | CFBundleURLName 31 | org.torusresearch.flutter.web3authexample 32 | CFBundleURLSchemes 33 | 34 | torusapp 35 | 36 | 37 | 38 | CFBundleVersion 39 | $(FLUTTER_BUILD_NUMBER) 40 | FlutterDeepLinkingEnabled 41 | 42 | LSRequiresIPhoneOS 43 | 44 | UIApplicationSupportsIndirectInputEvents 45 | 46 | UILaunchStoryboardName 47 | LaunchScreen 48 | UIMainStoryboardFile 49 | Main 50 | UISupportedInterfaceOrientations 51 | 52 | UIInterfaceOrientationPortrait 53 | UIInterfaceOrientationLandscapeLeft 54 | UIInterfaceOrientationLandscapeRight 55 | 56 | UISupportedInterfaceOrientations~ipad 57 | 58 | UIInterfaceOrientationPortrait 59 | UIInterfaceOrientationPortraitUpsideDown 60 | UIInterfaceOrientationLandscapeLeft 61 | UIInterfaceOrientationLandscapeRight 62 | 63 | UIViewControllerBasedStatusBarAppearance 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: web3auth_flutter 2 | description: Flutter SDK for Torus Web3Auth (Web3Auth) 3 | version: 6.3.0 4 | homepage: https://web3auth.io 5 | repository: https://github.com/Web3Auth/web3auth-flutter-sdk.git 6 | 7 | environment: 8 | sdk: ">=2.15.1 <4.0.0" 9 | flutter: ">=2.5.0" 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | 15 | dev_dependencies: 16 | flutter_test: 17 | sdk: flutter 18 | flutter_lints: ^4.0.0 19 | 20 | # For information on the generic Dart part of this file, see the 21 | # following page: https://dart.dev/tools/pub/pubspec 22 | 23 | # The following section is specific to Flutter. 24 | flutter: 25 | # This section identifies this Flutter project as a plugin project. 26 | # The 'pluginClass' and Android 'package' identifiers should not ordinarily 27 | # be modified. They are used by the tooling to maintain consistency when 28 | # adding or updating assets for this project. 29 | plugin: 30 | platforms: 31 | android: 32 | package: com.web3auth.flutter.web3auth_flutter 33 | pluginClass: Web3AuthFlutterPlugin 34 | ios: 35 | pluginClass: Web3AuthFlutterPlugin 36 | 37 | # To add assets to your plugin package, add an assets section, like this: 38 | # assets: 39 | # - images/a_dot_burr.jpeg 40 | # - images/a_dot_ham.jpeg 41 | # 42 | # For details regarding assets in packages, see 43 | # https://flutter.dev/assets-and-images/#from-packages 44 | # 45 | # An image asset can refer to one or more resolution-specific "variants", see 46 | # https://flutter.dev/assets-and-images/#resolution-aware. 47 | 48 | # To add custom fonts to your plugin package, add a fonts section here, 49 | # in this "flutter" section. Each entry in this list should have a 50 | # "family" key with the font family name, and a "fonts" key with a 51 | # list giving the asset and other descriptors for the font. For 52 | # example: 53 | # fonts: 54 | # - family: Schyler 55 | # fonts: 56 | # - asset: fonts/Schyler-Regular.ttf 57 | # - asset: fonts/Schyler-Italic.ttf 58 | # style: italic 59 | # - family: Trajan Pro 60 | # fonts: 61 | # - asset: fonts/TrajanPro.ttf 62 | # - asset: fonts/TrajanPro_Bold.ttf 63 | # weight: 700 64 | # 65 | # For details regarding fonts in packages, see 66 | # https://flutter.dev/custom-fonts/#from-packages 67 | -------------------------------------------------------------------------------- /lib/enums.dart: -------------------------------------------------------------------------------- 1 | enum Network { mainnet, testnet, cyan, aqua, sapphire_devnet, sapphire_mainnet } 2 | 3 | enum BuildEnv { production, staging, testing } 4 | 5 | enum ChainNamespace { eip155, solana } 6 | 7 | enum Language { en, de, ja, ko, zh, es, fr, pt, nl , tr} 8 | 9 | enum ThemeModes { light, dark, auto } 10 | 11 | enum Provider { 12 | google, 13 | facebook, 14 | reddit, 15 | discord, 16 | twitch, 17 | github, 18 | apple, 19 | linkedin, 20 | twitter, 21 | line, 22 | kakao, 23 | email_passwordless, 24 | jwt, 25 | sms_passwordless, 26 | farcaster, 27 | } 28 | 29 | enum TypeOfLogin { 30 | google, 31 | facebook, 32 | reddit, 33 | discord, 34 | twitch, 35 | github, 36 | apple, 37 | kakao, 38 | linkedin, 39 | twitter, 40 | weibo, 41 | wechat, 42 | line, 43 | email_passwordless, 44 | email_password, 45 | jwt, 46 | sms_passwordless, 47 | farcaster, 48 | } 49 | 50 | enum Display { 51 | /// Displays the UI with a full page view. 52 | page, 53 | 54 | /// Displays the UI with a popup window. 55 | popup, 56 | 57 | /// Displays the UI in a way that leverages a touch interface. 58 | touch, 59 | 60 | /// Displays the UI with a "feature phone" type interface. 61 | wap, 62 | } 63 | 64 | enum MFALevel { 65 | /// Presents the MFA screen every third login. 66 | DEFAULT, 67 | /// Presents the MFA screen on every login, but user can skip it. 68 | OPTIONAL, 69 | /// Make it mandatory for users to set up MFA after login. 70 | MANDATORY, 71 | /// Skips the MFA setup screen. 72 | NONE, 73 | } 74 | 75 | extension MFALevelExtension on MFALevel { 76 | String get type { 77 | switch (this) { 78 | case MFALevel.DEFAULT: 79 | return "default"; 80 | case MFALevel.OPTIONAL: 81 | return "optional"; 82 | case MFALevel.MANDATORY: 83 | return "mandatory"; 84 | case MFALevel.NONE: 85 | return "none"; 86 | default: 87 | return "default"; 88 | } 89 | } 90 | } 91 | 92 | enum Prompt { 93 | /// Do not prompt user for login or consent on re-authentication. 94 | none, 95 | 96 | /// Prompt user for re-authentication. 97 | login, 98 | 99 | /// Prompt user for consent before processing request. 100 | consent, 101 | 102 | /// Prompt user to select an account. 103 | select_account, 104 | } 105 | 106 | enum Curve { secp256k1, ed25519 } 107 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 9 | 17 | 21 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 39 | 40 | 41 | 43 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 53 | 55 | 61 | 62 | 63 | 64 | 70 | 72 | 78 | 79 | 80 | 81 | 83 | 84 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: web3auth_flutter_example 2 | description: Demonstrates how to use the web3auth_flutter plugin. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `flutter pub publish`. This is preferred for private packages. 6 | publish_to: "none" # Remove this line if you wish to publish to pub.dev 7 | 8 | environment: 9 | sdk: ">=2.15.1" 10 | 11 | # Dependencies specify other packages that your package needs in order to work. 12 | # To automatically upgrade your package dependencies to the latest versions 13 | # consider running `flutter pub upgrade --major-versions`. Alternatively, 14 | # dependencies can be manually updated by changing the version numbers below to 15 | # the latest version available on pub.dev. To see which dependencies have newer 16 | # versions available, run `flutter pub outdated`. 17 | dependencies: 18 | flutter: 19 | sdk: flutter 20 | 21 | web3auth_flutter: 22 | # When depending on this package from a real application you should use: 23 | # web3auth_flutter: ^x.y.z 24 | # See https://dart.dev/tools/pub/dependencies#version-constraints 25 | # The example app is bundled with the plugin so we use a path dependency on 26 | # the parent directory to use the current plugin's version. 27 | path: ../ 28 | 29 | # The following adds the Cupertino Icons font to your application. 30 | # Use with the CupertinoIcons class for iOS style icons. 31 | cupertino_icons: ^1.0.8 32 | web3dart: ^2.7.3 33 | 34 | dev_dependencies: 35 | flutter_test: 36 | sdk: flutter 37 | 38 | # The "flutter_lints" package below contains a set of recommended lints to 39 | # encourage good coding practices. The lint set provided by the package is 40 | # activated in the `analysis_options.yaml` file located at the root of your 41 | # package. See that file for information about deactivating specific lint 42 | # rules and activating additional ones. 43 | flutter_lints: ^3.0.0 44 | 45 | # For information on the generic Dart part of this file, see the 46 | # following page: https://dart.dev/tools/pub/pubspec 47 | 48 | # The following section is specific to Flutter. 49 | flutter: 50 | # The following line ensures that the Material Icons font is 51 | # included with your application, so that you can use the icons in 52 | # the material Icons class. 53 | uses-material-design: true 54 | 55 | # To add assets to your application, add an assets section, like this: 56 | # assets: 57 | # - images/a_dot_burr.jpeg 58 | # - images/a_dot_ham.jpeg 59 | 60 | # An image asset can refer to one or more resolution-specific "variants", see 61 | # https://flutter.dev/assets-and-images/#resolution-aware. 62 | 63 | # For details regarding adding assets from package dependencies, see 64 | # https://flutter.dev/assets-and-images/#from-packages 65 | 66 | # To add custom fonts to your application, add a fonts section here, 67 | # in this "flutter" section. Each entry in this list should have a 68 | # "family" key with the font family name, and a "fonts" key with a 69 | # list giving the asset and other descriptors for the font. For 70 | # example: 71 | # fonts: 72 | # - family: Schyler 73 | # fonts: 74 | # - asset: fonts/Schyler-Regular.ttf 75 | # - asset: fonts/Schyler-Italic.ttf 76 | # style: italic 77 | # - family: Trajan Pro 78 | # fonts: 79 | # - asset: fonts/TrajanPro.ttf 80 | # - asset: fonts/TrajanPro_Bold.ttf 81 | # weight: 700 82 | # 83 | # For details regarding fonts from package dependencies, 84 | # see https://flutter.dev/custom-fonts/#from-packages 85 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.1 2 | 3 | * Initial release with same API surface of the Android and iOS SDK. 4 | 5 | ## 0.0.2 6 | 7 | * Add support for latest Android and iOS SDK API. 8 | 9 | ## 1.0.0 10 | 11 | * Fd 749 rebranding to web3auth. 12 | * white label data added. 13 | * feat: fix pubspec according to pub recommendation. 14 | * chore: fix for pub check. 15 | * fix: android deps on mfalevel. 16 | 17 | ## 1.0.2 18 | 19 | * New UI and builds on iOS. 20 | * Update README.md. 21 | * Add id_token to ExtraLoginOptions. 22 | 23 | ## 1.0.3 24 | 25 | * JWT login fixes. 26 | 27 | ## 1.1.0 28 | 29 | * Update app manifest.xml to work with android sdk. 30 | * version bump. 31 | * Web3auth swift sdk update to 5.0.0. 32 | * Bump web3auth android sdk. 33 | 34 | ## 1.1.1 35 | 36 | * Added Web3Auth instance initialization check. 37 | 38 | ## 1.1.2 39 | 40 | * Bump Web3Auth android sdk version. 41 | 42 | ## 1.2.0 43 | 44 | * Bump android versions. 45 | 46 | ## 1.3.0 47 | 48 | * Update version and added community portal link. 49 | * Update README.md. 50 | * bump web3Auth android sdk. 51 | * Bump Web3Auth android sdk version. 52 | * Resolved issues in case of weak/no network. 53 | 54 | ## 2.0.0 55 | 56 | * Bump web3Auth android sdk. 57 | * Feat/android fixes. 58 | * Corekit flag added 59 | 60 | ## 2.0.1 61 | 62 | * Update readme. 63 | * Bump android sdk 64 | 65 | ## 2.0.2 66 | 67 | * Bump web3auth-android-sdk. 68 | 69 | ## 2.0.3 70 | 71 | * Bump android sdk. 72 | 73 | ## 3.0.0 74 | 75 | * Sapphire network and openlogin v5 changes added for android. 76 | 77 | ## 3.0.1 78 | 79 | * Add support for latest Android and iOS SDK API. 80 | 81 | 82 | ## 0.0.2 83 | 84 | * Bump android version 85 | * Bug fixes 86 | 87 | ## 3.1.0 88 | 89 | * feat: add sessionTime in mfaSettings. 90 | * Bump web3auth android sdk. 91 | * Update openlogin version. 92 | 93 | 94 | ## 3.1.1 95 | 96 | * Update android and ios versions. 97 | 98 | ## 3.1.2 99 | 100 | * Fix typo for appName. 101 | * Fix: typos. 102 | 103 | ## 3.1.3 104 | 105 | * Fix sessionTime issue of always being default. 106 | 107 | ## 3.1.4 108 | 109 | * Update README. 110 | * Fix Android issues. 111 | 112 | ## 3.1.5 113 | 114 | * Update iOS SDK. 115 | 116 | ## 3.1.6 117 | 118 | * Update duration in setResultUrl. 119 | 120 | ## 3.1.7 121 | 122 | * Interface documentation. 123 | 124 | ## 4.0.0 125 | 126 | * Feat/message signing. 127 | * Remove setResultUrl method. 128 | * Update README. 129 | * Add TextField for Email Passwordless in Demo. 130 | 131 | ## 5.0.0 132 | 133 | * Add setCustomTabsClosed Method to handle UserCancellation exception. 134 | * Feat/config api updates. 135 | 136 | ## 5.0.1 137 | 138 | * Code refactored for User cancellation during login. 139 | 140 | ## 5.0.2 141 | 142 | * Align useLogoLoader default value with Android and iOS SDK. 143 | 144 | ## 5.0.3 145 | 146 | * Android sdk updated. 147 | 148 | ## 5.0.4 149 | 150 | * Feat: bump android sdk deps. 151 | * Feat: update library dependencies and update flutter sdk version. 152 | 153 | ## 6.0.0 154 | 155 | * Update code documentation. 156 | * Feat: auth-services v9 changes and wallet-services v3 changes added. 157 | 158 | ## 6.0.1 159 | 160 | * Update auth-service version to v9 and wallet-service to v3. 161 | 162 | ## 6.1.0 163 | 164 | * Update README. 165 | * Swift pnp dependency updated 166 | 167 | ## 6.1.1 168 | 169 | * Update sessionTime documentation. 170 | * Feat: update pnp android sdk deps. 171 | 172 | ## 6.1.2 173 | 174 | * Bump swift sdk and pubspec.yaml. 175 | 176 | ## 6.2.0 177 | 178 | * Add manageMFA functionality. 179 | 180 | 181 | 182 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Web3Auth Flutter SDK 2 | 3 | Web3Auth is where passwordless auth meets non-custodial key infrastructure for Web3 apps and wallets. By aggregating OAuth (Google, Twitter, Discord) logins, different wallets and innovative Multi Party Computation (MPC) - Web3Auth provides a seamless login experience to every user on your application. 4 | 5 | ## 📖 Documentation 6 | 7 | Checkout the official [Web3Auth Documentation](https://web3auth.io/docs) and [SDK Reference](https://web3auth.io/docs/sdk/pnp/flutter) to get started! 8 | 9 | ## 💡 Features 10 | 11 | - Plug and Play, OAuth based Web3 Authentication Service 12 | - Fully decentralized, non-custodial key infrastructure 13 | - End to end Whitelabelable solution 14 | - Threshold Cryptography based Key Reconstruction 15 | - Multi Factor Authentication Setup & Recovery (Includes password, backup 16 | phrase, device factor editing/deletion etc) 17 | - Support for WebAuthn & Passwordless Login 18 | - Support for connecting to multiple wallets 19 | - DApp Active Session Management 20 | 21 | ...and a lot more 22 | 23 | ## ⏪ Requirements 24 | 25 | - For iOS, only iOS 14+ supported since we requires ASWebAuthenticationSession. 26 | - Xcode 11.4+ / 12.x 27 | - Swift 4.x / 5.x 28 | - For iOS build: `platform :ios` needs to be `14.0`. Check `ios/Podfile` in 29 | your Flutter project to change it. 30 | - For Android, API version 26 or newer is supported. 31 | - For Android build: compileSdkVersion needs to be 34. 32 | - Check `android/app/build.gradle` in your Flutter project to change it. 33 | 34 | ## ⚡ Installation 35 | 36 | Add `web3auth_flutter` as a dependency to your `pubspec.yaml` file. 37 | 38 | ```yml 39 | dependencies: 40 | web3auth_flutter: ^6.1.2 41 | ``` 42 | 43 | or 44 | 45 | ```sh 46 | flutter pub add web3auth_flutter 47 | ``` 48 | 49 | ## 🌟 Configuration 50 | 51 | Checkout [SDK Reference](https://web3auth.io/docs/sdk/pnp/flutter/install) to configure for Android and iOS 52 | builds. 53 | 54 | ## 🩹 Example 55 | 56 | Checkout the examples for your preferred blockchain and platform in our [examples](https://web3auth.io/docs/examples) 57 | 58 | ```dart 59 | // Initialization 60 | await Web3AuthFlutter.init( 61 | Web3AuthOptions( 62 | // Get your client it from dashboard.web3auth.io 63 | clientId: 'YOUR_WEB3AUTH_CLIENT_ID', 64 | network: Network.sapphire_devnet, 65 | // Your redirect url, check how to configure. 66 | // Android: https://web3auth.io/docs/sdk/pnp/flutter/install#android-configuration 67 | // iOS: https://web3auth.io/docs/sdk/pnp/flutter/install#ios-configuration 68 | redirectUrl: redirectUrl, 69 | ), 70 | ); 71 | 72 | // Call initialize() function to get privKey and user information without relogging in 73 | // user if a user has an active session. If no active session is present, the 74 | // function throws an error. 75 | await Web3AuthFlutter.initialize(); 76 | 77 | // Login 78 | await Web3AuthFlutter.login(LoginParams(loginProvider: Provider.google)); 79 | 80 | // Logout 81 | await Web3AuthFlutter.logout(); 82 | ``` 83 | 84 | ## Triggering UserCancellation on Android 85 | 86 | On Android, if you want to trigger exception for user closing the browser tab, you have to use 87 | `WidgetsBindingObserver` mixin with your your login screen. 88 | 89 | ```dart 90 | class LoginScreen extends State with WidgetsBindingObserver { 91 | 92 | @override 93 | void initState() { 94 | super.initState(); 95 | WidgetsBinding.instance.addObserver(this); 96 | } 97 | @override 98 | void dispose() { 99 | super.dispose(); 100 | WidgetsBinding.instance.removeObserver(this); 101 | } 102 | @override 103 | void didChangeAppLifecycleState(final AppLifecycleState state) { 104 | // This is important to trigger the user cancellation on Android. 105 | if (state == AppLifecycleState.resumed) { 106 | Web3AuthFlutter.setCustomTabsClosed(); 107 | } 108 | } 109 | 110 | @override 111 | Widget build(BuildContext context) { 112 | // Your UI code 113 | } 114 | Future _login() async { 115 | try { 116 | await Web3AuthFlutter.login(LoginParams(loginProvider: Provider.google)); 117 | } on UserCancelledException { 118 | log("User cancelled."); 119 | } on UnKnownException { 120 | log("Unknown exception occurred"); 121 | } catch (e) { 122 | log(e.toString()); 123 | } 124 | } 125 | } 126 | ``` 127 | 128 | ## 🌐 Demo 129 | 130 | Checkout the [Web3Auth Demo](https://demo-app.web3auth.io/) to see how Web3Auth can be used in an application. 131 | 132 | Have a look at our [Web3Auth PnP Flutter Quick Start](https://web3auth.io/docs/quick-start?product=PNP&sdk=PNP_FLUTTER&framework=IOS&stepIndex=0) to help you quickly integrate a basic instance of Web3Auth Plug and Play in your Flutter app. 133 | 134 | Further checkout the [example folder](https://github.com/Web3Auth/web3auth-flutter-sdk/tree/master/example) within this repository, which contains a sample app. 135 | 136 | ## 💬 Troubleshooting and Support 137 | 138 | - Have a look at our [Community Portal](https://community.web3auth.io/) to see if anyone has any questions or issues you might be having. Feel free to create new topics and we'll help you out as soon as possible. 139 | - Checkout our [Troubleshooting Documentation Page](https://web3auth.io/docs/troubleshooting) to know the common issues and solutions. 140 | - For Priority Support, please have a look at our [Pricing Page](https://web3auth.io/pricing.html) for the plan that suits your needs. 141 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. 25 | /pubspec.lock 26 | **/doc/api/ 27 | .dart_tool/ 28 | .packages 29 | build/ 30 | 31 | 32 | # Created by https://www.toptal.com/developers/gitignore/api/flutter,macos,android,androidstudio,xcode 33 | # Edit at https://www.toptal.com/developers/gitignore?templates=flutter,macos,android,androidstudio,xcode 34 | 35 | ### Android ### 36 | # Gradle files 37 | .gradle/ 38 | build/ 39 | 40 | # Local configuration file (sdk path, etc) 41 | local.properties 42 | 43 | # Log/OS Files 44 | *.log 45 | 46 | # Android Studio generated files and folders 47 | captures/ 48 | .externalNativeBuild/ 49 | .cxx/ 50 | *.apk 51 | output.json 52 | 53 | # IntelliJ 54 | *.iml 55 | .idea/ 56 | 57 | # Keystore files 58 | *.jks 59 | *.keystore 60 | 61 | # Google Services (e.g. APIs or Firebase) 62 | google-services.json 63 | 64 | # Android Profiling 65 | *.hprof 66 | 67 | ### Android Patch ### 68 | gen-external-apklibs 69 | 70 | # Replacement of .externalNativeBuild directories introduced 71 | # with Android Studio 3.5. 72 | 73 | ### Flutter ### 74 | # Flutter/Dart/Pub related 75 | **/doc/api/ 76 | .dart_tool/ 77 | .flutter-plugins 78 | .flutter-plugins-dependencies 79 | .fvm/ 80 | .packages 81 | .pub-cache/ 82 | .pub/ 83 | coverage/ 84 | lib/generated_plugin_registrant.dart 85 | # For library packages, don’t commit the pubspec.lock file. 86 | # Regenerating the pubspec.lock file lets you test your package against the latest compatible versions of its dependencies. 87 | # See https://dart.dev/guides/libraries/private-files#pubspeclock 88 | #pubspec.lock 89 | 90 | # Android related 91 | **/android/**/gradle-wrapper.jar 92 | **/android/.gradle 93 | **/android/captures/ 94 | **/android/gradlew 95 | **/android/gradlew.bat 96 | **/android/key.properties 97 | **/android/local.properties 98 | **/android/**/GeneratedPluginRegistrant.java 99 | 100 | # iOS/XCode related 101 | **/ios/**/*.mode1v3 102 | **/ios/**/*.mode2v3 103 | **/ios/**/*.moved-aside 104 | **/ios/**/*.pbxuser 105 | **/ios/**/*.perspectivev3 106 | **/ios/**/*sync/ 107 | **/ios/**/.sconsign.dblite 108 | **/ios/**/.tags* 109 | **/ios/**/.vagrant/ 110 | **/ios/**/DerivedData/ 111 | **/ios/**/Icon? 112 | **/ios/**/Pods/ 113 | **/ios/**/.symlinks/ 114 | **/ios/**/profile 115 | **/ios/**/xcuserdata 116 | **/ios/.generated/ 117 | **/ios/Flutter/.last_build_id 118 | **/ios/Flutter/App.framework 119 | **/ios/Flutter/Flutter.framework 120 | **/ios/Flutter/Flutter.podspec 121 | **/ios/Flutter/Generated.xcconfig 122 | **/ios/Flutter/app.flx 123 | **/ios/Flutter/app.zip 124 | **/ios/Flutter/flutter_assets/ 125 | **/ios/Flutter/flutter_export_environment.sh 126 | **/ios/ServiceDefinitions.json 127 | **/ios/Runner/GeneratedPluginRegistrant.* 128 | 129 | # Exceptions to above rules. 130 | !**/ios/**/default.mode1v3 131 | !**/ios/**/default.mode2v3 132 | !**/ios/**/default.pbxuser 133 | !**/ios/**/default.perspectivev3 134 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 135 | 136 | ### macOS ### 137 | # General 138 | .DS_Store 139 | .AppleDouble 140 | .LSOverride 141 | 142 | # Icon must end with two \r 143 | Icon 144 | 145 | 146 | # Thumbnails 147 | ._* 148 | 149 | # Files that might appear in the root of a volume 150 | .DocumentRevisions-V100 151 | .fseventsd 152 | .Spotlight-V100 153 | .TemporaryItems 154 | .Trashes 155 | .VolumeIcon.icns 156 | .com.apple.timemachine.donotpresent 157 | 158 | # Directories potentially created on remote AFP share 159 | .AppleDB 160 | .AppleDesktop 161 | Network Trash Folder 162 | Temporary Items 163 | .apdisk 164 | 165 | ### Xcode ### 166 | ## User settings 167 | xcuserdata/ 168 | 169 | ## Xcode 8 and earlier 170 | *.xcscmblueprint 171 | *.xccheckout 172 | 173 | ### Xcode Patch ### 174 | *.xcodeproj/* 175 | !*.xcodeproj/project.pbxproj 176 | !*.xcodeproj/xcshareddata/ 177 | !*.xcworkspace/contents.xcworkspacedata 178 | /*.gcno 179 | **/xcshareddata/WorkspaceSettings.xcsettings 180 | 181 | ### AndroidStudio ### 182 | # Covers files to be ignored for android development using Android Studio. 183 | 184 | # Built application files 185 | *.ap_ 186 | *.aab 187 | 188 | # Files for the ART/Dalvik VM 189 | *.dex 190 | 191 | # Java class files 192 | *.class 193 | 194 | # Generated files 195 | bin/ 196 | gen/ 197 | out/ 198 | 199 | # Gradle files 200 | .gradle 201 | 202 | # Signing files 203 | .signing/ 204 | 205 | # Local configuration file (sdk path, etc) 206 | 207 | # Proguard folder generated by Eclipse 208 | proguard/ 209 | 210 | # Log Files 211 | 212 | # Android Studio 213 | /*/build/ 214 | /*/local.properties 215 | /*/out 216 | /*/*/build 217 | /*/*/production 218 | .navigation/ 219 | *.ipr 220 | *~ 221 | *.swp 222 | 223 | # Keystore files 224 | 225 | # Google Services (e.g. APIs or Firebase) 226 | # google-services.json 227 | 228 | # Android Patch 229 | 230 | # External native build folder generated in Android Studio 2.2 and later 231 | .externalNativeBuild 232 | 233 | # NDK 234 | obj/ 235 | 236 | # IntelliJ IDEA 237 | *.iws 238 | /out/ 239 | 240 | # User-specific configurations 241 | .idea/caches/ 242 | .idea/libraries/ 243 | .idea/shelf/ 244 | .idea/workspace.xml 245 | .idea/tasks.xml 246 | .idea/.name 247 | .idea/compiler.xml 248 | .idea/copyright/profiles_settings.xml 249 | .idea/encodings.xml 250 | .idea/misc.xml 251 | .idea/modules.xml 252 | .idea/scopes/scope_settings.xml 253 | .idea/dictionaries 254 | .idea/vcs.xml 255 | .idea/jsLibraryMappings.xml 256 | .idea/datasources.xml 257 | .idea/dataSources.ids 258 | .idea/sqlDataSources.xml 259 | .idea/dynamic.xml 260 | .idea/uiDesigner.xml 261 | .idea/assetWizardSettings.xml 262 | .idea/gradle.xml 263 | .idea/jarRepositories.xml 264 | .idea/navEditor.xml 265 | 266 | # OS-specific files 267 | .DS_Store? 268 | ehthumbs.db 269 | Thumbs.db 270 | 271 | # Legacy Eclipse project files 272 | .classpath 273 | .project 274 | .cproject 275 | .settings/ 276 | 277 | # Mobile Tools for Java (J2ME) 278 | .mtj.tmp/ 279 | 280 | # Package Files # 281 | *.war 282 | *.ear 283 | 284 | # virtual machine crash logs (Reference: http://www.java.com/en/download/help/error_hotspot.xml) 285 | hs_err_pid* 286 | 287 | ## Plugin-specific files: 288 | 289 | # mpeltonen/sbt-idea plugin 290 | .idea_modules/ 291 | 292 | # JIRA plugin 293 | atlassian-ide-plugin.xml 294 | 295 | # Mongo Explorer plugin 296 | .idea/mongoSettings.xml 297 | 298 | # Crashlytics plugin (for Android Studio and IntelliJ) 299 | com_crashlytics_export_strings.xml 300 | crashlytics.properties 301 | crashlytics-build.properties 302 | fabric.properties 303 | 304 | ### AndroidStudio Patch ### 305 | 306 | !/gradle/wrapper/gradle-wrapper.jar 307 | 308 | # End of https://www.toptal.com/developers/gitignore/api/flutter,macos,android,androidstudio,xcode -------------------------------------------------------------------------------- /lib/output.dart: -------------------------------------------------------------------------------- 1 | import 'dart:core'; 2 | 3 | class Web3AuthResponse { 4 | /// secp256k1 private key compaitible with Ethereum ecosystem. 5 | final String? privKey; 6 | 7 | /// ed25519 private key compaitible with Solana ecosystem. 8 | final String? ed25519PrivKey; 9 | 10 | /// Current We3Auth sessionId. 11 | final String? sessionId; 12 | 13 | /// User's information based on the current session. 14 | final TorusUserInfo? userInfo; 15 | 16 | final String? error; 17 | 18 | /// secp256k1 core kit key. 19 | final String? coreKitKey; 20 | 21 | /// ed25519 core kit key. 22 | final String? coreKitEd25519PrivKey; 23 | final String? factorKey; 24 | final List? signatures; 25 | final int? tssShareIndex; 26 | final String? tssPubKey; 27 | final String? tssShare; 28 | final int? tssNonce; 29 | final List? nodeIndexes; 30 | final String? keyMode; 31 | 32 | Web3AuthResponse({ 33 | this.privKey, 34 | this.userInfo, 35 | this.error, 36 | this.ed25519PrivKey, 37 | this.sessionId, 38 | this.coreKitKey, 39 | this.coreKitEd25519PrivKey, 40 | this.factorKey, 41 | this.signatures, 42 | this.tssShareIndex, 43 | this.tssPubKey, 44 | this.tssShare, 45 | this.tssNonce, 46 | this.nodeIndexes, 47 | this.keyMode 48 | }); 49 | 50 | @override 51 | String toString() { 52 | return "{privKey=$privKey, userInfo = ${userInfo.toString()}, ed25519PrivKey=$ed25519PrivKey, coreKitKey=$coreKitKey, coreKitEd25519PrivKey=$coreKitEd25519PrivKey, sessionId=$sessionId, error=$error," 53 | "factorKey=$factorKey, signatures=$signatures, tssShareIndex=$tssShareIndex, tssPubKey=$tssPubKey, tssShare=$tssShare, tssNonce=$tssNonce, nodeIndexes=$nodeIndexes, keyMode=$keyMode}"; 54 | } 55 | 56 | Map toJson() { 57 | return { 58 | 'privKey': privKey, 59 | 'userInfo': userInfo?.toJson(), 60 | 'ed25519PrivKey': ed25519PrivKey, 61 | 'sessionId': sessionId, 62 | 'error': error, 63 | 'coreKitKey': coreKitKey, 64 | 'coreKitEd25519PrivKey': coreKitEd25519PrivKey, 65 | 'factorKey': factorKey, 66 | 'signatures': signatures, 67 | 'tssShareIndex': tssShareIndex, 68 | 'tssPubKey': tssPubKey, 69 | 'tssShare': tssShare, 70 | 'tssNonce': tssNonce, 71 | 'nodeIndexes': nodeIndexes, 72 | 'keyMode': keyMode 73 | }; 74 | } 75 | 76 | Web3AuthResponse.fromJson(Map json) 77 | : privKey = json['privKey'], 78 | userInfo = json['userInfo'] != null 79 | ? TorusUserInfo.fromJson(json['userInfo']) 80 | : null, 81 | ed25519PrivKey = json['ed25519PrivKey'], 82 | sessionId = json['sessionId'], 83 | coreKitKey = json['coreKitKey'], 84 | coreKitEd25519PrivKey = json['coreKitEd25519PrivKey'], 85 | error = json['error'], 86 | factorKey = json['factorKey'], 87 | signatures = json['signatures'] != null 88 | ? List.from(json['signatures']) 89 | : null, 90 | tssShareIndex = json['tssShareIndex'], 91 | tssPubKey = json['tssPubKey'], 92 | tssShare = json['tssShare'], 93 | tssNonce = json['tssNonce'], 94 | nodeIndexes = json['nodeIndexes'] != null 95 | ? List.from(json['nodeIndexes']) 96 | : null, 97 | keyMode = json['keyMode']; 98 | } 99 | 100 | class TorusUserInfo { 101 | /// Email of the connected user. 102 | final String? email; 103 | 104 | /// Name of the connected user. 105 | final String? name; 106 | 107 | /// Profile image of the connected user. 108 | final String? profileImage; 109 | 110 | /// Details of the verifier type. 111 | final String? verifier; 112 | 113 | /// Verified id for the custom verifiers. 114 | final String? verifierId; 115 | 116 | /// Type of login choosen by user, like google, facebook, etc. 117 | final String? typeOfLogin; 118 | 119 | /// Details of the aggregate verifier, if present. 120 | final String? aggregateVerifier; 121 | 122 | /// If you are using a Custom Verifier, you can get a dapp share after successful login. 123 | /// This share can act as a replacement to your user's device share. 124 | /// 125 | /// It is a 24 word seed phrase) 126 | final String? dappShare; 127 | 128 | /// JWT token issued by the Web3Auth. 129 | final String? idToken; 130 | 131 | /// JWT token issued by the OAuth provider. 132 | final String? oAuthIdToken; 133 | 134 | //// Access token issued by the OAuth provider. 135 | final String? oAuthAccessToken; 136 | 137 | /// Defines whether MFA is enabled or not. 138 | final bool? isMfaEnabled; 139 | 140 | const TorusUserInfo({ 141 | this.email, 142 | this.name, 143 | this.profileImage, 144 | this.verifier, 145 | this.verifierId, 146 | this.typeOfLogin, 147 | this.aggregateVerifier, 148 | this.dappShare, 149 | this.idToken, 150 | this.oAuthIdToken, 151 | this.oAuthAccessToken, 152 | this.isMfaEnabled, 153 | }); 154 | 155 | @override 156 | String toString() { 157 | return "{email=$email, name=$name, profileImage=$profileImage, verifier=$verifier," 158 | "verifierId=$verifierId, typeOfLogin=$typeOfLogin, dappShare=$dappShare, idToken=$idToken, oAuthIdToken=$oAuthIdToken, oAuthAccessToken=$oAuthAccessToken, isMfaEnabled=$isMfaEnabled}"; 159 | } 160 | 161 | Map toJson() { 162 | return { 163 | 'email': email, 164 | 'name': name, 165 | 'profileImage': profileImage, 166 | 'verifier': verifier, 167 | 'verifierId': verifierId, 168 | 'typeOfLogin': typeOfLogin, 169 | 'aggregateVerifier': aggregateVerifier, 170 | 'dappShare': dappShare, 171 | 'idToken': idToken, 172 | 'oAuthIdToken': oAuthIdToken, 173 | 'oAuthAccessToken': oAuthAccessToken, 174 | 'isMfaEnabled': isMfaEnabled 175 | }; 176 | } 177 | 178 | TorusUserInfo.fromJson(Map json) 179 | : email = json['email'], 180 | name = json['name'], 181 | profileImage = json['profileImage'], 182 | verifier = json['verifier'], 183 | verifierId = json['verifierId'], 184 | typeOfLogin = json['typeOfLogin'], 185 | aggregateVerifier = json['aggregateVerifier'], 186 | dappShare = json['dappShare'], 187 | idToken = json['idToken'], 188 | oAuthIdToken = json['oAuthIdToken'], 189 | oAuthAccessToken = json['oAuthAccessToken'], 190 | isMfaEnabled = json['isMfaEnabled']; 191 | } 192 | 193 | class SignResponse { 194 | final bool success; 195 | final String? result; 196 | final String? error; 197 | 198 | SignResponse({ 199 | required this.success, 200 | this.result, 201 | this.error, 202 | }); 203 | 204 | @override 205 | String toString() { 206 | return "{success=$success, result = $result, error=$error}"; 207 | } 208 | 209 | Map toJson() { 210 | return { 211 | 'success': success, 212 | 'result': result, 213 | 'error': error 214 | }; 215 | } 216 | 217 | SignResponse.fromJson(Map json) 218 | : success = json['success'], 219 | result = json['result'], 220 | error = json['error']; 221 | } 222 | -------------------------------------------------------------------------------- /lib/web3auth_flutter.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:convert'; 3 | import 'dart:io'; 4 | 5 | import 'package:flutter/services.dart'; 6 | import 'package:web3auth_flutter/input.dart'; 7 | import 'package:web3auth_flutter/output.dart'; 8 | 9 | class Web3AuthFlutter { 10 | static const MethodChannel _channel = MethodChannel('web3auth_flutter'); 11 | 12 | /// [init] methods helps you setup [Web3AuthFlutter] SDK. You can add 13 | /// whitelabeling, redirect url, and set other parameters during init. 14 | /// 15 | /// Please checkout [Web3AuthOptions] for more details 16 | static Future init(Web3AuthOptions initParams) async { 17 | Map initParamsJson = initParams.toJson(); 18 | initParamsJson.removeWhere((key, value) => value == null); 19 | await _channel.invokeMethod('init', jsonEncode(initParamsJson)); 20 | } 21 | 22 | /// [login] method will initiate login flow, opening the browser allowing 23 | /// users to authenticate themselves with preferred login provider. 24 | /// 25 | /// Use [loginParams] to change the login provider, curve, and other parameters. 26 | /// For more details, look into [LoginParams]. 27 | static Future login(LoginParams loginParams) async { 28 | try { 29 | Map loginParamsJson = loginParams.toJson(); 30 | loginParamsJson.removeWhere((key, value) => value == null); 31 | final String loginResponse = await _channel.invokeMethod( 32 | 'login', 33 | jsonEncode(loginParamsJson), 34 | ); 35 | 36 | return Web3AuthResponse.fromJson(jsonDecode(loginResponse)); 37 | } on PlatformException catch (e) { 38 | throw _handlePlatformException(e); 39 | } 40 | } 41 | 42 | /// [logout] method will initiate the logout for current session. 43 | static Future logout() async { 44 | try { 45 | await _channel.invokeMethod('logout', jsonEncode({})); 46 | return; 47 | } on PlatformException catch (e) { 48 | throw _handlePlatformException(e); 49 | } 50 | } 51 | 52 | /// Initializes the [Web3AuthFlutter] with session if present. 53 | /// If no active session is present, the method will throw an error. 54 | /// 55 | /// You should use try and catch block to handle the error when no 56 | /// active session is present. 57 | static Future initialize() async { 58 | try { 59 | await _channel.invokeMethod('initialize', jsonEncode({})); 60 | return; 61 | } on PlatformException catch (e) { 62 | throw _handlePlatformException(e); 63 | } 64 | } 65 | 66 | /// Returns the secp256k1 EVM compaitible key if the user is successfully 67 | /// authenticated. 68 | /// 69 | /// If user is not authenticated, it'll return empty string. 70 | static Future getPrivKey() async { 71 | try { 72 | final String privKey = 73 | await _channel.invokeMethod('getPrivKey', jsonEncode({})); 74 | return privKey; 75 | } on PlatformException catch (e) { 76 | throw _handlePlatformException(e); 77 | } 78 | } 79 | 80 | /// Returns the ed25519 Solana compaitible key if the user is successfully 81 | /// authenticated. 82 | /// 83 | /// If user is not authenticated, it'll return empty string. 84 | static Future getEd25519PrivKey() async { 85 | try { 86 | final String getEd25519PrivKey = 87 | await _channel.invokeMethod('getEd25519PrivKey', jsonEncode({})); 88 | return getEd25519PrivKey; 89 | } on PlatformException catch (e) { 90 | throw _handlePlatformException(e); 91 | } 92 | } 93 | 94 | /// Returns the user information such as email address, name, session id, and etc. 95 | /// 96 | /// If user is not authenticated, it'll throw an error. 97 | static Future getUserInfo() async { 98 | try { 99 | final String torusUserInfo = 100 | await _channel.invokeMethod('getUserInfo', jsonEncode({})); 101 | return TorusUserInfo.fromJson(jsonDecode(torusUserInfo)); 102 | } on PlatformException catch (e) { 103 | throw _handlePlatformException(e); 104 | } 105 | } 106 | 107 | /// [setCustomTabsClosed] helps to trigger the [UserCancelledException] exception 108 | /// on Android. 109 | /// 110 | /// The Android SDK uses the custom tabs and from current implementation of chrome custom tab, 111 | /// it's not possible to add a listener directly to chrome custom tab close button and 112 | /// trigger login exceptions. 113 | /// 114 | /// If you want to trigger exception for user closing the browser tab, you have to use 115 | /// WidgetsBindingObserver mixin with your your login screen, and call the method during 116 | /// [AppLifecycleState.resumed]. 117 | static Future setCustomTabsClosed() async { 118 | try { 119 | if (Platform.isAndroid) { 120 | await _channel.invokeMethod('setCustomTabsClosed'); 121 | } 122 | return; 123 | } on PlatformException catch (e) { 124 | throw _handlePlatformException(e); 125 | } 126 | } 127 | 128 | static Exception _handlePlatformException(PlatformException e) { 129 | switch (e.code) { 130 | case "UserCancelledException": 131 | return UserCancelledException(); 132 | case "NoAllowedBrowserFoundException": 133 | return UnKnownException(e.message); 134 | default: 135 | return e; 136 | } 137 | } 138 | 139 | static Future launchWalletServices( 140 | ChainConfig chainConfig, { 141 | String path = "wallet", 142 | }) async { 143 | try { 144 | Map chainConfigJson = chainConfig.toJson(); 145 | chainConfigJson.removeWhere((key, value) => value == null); 146 | 147 | Map walletServicesJson = {}; 148 | walletServicesJson["chainConfig"] = chainConfigJson; 149 | walletServicesJson["path"] = path; 150 | 151 | await _channel.invokeMethod( 152 | 'launchWalletServices', 153 | jsonEncode(walletServicesJson), 154 | ); 155 | 156 | return; 157 | } on PlatformException catch (e) { 158 | throw _handlePlatformException(e); 159 | } 160 | } 161 | 162 | /// [enableMFA] method allows us trigger the MFA flow. If the MFA is already 163 | /// enable, the method will throw an error. 164 | static Future enableMFA({LoginParams? loginParams}) async { 165 | try { 166 | bool isMFASetup = false; 167 | if (loginParams == null) { 168 | isMFASetup = await _channel.invokeMethod('enableMFA', jsonEncode({})); 169 | return isMFASetup; 170 | } else { 171 | Map loginParamsJson = loginParams.toJson(); 172 | loginParamsJson.removeWhere((key, value) => value == null); 173 | isMFASetup = await _channel.invokeMethod( 174 | 'enableMFA', 175 | jsonEncode(loginParamsJson), 176 | ); 177 | } 178 | return isMFASetup; 179 | } on PlatformException catch (e) { 180 | throw _handlePlatformException(e); 181 | } 182 | } 183 | 184 | static Future manageMFA({LoginParams? loginParams}) async { 185 | try { 186 | bool isManageMFA = false; 187 | if (loginParams == null) { 188 | isManageMFA = await _channel.invokeMethod('manageMFA', jsonEncode({})); 189 | return isManageMFA; 190 | } else { 191 | Map loginParamsJson = loginParams.toJson(); 192 | loginParamsJson.removeWhere((key, value) => value == null); 193 | isManageMFA = await _channel.invokeMethod( 194 | 'manageMFA', 195 | jsonEncode(loginParamsJson), 196 | ); 197 | } 198 | return isManageMFA; 199 | } on PlatformException catch (e) { 200 | throw _handlePlatformException(e); 201 | } 202 | } 203 | 204 | static Future request( 205 | ChainConfig chainConfig, 206 | String method, 207 | List requestParams, { 208 | String path = "wallet/request", 209 | String? appState, 210 | }) async { 211 | try { 212 | Map chainConfigJson = chainConfig.toJson(); 213 | chainConfigJson.removeWhere((key, value) => value == null); 214 | 215 | List modifiedRequestParams = 216 | requestParams.map((param) => jsonEncode(param)).toList(); 217 | 218 | Map requestJson = {}; 219 | requestJson["chainConfig"] = chainConfigJson; 220 | requestJson["method"] = method; 221 | requestJson["requestParams"] = modifiedRequestParams; 222 | requestJson["path"] = path; 223 | if (appState != null) { 224 | requestJson["appState"] = appState; 225 | } 226 | 227 | final response = 228 | await _channel.invokeMethod('request', jsonEncode(requestJson)); 229 | 230 | if (response == "null") { 231 | return SignResponse( 232 | success: false, 233 | error: "Something went wrong. Unable to process the request.", 234 | ); 235 | } 236 | 237 | return SignResponse.fromJson(jsonDecode(response)); 238 | } on PlatformException catch (e) { 239 | throw _handlePlatformException(e); 240 | } 241 | } 242 | 243 | static Future getWeb3AuthResponse() async { 244 | try { 245 | final String web3AuthResponse = await _channel.invokeMethod( 246 | 'getWeb3AuthResponse', 247 | jsonEncode({}), 248 | ); 249 | return Web3AuthResponse.fromJson(jsonDecode(web3AuthResponse)); 250 | } on PlatformException catch (e) { 251 | throw _handlePlatformException(e); 252 | } 253 | } 254 | } 255 | -------------------------------------------------------------------------------- /example/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" 9 | url: "https://pub.dev" 10 | source: hosted 11 | version: "2.11.0" 12 | boolean_selector: 13 | dependency: transitive 14 | description: 15 | name: boolean_selector 16 | sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" 17 | url: "https://pub.dev" 18 | source: hosted 19 | version: "2.1.1" 20 | characters: 21 | dependency: transitive 22 | description: 23 | name: characters 24 | sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" 25 | url: "https://pub.dev" 26 | source: hosted 27 | version: "1.3.0" 28 | clock: 29 | dependency: transitive 30 | description: 31 | name: clock 32 | sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf 33 | url: "https://pub.dev" 34 | source: hosted 35 | version: "1.1.1" 36 | collection: 37 | dependency: transitive 38 | description: 39 | name: collection 40 | sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a 41 | url: "https://pub.dev" 42 | source: hosted 43 | version: "1.18.0" 44 | convert: 45 | dependency: transitive 46 | description: 47 | name: convert 48 | sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" 49 | url: "https://pub.dev" 50 | source: hosted 51 | version: "3.1.1" 52 | crypto: 53 | dependency: transitive 54 | description: 55 | name: crypto 56 | sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab 57 | url: "https://pub.dev" 58 | source: hosted 59 | version: "3.0.3" 60 | cupertino_icons: 61 | dependency: "direct main" 62 | description: 63 | name: cupertino_icons 64 | sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 65 | url: "https://pub.dev" 66 | source: hosted 67 | version: "1.0.8" 68 | eip1559: 69 | dependency: transitive 70 | description: 71 | name: eip1559 72 | sha256: c2b81ac85f3e0e71aaf558201dd9a4600f051ece7ebacd0c5d70065c9b458004 73 | url: "https://pub.dev" 74 | source: hosted 75 | version: "0.6.2" 76 | eip55: 77 | dependency: transitive 78 | description: 79 | name: eip55 80 | sha256: "213a9b86add87a5216328e8494b0ab836e401210c4d55eb5e521bd39e39169e1" 81 | url: "https://pub.dev" 82 | source: hosted 83 | version: "1.0.2" 84 | fake_async: 85 | dependency: transitive 86 | description: 87 | name: fake_async 88 | sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" 89 | url: "https://pub.dev" 90 | source: hosted 91 | version: "1.3.1" 92 | fixnum: 93 | dependency: transitive 94 | description: 95 | name: fixnum 96 | sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" 97 | url: "https://pub.dev" 98 | source: hosted 99 | version: "1.1.0" 100 | flutter: 101 | dependency: "direct main" 102 | description: flutter 103 | source: sdk 104 | version: "0.0.0" 105 | flutter_lints: 106 | dependency: "direct dev" 107 | description: 108 | name: flutter_lints 109 | sha256: e2a421b7e59244faef694ba7b30562e489c2b489866e505074eb005cd7060db7 110 | url: "https://pub.dev" 111 | source: hosted 112 | version: "3.0.1" 113 | flutter_test: 114 | dependency: "direct dev" 115 | description: flutter 116 | source: sdk 117 | version: "0.0.0" 118 | http: 119 | dependency: transitive 120 | description: 121 | name: http 122 | sha256: a2bbf9d017fcced29139daa8ed2bba4ece450ab222871df93ca9eec6f80c34ba 123 | url: "https://pub.dev" 124 | source: hosted 125 | version: "1.2.0" 126 | http_parser: 127 | dependency: transitive 128 | description: 129 | name: http_parser 130 | sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" 131 | url: "https://pub.dev" 132 | source: hosted 133 | version: "4.0.2" 134 | js: 135 | dependency: transitive 136 | description: 137 | name: js 138 | sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf 139 | url: "https://pub.dev" 140 | source: hosted 141 | version: "0.7.1" 142 | json_rpc_2: 143 | dependency: transitive 144 | description: 145 | name: json_rpc_2 146 | sha256: "5e469bffa23899edacb7b22787780068d650b106a21c76db3c49218ab7ca447e" 147 | url: "https://pub.dev" 148 | source: hosted 149 | version: "3.0.2" 150 | leak_tracker: 151 | dependency: transitive 152 | description: 153 | name: leak_tracker 154 | sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" 155 | url: "https://pub.dev" 156 | source: hosted 157 | version: "10.0.5" 158 | leak_tracker_flutter_testing: 159 | dependency: transitive 160 | description: 161 | name: leak_tracker_flutter_testing 162 | sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" 163 | url: "https://pub.dev" 164 | source: hosted 165 | version: "3.0.5" 166 | leak_tracker_testing: 167 | dependency: transitive 168 | description: 169 | name: leak_tracker_testing 170 | sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" 171 | url: "https://pub.dev" 172 | source: hosted 173 | version: "3.0.1" 174 | lints: 175 | dependency: transitive 176 | description: 177 | name: lints 178 | sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 179 | url: "https://pub.dev" 180 | source: hosted 181 | version: "3.0.0" 182 | matcher: 183 | dependency: transitive 184 | description: 185 | name: matcher 186 | sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb 187 | url: "https://pub.dev" 188 | source: hosted 189 | version: "0.12.16+1" 190 | material_color_utilities: 191 | dependency: transitive 192 | description: 193 | name: material_color_utilities 194 | sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec 195 | url: "https://pub.dev" 196 | source: hosted 197 | version: "0.11.1" 198 | meta: 199 | dependency: transitive 200 | description: 201 | name: meta 202 | sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 203 | url: "https://pub.dev" 204 | source: hosted 205 | version: "1.15.0" 206 | path: 207 | dependency: transitive 208 | description: 209 | name: path 210 | sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" 211 | url: "https://pub.dev" 212 | source: hosted 213 | version: "1.9.0" 214 | pointycastle: 215 | dependency: transitive 216 | description: 217 | name: pointycastle 218 | sha256: "79fbafed02cfdbe85ef3fd06c7f4bc2cbcba0177e61b765264853d4253b21744" 219 | url: "https://pub.dev" 220 | source: hosted 221 | version: "3.9.0" 222 | sec: 223 | dependency: transitive 224 | description: 225 | name: sec 226 | sha256: "8bbd56df884502192a441b5f5d667265498f2f8728a282beccd9db79e215f379" 227 | url: "https://pub.dev" 228 | source: hosted 229 | version: "1.1.0" 230 | sky_engine: 231 | dependency: transitive 232 | description: flutter 233 | source: sdk 234 | version: "0.0.99" 235 | source_span: 236 | dependency: transitive 237 | description: 238 | name: source_span 239 | sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" 240 | url: "https://pub.dev" 241 | source: hosted 242 | version: "1.10.0" 243 | sprintf: 244 | dependency: transitive 245 | description: 246 | name: sprintf 247 | sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" 248 | url: "https://pub.dev" 249 | source: hosted 250 | version: "7.0.0" 251 | stack_trace: 252 | dependency: transitive 253 | description: 254 | name: stack_trace 255 | sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" 256 | url: "https://pub.dev" 257 | source: hosted 258 | version: "1.11.1" 259 | stream_channel: 260 | dependency: transitive 261 | description: 262 | name: stream_channel 263 | sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 264 | url: "https://pub.dev" 265 | source: hosted 266 | version: "2.1.2" 267 | stream_transform: 268 | dependency: transitive 269 | description: 270 | name: stream_transform 271 | sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" 272 | url: "https://pub.dev" 273 | source: hosted 274 | version: "2.1.0" 275 | string_scanner: 276 | dependency: transitive 277 | description: 278 | name: string_scanner 279 | sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" 280 | url: "https://pub.dev" 281 | source: hosted 282 | version: "1.2.0" 283 | term_glyph: 284 | dependency: transitive 285 | description: 286 | name: term_glyph 287 | sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 288 | url: "https://pub.dev" 289 | source: hosted 290 | version: "1.2.1" 291 | test_api: 292 | dependency: transitive 293 | description: 294 | name: test_api 295 | sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" 296 | url: "https://pub.dev" 297 | source: hosted 298 | version: "0.7.2" 299 | typed_data: 300 | dependency: transitive 301 | description: 302 | name: typed_data 303 | sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c 304 | url: "https://pub.dev" 305 | source: hosted 306 | version: "1.3.2" 307 | uuid: 308 | dependency: transitive 309 | description: 310 | name: uuid 311 | sha256: cd210a09f7c18cbe5a02511718e0334de6559871052c90a90c0cca46a4aa81c8 312 | url: "https://pub.dev" 313 | source: hosted 314 | version: "4.3.3" 315 | vector_math: 316 | dependency: transitive 317 | description: 318 | name: vector_math 319 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" 320 | url: "https://pub.dev" 321 | source: hosted 322 | version: "2.1.4" 323 | vm_service: 324 | dependency: transitive 325 | description: 326 | name: vm_service 327 | sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" 328 | url: "https://pub.dev" 329 | source: hosted 330 | version: "14.2.5" 331 | wallet: 332 | dependency: transitive 333 | description: 334 | name: wallet 335 | sha256: "687fd89a16557649b26189e597792962f405797fc64113e8758eabc2c2605c32" 336 | url: "https://pub.dev" 337 | source: hosted 338 | version: "0.0.13" 339 | web: 340 | dependency: transitive 341 | description: 342 | name: web 343 | sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 344 | url: "https://pub.dev" 345 | source: hosted 346 | version: "0.3.0" 347 | web3auth_flutter: 348 | dependency: "direct main" 349 | description: 350 | path: ".." 351 | relative: true 352 | source: path 353 | version: "6.1.0" 354 | web3dart: 355 | dependency: "direct main" 356 | description: 357 | name: web3dart 358 | sha256: "885e5e8f0cc3c87c09f160a7fce6279226ca41316806f7ece2001959c62ecced" 359 | url: "https://pub.dev" 360 | source: hosted 361 | version: "2.7.3" 362 | sdks: 363 | dart: ">=3.3.0 <4.0.0" 364 | flutter: ">=3.18.0-18.0.pre.54" 365 | -------------------------------------------------------------------------------- /ios/Classes/SwiftWeb3AuthFlutterPlugin.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | import UIKit 3 | import Web3Auth 4 | 5 | public class SwiftWeb3AuthFlutterPlugin: NSObject, FlutterPlugin { 6 | public static func register(with registrar: FlutterPluginRegistrar) { 7 | let channel = FlutterMethodChannel(name: "web3auth_flutter", binaryMessenger: registrar.messenger()) 8 | let instance = SwiftWeb3AuthFlutterPlugin() 9 | registrar.addMethodCallDelegate(instance, channel: channel) 10 | } 11 | 12 | var web3auth: Web3Auth? 13 | public var state: Web3AuthState? { 14 | return web3auth?.state 15 | } 16 | var decoder = JSONDecoder() 17 | var encoder = JSONEncoder() 18 | 19 | public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { 20 | Task { 21 | // print(call, "calling args") 22 | guard let args = call.arguments as? String else { 23 | result(FlutterError( 24 | code: "INVALID_ARGUMENTS", 25 | message: "Invalid Flutter iOS plugin method arguments", 26 | details: nil)) 27 | return 28 | } 29 | guard let data = args.data(using: .utf8) else { 30 | result(FlutterError( 31 | code: "INVALID_ARGUMENTS", 32 | message: "Invalid Flutter iOS plugin init params", 33 | details: nil)) 34 | return 35 | } 36 | // print("call data", data) 37 | switch call.method { 38 | case "init": 39 | let initParams: W3AInitParams 40 | do { 41 | initParams = try decoder.decode(W3AInitParams.self, from: data) 42 | // print(initParams, "params") 43 | } catch { 44 | // print(error) 45 | result(FlutterError( 46 | code: "INVALID_ARGUMENTS", 47 | message: "Invalid Flutter decode init params", 48 | details: data)) 49 | return 50 | } 51 | do { 52 | let web3auth = try await Web3Auth(initParams) 53 | self.web3auth = web3auth 54 | result(nil) 55 | return 56 | } catch { 57 | result(FlutterError( 58 | code: "InitFailedException", 59 | message: "Web3Auth init failed", 60 | details: error.localizedDescription)) 61 | return 62 | } 63 | case "login": 64 | guard let web3auth = web3auth 65 | else { 66 | result(FlutterError( 67 | code: "NotInitializedException", 68 | message: "Web3Auth.init has to be called first", 69 | details: nil)) 70 | return 71 | } 72 | let loginParams: W3ALoginParams 73 | do { 74 | loginParams = try decoder.decode(W3ALoginParams.self, from: data) 75 | //print("loginParams: \(loginParams)") 76 | } catch { 77 | //print(error) 78 | result(FlutterError( 79 | code: "INVALID_ARGUMENTS", 80 | message: "Invalid Login Params", 81 | details: nil)) 82 | return 83 | } 84 | var resultMap: String = "" 85 | do { 86 | let result = try await web3auth.login(loginParams) 87 | let resultData = try encoder.encode(result) 88 | resultMap = String(decoding: resultData, as: UTF8.self) 89 | } catch { 90 | result(FlutterError( 91 | code: "LoginFailedException", 92 | message: "Web3Auth login flow failed", 93 | details: error.localizedDescription 94 | )) 95 | return 96 | } 97 | result(resultMap) 98 | return 99 | case "logout": 100 | do { 101 | try await web3auth?.logout() 102 | result(nil) 103 | return 104 | } catch { 105 | result(FlutterError( 106 | code: "LogoutFailedException", 107 | message: "Web3Auth logout failed", 108 | details: error.localizedDescription 109 | )) 110 | return 111 | } 112 | case "initialize": 113 | // There is no initialize function in swift 114 | result(nil) 115 | return 116 | case "getPrivKey": 117 | let privKey = web3auth?.getPrivkey() 118 | result(privKey) 119 | return 120 | case "getEd25519PrivKey": 121 | let getEd25519PrivKey = web3auth?.getEd25519PrivKey() 122 | result(getEd25519PrivKey) 123 | return 124 | case "launchWalletServices": 125 | let wsParams: WalletServicesParams 126 | do { 127 | wsParams = try decoder.decode(WalletServicesParams.self, from: data) 128 | print("chainConfig: \(wsParams.chainConfig)") 129 | } catch { 130 | result(FlutterError( 131 | code: "INVALID_ARGUMENTS", 132 | message: "Invalid Wallet Services Params", 133 | details: nil)) 134 | return 135 | } 136 | 137 | do { 138 | try await web3auth?.launchWalletServices(chainConfig: wsParams.chainConfig, path: wsParams.path) 139 | result(nil) 140 | return 141 | } catch { 142 | result(FlutterError( 143 | code: "WalletServicesFailedFailedException", 144 | message: "Web3Auth wallet services launch failed", 145 | details: error.localizedDescription)) 146 | return 147 | } 148 | case "enableMFA": 149 | do { 150 | let loginParams = try? decoder.decode(W3ALoginParams.self, from: data) 151 | 152 | if let params = loginParams { 153 | let enableMFAResult = try await web3auth?.enableMFA(params) 154 | result(enableMFAResult) 155 | } else { 156 | let enableMFAResult = try await web3auth?.enableMFA() 157 | result(enableMFAResult) 158 | } 159 | return 160 | } catch { 161 | result(FlutterError( 162 | code: "enableMFAFailedException", 163 | message: "Web3Auth enableMFA failed", 164 | details: error.localizedDescription)) 165 | return 166 | } 167 | case "manageMFA": 168 | do { 169 | let loginParams = try? decoder.decode(W3ALoginParams.self, from: data) 170 | 171 | if let params = loginParams { 172 | let manageMFAResult = try await web3auth?.manageMFA(params) 173 | result(manageMFAResult) 174 | } else { 175 | let manageMFAResult = try await web3auth?.manageMFA() 176 | result(manageMFAResult) 177 | } 178 | return 179 | } catch { 180 | result(FlutterError( 181 | code: "manageMFAFailedException", 182 | message: "Web3Auth manageMFA failed", 183 | details: error.localizedDescription)) 184 | return 185 | } 186 | case "request": 187 | let reqParams: RequestJson 188 | do { 189 | reqParams = try decoder.decode(RequestJson.self, from: data) 190 | } catch { 191 | result(FlutterError( 192 | code: "INVALID_ARGUMENTS", 193 | message: "Invalid request Params", 194 | details: error.localizedDescription)) 195 | return 196 | } 197 | 198 | do { 199 | let signResponse = try await web3auth?.request( 200 | chainConfig: reqParams.chainConfig, 201 | method: reqParams.method, 202 | requestParams: reqParams.requestParams, 203 | path: reqParams.path, 204 | appState: reqParams.appState 205 | ) 206 | let signData = try encoder.encode(signResponse) 207 | let resultMap = String(decoding: signData, as: UTF8.self) 208 | result(resultMap) 209 | return 210 | } catch { 211 | result(FlutterError( 212 | code: "RequestFailedFailedException", 213 | message: "Web3Auth request launch failed", 214 | details: error.localizedDescription)) 215 | return 216 | } 217 | case "getUserInfo": 218 | var resultMap: String = "" 219 | do { 220 | let userInfo = try web3auth?.getUserInfo() 221 | let resultData = try encoder.encode(userInfo) 222 | resultMap = String(decoding: resultData, as: UTF8.self) 223 | } catch { 224 | result(FlutterError( 225 | code: "GetUserInfoFailedException", 226 | message: "Web3Auth getUserInfo failed", 227 | details: error.localizedDescription 228 | )) 229 | return 230 | } 231 | result(resultMap) 232 | return 233 | 234 | case "getWeb3AuthResponse": 235 | var resultMap: String = "" 236 | do { 237 | let web3AuthResult = try web3auth?.getWeb3AuthResponse() 238 | let resultData = try encoder.encode(web3AuthResult) 239 | resultMap = String(decoding: resultData, as: UTF8.self) 240 | } catch { 241 | result(FlutterError( 242 | code: "GetWeb3AuthResponseFailedException", 243 | message: "Web3Auth getUserInfo failed", 244 | details: error.localizedDescription 245 | )) 246 | return 247 | } 248 | result(resultMap) 249 | return 250 | 251 | default: 252 | result(FlutterMethodNotImplemented) 253 | } 254 | } 255 | } 256 | } 257 | 258 | struct WalletServicesParams: Codable { 259 | let chainConfig: ChainConfig 260 | let path: String? 261 | } 262 | 263 | struct RequestJson: Codable { 264 | let chainConfig: ChainConfig 265 | let method: String 266 | let requestParams: [String] 267 | let path: String? 268 | let appState: String? 269 | } 270 | -------------------------------------------------------------------------------- /android/src/main/kotlin/com/web3auth/flutter/web3auth_flutter/Web3AuthFlutterPlugin.kt: -------------------------------------------------------------------------------- 1 | package com.web3auth.flutter.web3auth_flutter 2 | 3 | import android.app.Activity 4 | import android.content.Context 5 | import android.content.Intent 6 | import android.net.Uri 7 | import android.util.Log 8 | import androidx.annotation.Keep 9 | import androidx.annotation.NonNull 10 | import com.google.gson.Gson 11 | import com.google.gson.JsonArray 12 | import com.google.gson.JsonElement 13 | import com.google.gson.JsonPrimitive 14 | import com.web3auth.core.Web3Auth 15 | import com.web3auth.core.types.ChainConfig 16 | import com.web3auth.core.types.ErrorCode 17 | import com.web3auth.core.types.LoginParams 18 | import com.web3auth.core.types.Web3AuthError 19 | import com.web3auth.core.types.Web3AuthOptions 20 | import com.web3auth.core.types.Web3AuthResponse 21 | import io.flutter.embedding.engine.plugins.FlutterPlugin 22 | import io.flutter.embedding.engine.plugins.activity.ActivityAware 23 | import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding 24 | import io.flutter.plugin.common.MethodCall 25 | import io.flutter.plugin.common.MethodChannel 26 | import io.flutter.plugin.common.MethodChannel.MethodCallHandler 27 | import io.flutter.plugin.common.PluginRegistry 28 | import kotlinx.coroutines.CoroutineScope 29 | import kotlinx.coroutines.Dispatchers 30 | import kotlinx.coroutines.launch 31 | import org.json.JSONObject 32 | 33 | class Web3AuthFlutterPlugin : FlutterPlugin, ActivityAware, MethodCallHandler, 34 | PluginRegistry.NewIntentListener { 35 | private lateinit var channel: MethodChannel 36 | 37 | private var activity: Activity? = null 38 | private lateinit var context: Context 39 | private lateinit var web3auth: Web3Auth 40 | private var gson: Gson = Gson() 41 | 42 | override fun onAttachedToEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) { 43 | channel = MethodChannel(binding.binaryMessenger, "web3auth_flutter") 44 | channel.setMethodCallHandler(this) 45 | context = binding.applicationContext 46 | } 47 | 48 | override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) { 49 | channel.setMethodCallHandler(null) 50 | } 51 | 52 | override fun onAttachedToActivity(binding: ActivityPluginBinding) { 53 | activity = binding.activity 54 | binding.addOnNewIntentListener(this) 55 | } 56 | 57 | override fun onDetachedFromActivityForConfigChanges() { 58 | activity = null 59 | } 60 | 61 | override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) { 62 | activity = binding.activity 63 | } 64 | 65 | override fun onDetachedFromActivity() { 66 | activity = null 67 | } 68 | 69 | override fun onNewIntent(intent: Intent): Boolean { 70 | if (this::web3auth.isInitialized) { 71 | web3auth.setResultUrl(intent.data) 72 | } 73 | return true 74 | } 75 | 76 | override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: MethodChannel.Result) { 77 | CoroutineScope(Dispatchers.Default).launch { 78 | try { 79 | val response = runMethodCall(call) 80 | launch(Dispatchers.Main) { result.success(response) } 81 | } catch (e: NotImplementedError) { 82 | launch(Dispatchers.Main) { result.notImplemented() } 83 | } catch (e: Throwable) { 84 | launch(Dispatchers.Main) { 85 | if(e.message == "User Cancelled") { 86 | result.error("UserCancelledException", e.message, e.localizedMessage) 87 | } else { 88 | result.error("error", e.message, e.localizedMessage) 89 | } 90 | } 91 | } 92 | } 93 | } 94 | 95 | private fun runMethodCall(@NonNull call: MethodCall): Any? { 96 | when (call.method) { 97 | "init" -> { 98 | val initArgs = call.arguments() ?: return null 99 | val initParams = gson.fromJson(initArgs, Web3AuthOptions::class.java) 100 | // handle custom parameters which are gson excluded 101 | val obj = JSONObject(initArgs) 102 | if (obj.has("redirectUrl")) initParams.redirectUrl = Uri.parse(obj.get("redirectUrl") as String?) 103 | // Log.d(initParams.toString(), "#initParams") 104 | web3auth = Web3Auth( 105 | initParams, activity!! 106 | ) 107 | 108 | web3auth.setResultUrl(activity?.intent?.data) 109 | 110 | Log.d("${Web3AuthFlutterPlugin::class.qualifiedName}", "#init") 111 | return null 112 | } 113 | 114 | "login" -> { 115 | try { 116 | val loginArgs = call.arguments() ?: return null 117 | val loginParams = gson.fromJson(loginArgs, LoginParams::class.java) 118 | val obj = JSONObject(loginArgs) 119 | if (obj.has("redirectUrl")) loginParams.redirectUrl = Uri.parse(obj.get("redirectUrl") as String?) 120 | val loginCF = web3auth.login(loginParams) 121 | // Log.d(loginParams.toString(), "#loginParams") 122 | Log.d("${Web3AuthFlutterPlugin::class.qualifiedName}", "#login") 123 | val loginResult: Web3AuthResponse = loginCF.get() 124 | return gson.toJson(loginResult) 125 | } catch (e: NotImplementedError) { 126 | throw Error(e) 127 | } catch (e: Throwable) { 128 | throw Error("User Cancelled") 129 | } 130 | } 131 | 132 | "logout" -> { 133 | try { 134 | val logoutCF = web3auth.logout() 135 | Log.d("${Web3AuthFlutterPlugin::class.qualifiedName}", "#logout") 136 | logoutCF.get() 137 | return null 138 | } catch (e: Throwable) { 139 | throw Error(e) 140 | } 141 | } 142 | 143 | "initialize" -> { 144 | try { 145 | val initializeCF = web3auth.initialize() 146 | Log.d("${Web3AuthFlutterPlugin::class.qualifiedName}", "#initialize") 147 | initializeCF.get() 148 | return null 149 | } catch (e: Throwable) { 150 | throw Error(e) 151 | } 152 | } 153 | 154 | "getPrivKey" -> { 155 | val privKey = web3auth.getPrivkey() 156 | Log.d("${Web3AuthFlutterPlugin::class.qualifiedName}", "#getPrivKey") 157 | return privKey 158 | } 159 | 160 | "getEd25519PrivKey" -> { 161 | val ed25519Key = web3auth.getEd25519PrivKey() 162 | Log.d("${Web3AuthFlutterPlugin::class.qualifiedName}", "#getEd25519PrivKey") 163 | return ed25519Key 164 | } 165 | 166 | "getUserInfo" -> { 167 | try { 168 | val userInfoResult = web3auth.getUserInfo() 169 | Log.d("${Web3AuthFlutterPlugin::class.qualifiedName}", "#getUserInfo") 170 | if (userInfoResult == null) { 171 | throw Error(Web3AuthError.getError(ErrorCode.NOUSERFOUND)) 172 | } 173 | return gson.toJson(userInfoResult) 174 | } catch (e: Throwable) { 175 | throw Error(e) 176 | } 177 | } 178 | 179 | "getWeb3AuthResponse" -> { 180 | try { 181 | val web3AuthResult = web3auth.getWeb3AuthResponse() 182 | Log.d("${Web3AuthFlutterPlugin::class.qualifiedName}", "#getWeb3AuthResponse") 183 | if (web3AuthResult == null) { 184 | throw Error(Web3AuthError.getError(ErrorCode.NOUSERFOUND)) 185 | } 186 | return gson.toJson(web3AuthResult) 187 | } catch (e: Throwable) { 188 | throw Error(e) 189 | } 190 | } 191 | 192 | "launchWalletServices" -> { 193 | try { 194 | Log.d("${Web3AuthFlutterPlugin::class.qualifiedName}", "#launchWalletServices") 195 | val wsArgs = call.arguments() ?: return null 196 | val wsParams = gson.fromJson(wsArgs, WalletServicesJson::class.java) 197 | Log.d(wsParams.toString(), "#wsParams") 198 | val launchWalletCF = web3auth.launchWalletServices( 199 | wsParams.chainConfig, 200 | wsParams.path 201 | ) 202 | launchWalletCF.get() 203 | return null 204 | } catch (e: NotImplementedError) { 205 | throw Error(e) 206 | } catch (e: Throwable) { 207 | throw Error(e) 208 | } 209 | } 210 | 211 | "enableMFA" -> { 212 | try { 213 | val loginArgs = call.arguments() ?: return null 214 | val loginParams = gson.fromJson(loginArgs, LoginParams::class.java) 215 | val obj = JSONObject(loginArgs) 216 | if (obj.has("redirectUrl")) loginParams.redirectUrl = 217 | Uri.parse(obj.get("redirectUrl") as String?) 218 | val setupMfaCF = web3auth.enableMFA(loginParams) 219 | Log.d("${Web3AuthFlutterPlugin::class.qualifiedName}", "#enableMFA") 220 | return setupMfaCF.get() 221 | } catch (e: NotImplementedError) { 222 | throw Error(e) 223 | } catch (e: Throwable) { 224 | throw Error(e) 225 | } 226 | } 227 | 228 | "setCustomTabsClosed" -> { 229 | try { 230 | if (Web3Auth.getCustomTabsClosed()) { 231 | web3auth.setResultUrl(null) 232 | Web3Auth.setCustomTabsClosed(false) 233 | } 234 | return null 235 | } catch (e: NotImplementedError) { 236 | throw Error(e) 237 | } catch (e: Throwable) { 238 | throw Error(e) 239 | } 240 | } 241 | 242 | "request" -> { 243 | try { 244 | Log.d("${Web3AuthFlutterPlugin::class.qualifiedName}", "#signMessage") 245 | val requestArgs = call.arguments() ?: return null 246 | val reqParams = gson.fromJson(requestArgs, RequestJson::class.java) 247 | Log.d(reqParams.toString(), "#reqParams") 248 | val requestCF = web3auth.request( 249 | reqParams.chainConfig, 250 | reqParams.method, 251 | convertListToJsonArray(reqParams.requestParams) , 252 | reqParams.path, 253 | reqParams.appState 254 | ) 255 | return gson.toJson(requestCF.get()) 256 | } catch (e: NotImplementedError) { 257 | throw Error(e) 258 | } catch (e: Throwable) { 259 | throw Error(e) 260 | } 261 | } 262 | 263 | "manageMFA" -> { 264 | try { 265 | val loginArgs = call.arguments() ?: return null 266 | val loginParams = gson.fromJson(loginArgs, LoginParams::class.java) 267 | val obj = JSONObject(loginArgs) 268 | if (obj.has("redirectUrl")) loginParams.redirectUrl = 269 | Uri.parse(obj.get("redirectUrl") as String?) 270 | val setupMfaCF = web3auth.manageMFA(loginParams) 271 | Log.d("${Web3AuthFlutterPlugin::class.qualifiedName}", "#enableMFA") 272 | return setupMfaCF.get() 273 | } catch (e: NotImplementedError) { 274 | throw Error(e) 275 | } catch (e: Throwable) { 276 | throw Error(e) 277 | } 278 | } 279 | } 280 | throw NotImplementedError() 281 | } 282 | 283 | private fun convertListToJsonArray(list: List): JsonArray { 284 | val jsonArray = JsonArray() 285 | val gson = Gson() 286 | 287 | list.forEach { item -> 288 | val jsonElement: JsonElement = when (item) { 289 | is Number -> JsonPrimitive(item) 290 | is String -> JsonPrimitive(item) 291 | is Boolean -> JsonPrimitive(item) 292 | is Map<*, *> -> gson.toJsonTree(item) 293 | is List<*> -> convertListToJsonArray(item) 294 | null -> JsonPrimitive("") 295 | else -> throw IllegalArgumentException("Unsupported type: ${item::class.java}") 296 | } 297 | jsonArray.add(jsonElement) 298 | } 299 | return jsonArray 300 | } 301 | } 302 | @Keep 303 | data class WalletServicesJson( 304 | @Keep val chainConfig: ChainConfig, 305 | @Keep val path: String? = "wallet" 306 | ) 307 | 308 | @Keep 309 | data class RequestJson( 310 | @Keep val chainConfig: ChainConfig, 311 | @Keep val method: String, 312 | @Keep val requestParams: List, 313 | @Keep val path: String? = "wallet/request", 314 | @Keep val appState: String? = null 315 | ) 316 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:collection'; 3 | import 'dart:developer'; 4 | import 'dart:io'; 5 | 6 | import 'package:flutter/material.dart'; 7 | import 'package:web3auth_flutter/enums.dart'; 8 | import 'package:web3auth_flutter/input.dart'; 9 | import 'package:web3auth_flutter/output.dart'; 10 | import 'package:web3auth_flutter/web3auth_flutter.dart'; 11 | import 'package:web3dart/web3dart.dart'; 12 | 13 | void main() { 14 | runApp(const MyApp()); 15 | } 16 | 17 | class MyApp extends StatefulWidget { 18 | const MyApp({Key? key}) : super(key: key); 19 | 20 | @override 21 | State createState() => _MyAppState(); 22 | } 23 | 24 | class _MyAppState extends State with WidgetsBindingObserver { 25 | String _result = ''; 26 | bool logoutVisible = false; 27 | late final TextEditingController textEditingController; 28 | 29 | @override 30 | void initState() { 31 | super.initState(); 32 | initPlatformState(); 33 | textEditingController = TextEditingController(); 34 | WidgetsBinding.instance.addObserver(this); 35 | } 36 | 37 | @override 38 | void dispose() { 39 | super.dispose(); 40 | WidgetsBinding.instance.removeObserver(this); 41 | } 42 | 43 | @override 44 | void didChangeAppLifecycleState(final AppLifecycleState state) { 45 | // This is important to trigger the user cancellation on Android. 46 | if (state == AppLifecycleState.resumed) { 47 | Web3AuthFlutter.setCustomTabsClosed(); 48 | } 49 | } 50 | 51 | // Platform messages are asynchronous, so we initialize in an async method. 52 | Future initPlatformState() async { 53 | HashMap themeMap = HashMap(); 54 | themeMap['primary'] = "#229954"; 55 | 56 | Uri redirectUrl; 57 | if (Platform.isAndroid) { 58 | redirectUrl = Uri.parse('torusapp://org.torusresearch.flutter.web3authexample'); 59 | } else if (Platform.isIOS) { 60 | redirectUrl = 61 | Uri.parse('com.web3auth.flutter.web3authflutterexample://auth'); 62 | } else { 63 | throw UnKnownException('Unknown platform'); 64 | } 65 | 66 | final loginConfig = HashMap(); 67 | loginConfig['jwt'] = LoginConfigItem( 68 | verifier: "w3a-auth0-demo", // get it from web3auth dashboard 69 | typeOfLogin: TypeOfLogin.jwt, 70 | clientId: "hUVVf4SEsZT7syOiL0gLU9hFEtm2gQ6O" // auth0 client id 71 | ); 72 | 73 | await Web3AuthFlutter.init( 74 | Web3AuthOptions( 75 | clientId: 76 | 'BHgArYmWwSeq21czpcarYh0EVq2WWOzflX-NTK-tY1-1pauPzHKRRLgpABkmYiIV_og9jAvoIxQ8L3Smrwe04Lw', 77 | //sdkUrl: 'https://auth.mocaverse.xyz', 78 | //walletSdkUrl: 'https://lrc-mocaverse.web3auth.io', 79 | network: Network.sapphire_devnet, 80 | buildEnv: BuildEnv.production, 81 | redirectUrl: redirectUrl, 82 | whiteLabel: WhiteLabelData( 83 | mode: ThemeModes.dark, 84 | defaultLanguage: Language.en, 85 | appName: "Web3Auth Flutter App", 86 | theme: themeMap, 87 | ), 88 | loginConfig: loginConfig, 89 | ), 90 | ); 91 | 92 | try { 93 | await Web3AuthFlutter.initialize(); 94 | } catch (e) { 95 | print('Error during Web3Auth initialization: $e'); 96 | } 97 | 98 | final String res = await Web3AuthFlutter.getPrivKey(); 99 | log(res); 100 | if (res.isNotEmpty) { 101 | setState(() { 102 | logoutVisible = true; 103 | }); 104 | } 105 | } 106 | 107 | @override 108 | Widget build(BuildContext context) { 109 | return MaterialApp( 110 | home: Builder( 111 | builder: (context) { 112 | return Scaffold( 113 | appBar: AppBar( 114 | title: const Text('Web3Auth x Flutter Example'), 115 | ), 116 | body: SingleChildScrollView( 117 | child: Center( 118 | child: Column( 119 | mainAxisAlignment: MainAxisAlignment.center, 120 | children: [ 121 | const Padding( 122 | padding: EdgeInsets.all(8.0), 123 | ), 124 | Visibility( 125 | visible: !logoutVisible, 126 | child: Column( 127 | children: [ 128 | const SizedBox( 129 | height: 50, 130 | ), 131 | const Icon( 132 | Icons.flutter_dash, 133 | size: 80, 134 | color: Color(0xFF1389fd), 135 | ), 136 | const SizedBox( 137 | height: 40, 138 | ), 139 | const Text( 140 | 'Web3Auth', 141 | style: TextStyle( 142 | fontWeight: FontWeight.bold, 143 | fontSize: 36, 144 | color: Color(0xFF0364ff)), 145 | ), 146 | const SizedBox( 147 | height: 10, 148 | ), 149 | const Text( 150 | 'Welcome to Web3Auth x Flutter Demo', 151 | style: TextStyle(fontSize: 14), 152 | ), 153 | const SizedBox( 154 | height: 20, 155 | ), 156 | const Text( 157 | 'Login with', 158 | style: TextStyle(fontSize: 12), 159 | ), 160 | const SizedBox( 161 | height: 20, 162 | ), 163 | ElevatedButton( 164 | onPressed: _login(_withGoogle), 165 | child: const Text('Google'), 166 | ), 167 | ElevatedButton( 168 | onPressed: _login(_withFacebook), 169 | child: const Text('Facebook'), 170 | ), 171 | Padding( 172 | padding: const EdgeInsets.all(8.0), 173 | child: TextField( 174 | controller: textEditingController, 175 | decoration: const InputDecoration( 176 | border: OutlineInputBorder(), 177 | hintText: "abc@xyz.com", 178 | ), 179 | ), 180 | ), 181 | ElevatedButton( 182 | onPressed: _login(_withEmailPasswordless), 183 | child: const Text('Email Passwordless'), 184 | ), 185 | ElevatedButton( 186 | onPressed: _login(_withDiscord), 187 | child: const Text('Discord'), 188 | ), 189 | ], 190 | ), 191 | ), 192 | Visibility( 193 | visible: logoutVisible, 194 | child: Column( 195 | children: [ 196 | ElevatedButton( 197 | style: ElevatedButton.styleFrom( 198 | backgroundColor: Colors.red[600], 199 | ), 200 | onPressed: _logout(), 201 | child: const Text('Logout'), 202 | ), 203 | ElevatedButton( 204 | onPressed: _privKey(_getPrivKey), 205 | child: const Text('Get PrivKey'), 206 | ), 207 | ElevatedButton( 208 | onPressed: _userInfo(_getUserInfo), 209 | child: const Text('Get UserInfo'), 210 | ), 211 | ElevatedButton( 212 | onPressed: _launchWalletServices(), 213 | child: const Text('Launch Wallet Services'), 214 | ), 215 | ElevatedButton( 216 | onPressed: _setupMFA(), 217 | child: const Text('Setup MFA'), 218 | ), 219 | ElevatedButton( 220 | onPressed: _manageMFA(), 221 | child: const Text('Manage MFA'), 222 | ), 223 | ElevatedButton( 224 | onPressed: _signMesssage(context), 225 | child: const Text('Sign Message'), 226 | ), 227 | ], 228 | ), 229 | ), 230 | Padding( 231 | padding: const EdgeInsets.all(8.0), 232 | child: Text(_result), 233 | ) 234 | ], 235 | ), 236 | ), 237 | ), 238 | ); 239 | }, 240 | ), 241 | ); 242 | } 243 | 244 | VoidCallback _login(Future Function() method) { 245 | return () async { 246 | try { 247 | final Web3AuthResponse _ = await method(); 248 | setState(() { 249 | logoutVisible = true; 250 | }); 251 | } on UserCancelledException { 252 | log("User cancelled."); 253 | } on UnKnownException { 254 | log("Unknown exception occurred"); 255 | } catch (e) { 256 | log(e.toString()); 257 | } 258 | }; 259 | } 260 | 261 | VoidCallback _logout() { 262 | return () async { 263 | try { 264 | await Web3AuthFlutter.logout(); 265 | setState(() { 266 | _result = ''; 267 | logoutVisible = false; 268 | }); 269 | } on UserCancelledException { 270 | log("User cancelled."); 271 | } on UnKnownException { 272 | log("Unknown exception occurred"); 273 | } 274 | }; 275 | } 276 | 277 | VoidCallback _privKey(Future Function() method) { 278 | return () async { 279 | try { 280 | final String response = await Web3AuthFlutter.getPrivKey(); 281 | setState(() { 282 | _result = response; 283 | logoutVisible = true; 284 | }); 285 | } on UserCancelledException { 286 | log("User cancelled."); 287 | } on UnKnownException { 288 | log("Unknown exception occurred"); 289 | } 290 | }; 291 | } 292 | 293 | VoidCallback _userInfo(Future Function() method) { 294 | return () async { 295 | try { 296 | final TorusUserInfo response = await Web3AuthFlutter.getUserInfo(); 297 | setState(() { 298 | _result = response.toString(); 299 | logoutVisible = true; 300 | }); 301 | } on UserCancelledException { 302 | log("User cancelled."); 303 | } on UnKnownException { 304 | log("Unknown exception occurred"); 305 | } 306 | }; 307 | } 308 | 309 | Future _withGoogle() { 310 | return Web3AuthFlutter.login( 311 | LoginParams(loginProvider: Provider.google, mfaLevel: MFALevel.NONE), 312 | ); 313 | } 314 | 315 | Future _withFacebook() { 316 | return Web3AuthFlutter.login(LoginParams(loginProvider: Provider.facebook)); 317 | } 318 | 319 | Future _withEmailPasswordless() { 320 | return Web3AuthFlutter.login( 321 | LoginParams( 322 | loginProvider: Provider.email_passwordless, 323 | extraLoginOptions: ExtraLoginOptions( 324 | login_hint: textEditingController.text, 325 | ), 326 | ), 327 | ); 328 | } 329 | 330 | Future _withDiscord() { 331 | return Web3AuthFlutter.login(LoginParams(loginProvider: Provider.discord)); 332 | } 333 | 334 | Future _getPrivKey() { 335 | return Web3AuthFlutter.getPrivKey(); 336 | } 337 | 338 | Future _getUserInfo() { 339 | return Web3AuthFlutter.getUserInfo(); 340 | } 341 | 342 | VoidCallback _launchWalletServices() { 343 | return () async { 344 | try { 345 | await Web3AuthFlutter.launchWalletServices( 346 | ChainConfig( 347 | chainId: "0x89", 348 | rpcTarget: 349 | "https://mainnet.infura.io/v3/daeee53504be4cd3a997d4f2718d33e0", 350 | ), 351 | ); 352 | } on UserCancelledException { 353 | log("User cancelled."); 354 | } on UnKnownException { 355 | log("Unknown exception occurred"); 356 | } 357 | }; 358 | } 359 | 360 | VoidCallback _setupMFA() { 361 | return () async { 362 | try { 363 | await Web3AuthFlutter.enableMFA(); 364 | } on UserCancelledException { 365 | log("User cancelled."); 366 | } on UnKnownException { 367 | log("Unknown exception occurred"); 368 | } 369 | }; 370 | } 371 | 372 | VoidCallback _manageMFA() { 373 | return () async { 374 | try { 375 | bool result = await Web3AuthFlutter.manageMFA(); 376 | if (result) { 377 | log("MFA manage successfully done."); 378 | } else { 379 | log("Some error occured."); 380 | } 381 | } on UserCancelledException { 382 | log("User cancelled."); 383 | } on UnKnownException { 384 | log("Unknown exception occurred"); 385 | } 386 | }; 387 | } 388 | 389 | VoidCallback _signMesssage(BuildContext context) { 390 | return () async { 391 | try { 392 | String? privKey = await _getPrivKey(); 393 | final credentials = EthPrivateKey.fromHex(privKey!); 394 | final address = credentials.address; 395 | List params = []; 396 | params.add("Hello, Web3Auth from Flutter!"); 397 | params.add(address.hexEip55); 398 | params.add("Web3Auth"); 399 | final signResponse = await Web3AuthFlutter.request( 400 | ChainConfig(chainId: "0x89", rpcTarget: "https://polygon-rpc.com/"), 401 | "personal_sign", 402 | params, 403 | appState: "web3auth", 404 | ); 405 | if (context.mounted) { 406 | showAlertDialog( 407 | context, 408 | 'Sign Result', 409 | signResponse.toString(), 410 | ); 411 | } 412 | } on UserCancelledException { 413 | log("User cancelled."); 414 | } on UnKnownException { 415 | log("Unknown exception occurred"); 416 | } 417 | }; 418 | } 419 | 420 | void showAlertDialog(BuildContext context, String title, String content) { 421 | showDialog( 422 | context: context, 423 | builder: (BuildContext context) { 424 | return AlertDialog( 425 | title: Text(title), 426 | content: Text(content), 427 | actions: [ 428 | TextButton( 429 | child: const Text('OK'), 430 | onPressed: () { 431 | Navigator.of(context).pop(); // Close the dialog 432 | }, 433 | ), 434 | ], 435 | ); 436 | }, 437 | ); 438 | } 439 | } 440 | -------------------------------------------------------------------------------- /lib/input.dart: -------------------------------------------------------------------------------- 1 | import 'dart:collection'; 2 | 3 | import 'package:web3auth_flutter/enums.dart'; 4 | import 'package:web3auth_flutter/web3auth_flutter.dart'; 5 | 6 | class LoginParams { 7 | /// [loginProvider] sets the oAuth login method to be used. You can use any of the 8 | /// valid [Provider] from the supported list. 9 | final Provider loginProvider; 10 | 11 | /// Custom verifier logins can get a dapp share returned to them post successful login. 12 | /// This is useful if the dapps want to use this share to allow users to login seamlessly. 13 | final String? dappShare; 14 | 15 | /// [curve] will be used to determine the public key encoded in the jwt token which returned in 16 | /// `getUserInfo` function after user login. 17 | /// 18 | /// This parameter won't change format of private key returned by We3Auth. Private key returned 19 | /// by [Web3AuthFlutter.getPrivKey] is always secp256k1. To get the ed25519 key 20 | /// you can use [Web3AuthFlutter.getEd25519PrivKey] method. 21 | /// 22 | /// The default value is [Curve.secp256k1]. 23 | final Curve? curve; 24 | 25 | /// [extraLoginOptions] can be used to set the OAuth login options for corresponding [loginProvider]. 26 | /// 27 | /// For instance, you'll need to pass user's email address as `login_hint` for [Provider.email_passwordless]. 28 | final ExtraLoginOptions? extraLoginOptions; 29 | 30 | /// Deeplinking for the application where user will be redirected after login. 31 | final Uri? redirectUrl; 32 | 33 | final String? appState; 34 | 35 | /// Customize the MFA screen shown to the user during OAuth authentication. 36 | final MFALevel? mfaLevel; 37 | final String? dappUrl; 38 | 39 | LoginParams( 40 | {required this.loginProvider, 41 | this.dappShare, 42 | this.curve = Curve.secp256k1, 43 | this.extraLoginOptions, 44 | this.redirectUrl, 45 | this.appState, 46 | this.mfaLevel, 47 | this.dappUrl}); 48 | 49 | Map toJson() => { 50 | "loginProvider": loginProvider.name, 51 | "dappShare": dappShare, 52 | "curve": curve?.name, 53 | "extraLoginOptions": extraLoginOptions?.toJson(), 54 | "redirectUrl": redirectUrl?.toString(), 55 | "appState": appState, 56 | "mfaLevel": mfaLevel?.type, 57 | "dappUrl": dappUrl 58 | }; 59 | } 60 | 61 | class LoginConfigItem { 62 | /// Custom verifier name given in the developer dashboard. 63 | final String verifier; 64 | 65 | /// The type of login for custom verifier. 66 | final TypeOfLogin typeOfLogin; 67 | 68 | /// Client id provided by your login provider used for custom verifier. 69 | final String clientId; 70 | 71 | /// Display name for the verifier. If null, the default name is used. 72 | final String? name; 73 | 74 | /// Description for the button. If provided, it renders as a full length button. else, icon button. 75 | final String? description; 76 | 77 | /// The field in JWT token which maps to verifier id. Please make sure you selected 78 | /// correct JWT verifier id in the developer dashboard. 79 | final String? verifierSubIdentifier; 80 | 81 | /// Logo to be shown on mouse hover. 82 | final String? logoHover; 83 | 84 | /// Light logo for the dark theme. 85 | final String? logoLight; 86 | 87 | /// Dark logo for the light theme. 88 | final String? logoDark; 89 | 90 | /// Show login button on the main list. 91 | final bool? mainOption; 92 | 93 | /// Whether to show the login button on Modal. 94 | final bool? showOnModal; 95 | 96 | /// Whether to show the login button on the Desktop. 97 | final bool? showOnDesktop; 98 | 99 | /// Whether to show the login button on Mobile. 100 | final bool? showOnMobile; 101 | 102 | LoginConfigItem({ 103 | required this.verifier, 104 | required this.typeOfLogin, 105 | required this.clientId, 106 | this.name, 107 | this.description, 108 | this.verifierSubIdentifier, 109 | this.logoHover, 110 | this.logoLight, 111 | this.logoDark, 112 | this.mainOption, 113 | this.showOnModal, 114 | this.showOnDesktop, 115 | this.showOnMobile, 116 | }); 117 | 118 | Map toJson() { 119 | return { 120 | 'verifier': verifier, 121 | 'typeOfLogin': typeOfLogin.name, 122 | 'clientId': clientId, 123 | 'name': name, 124 | 'description': description, 125 | 'verifierSubIdentifier': verifierSubIdentifier, 126 | 'logoHover': logoHover, 127 | 'logoLight': logoLight, 128 | 'logoDark': logoDark, 129 | 'mainOption': mainOption, 130 | 'showOnModal': showOnModal, 131 | 'showOnDesktop': showOnDesktop, 132 | 'showOnMobile': showOnMobile 133 | }; 134 | } 135 | } 136 | 137 | class ExtraLoginOptions { 138 | final Map? additionalParams; 139 | 140 | /// Your custom authentication domain. For example, if you are using Auth0, 141 | /// it can be example.au.auth0.com. 142 | final String? domain; 143 | 144 | /// Client id provided by your login provider used for custom verifier 145 | final String? client_id; 146 | 147 | /// The value used to account for clock skew in JWT expirations. The value is 148 | /// in the seconds, and ideally should no more than 60 seconds or 120 seconds at max. 149 | final String? leeway; 150 | 151 | /// The field in JWT token which maps to verifier id. Please make sure you selected 152 | /// correct JWT verifier id in the developer dashboard. 153 | final String? verifierIdField; 154 | 155 | /// Whether the verifier id field is case sensitive or not. 156 | final bool? isVerifierIdCaseSensitive; 157 | 158 | /// Allows developers the configure the display of UI. Checkout [Display] for more 159 | /// details. 160 | final Display? display; 161 | 162 | /// Prompt shown to the user during authentication process. Checkout [Prompt] for more 163 | /// details. 164 | final Prompt? prompt; 165 | 166 | /// Max time allowed without reauthentication. If the last time user authenticated 167 | /// is greater than this value, then user must reauthenticate. 168 | final String? max_age; 169 | 170 | /// The space separated list of language tags, ordered by preference. For instance 171 | /// `fr-CA fr en`. 172 | final String? ui_locales; 173 | 174 | /// [id_token_hint] denotes the previously issued ID token. 175 | final String? id_token_hint; 176 | 177 | final String? id_token; 178 | 179 | /// [login_hint] is used to send the user's email address during [Provider.email_passwordless]. 180 | final String? login_hint; 181 | 182 | final String? acr_values; 183 | 184 | /// The default scope to be used on authentication requests. The defaultScope 185 | /// defined in the Auth0Client is included along with this scope. 186 | final String? scope; 187 | 188 | /// The audience, presented as the aud claim in the access token, 189 | /// defines the intended consumer of the token. 190 | final String? audience; 191 | 192 | /// The name of the connection configured for your application. If null, it will redirect to 193 | /// the Auth0 Login Page and show the Login Widget. 194 | final String? connection; 195 | 196 | final String? state; 197 | 198 | /// Defines which grant to execute for the authorization server. 199 | final String? response_type; 200 | final String? nonce; 201 | 202 | /// [redirectUrl] can be used to specify the default url, where your custom jwt verifier can redirect 203 | /// your browser to with the result. If you are using Auth0, it must be whitelisted in the Allowed 204 | /// Callback URLs in your Auth0's application. 205 | final String? redirect_uri; 206 | 207 | ExtraLoginOptions({ 208 | this.additionalParams = const {}, 209 | this.domain, 210 | this.client_id, 211 | this.leeway, 212 | this.verifierIdField, 213 | this.isVerifierIdCaseSensitive, 214 | this.display, 215 | this.prompt, 216 | this.max_age, 217 | this.ui_locales, 218 | this.id_token_hint, 219 | this.id_token, 220 | this.login_hint, 221 | this.acr_values, 222 | this.scope, 223 | this.audience, 224 | this.connection, 225 | this.state, 226 | this.response_type, 227 | this.nonce, 228 | this.redirect_uri, 229 | }); 230 | 231 | Map toJson() => { 232 | "additionalParams": additionalParams, 233 | "domain": domain, 234 | "client_id": client_id, 235 | "leeway": leeway, 236 | "verifierIdField": verifierIdField, 237 | "isVerifierIdCaseSensitive": isVerifierIdCaseSensitive, 238 | "display": display?.name, 239 | "prompt": prompt?.name, 240 | "max_age": max_age, 241 | "ui_locales": ui_locales, 242 | "id_token_hint": id_token_hint, 243 | "id_token": id_token, 244 | "login_hint": login_hint, 245 | "acr_values": acr_values, 246 | "scope": scope, 247 | "audience": audience, 248 | "connection": connection, 249 | "state": state, 250 | "response_type": response_type, 251 | "nonce": nonce, 252 | "redirect_uri": redirect_uri, 253 | }; 254 | } 255 | 256 | class WhiteLabelData { 257 | /// Display name for the app in the UI. 258 | final String? appName; 259 | 260 | /// App logo to be used in dark mode. 261 | final String? logoLight; 262 | 263 | /// App logo to be used in light mode. 264 | final String? logoDark; 265 | 266 | /// Language which will be used by Web3Auth, app will use browser language if not specified. 267 | /// 268 | /// Default language is [Language.en]. Checkout [Language] for supported languages. 269 | final Language? defaultLanguage; 270 | 271 | /// Theme mode for the login modal 272 | /// 273 | /// Default value is [ThemeModes.auto]. 274 | final ThemeModes? mode; 275 | 276 | /// Used to customize the theme of the login modal. 277 | final HashMap? theme; 278 | 279 | /// Url to be used in the Modal 280 | final String? appUrl; 281 | 282 | /// Use logo loader. 283 | /// 284 | /// If [logoDark] and [logoLight] are null, the default Web3Auth logo 285 | /// will be used for the loader. 286 | final bool? useLogoLoader; 287 | 288 | WhiteLabelData({ 289 | this.appName, 290 | this.logoLight, 291 | this.logoDark, 292 | this.defaultLanguage = Language.en, 293 | this.mode = ThemeModes.auto, 294 | this.theme, 295 | this.appUrl, 296 | this.useLogoLoader = false, 297 | }); 298 | 299 | Map toJson() { 300 | return { 301 | 'appName': appName, 302 | 'logoLight': logoLight, 303 | 'logoDark': logoDark, 304 | 'defaultLanguage': defaultLanguage?.name, 305 | 'mode': mode?.name, 306 | 'theme': theme, 307 | 'appUrl': appUrl, 308 | 'useLogoLoader': useLogoLoader 309 | }; 310 | } 311 | } 312 | 313 | class MfaSetting { 314 | /// Whether the factor is enabled or not. 315 | final bool enable; 316 | 317 | /// Priority of the factor over other factors. 318 | final int? priority; 319 | 320 | /// Whether the factor is mandaotry or not for prove 321 | /// the owenership. 322 | final bool? mandatory; 323 | 324 | MfaSetting({required this.enable, this.priority, this.mandatory}); 325 | 326 | Map toJson() { 327 | return {'enable': enable, 'priority': priority, 'mandatory': mandatory}; 328 | } 329 | } 330 | 331 | class MfaSettings { 332 | /// Define the settings for device share factor. 333 | final MfaSetting? deviceShareFactor; 334 | 335 | /// Define the settings for backup share factor. 336 | final MfaSetting? backUpShareFactor; 337 | 338 | /// Define the settings for social backup factor. 339 | final MfaSetting? socialBackupFactor; 340 | 341 | /// Define the settings for password factor. 342 | final MfaSetting? passwordFactor; 343 | final MfaSetting? passkeysFactor; 344 | final MfaSetting? authenticatorFactor; 345 | 346 | MfaSettings({ 347 | this.deviceShareFactor, 348 | this.backUpShareFactor, 349 | this.socialBackupFactor, 350 | this.passwordFactor, 351 | this.passkeysFactor, 352 | this.authenticatorFactor, 353 | }); 354 | 355 | Map toJson() { 356 | return { 357 | 'deviceShareFactor': deviceShareFactor, 358 | 'backUpShareFactor': backUpShareFactor, 359 | 'socialBackupFactor': socialBackupFactor, 360 | 'passwordFactor': passwordFactor, 361 | 'passkeysFactor': passkeysFactor, 362 | 'authenticatorFactor': authenticatorFactor 363 | }; 364 | } 365 | } 366 | 367 | class ChainConfig { 368 | final ChainNamespace chainNamespace; 369 | final int? decimals; 370 | final String? blockExplorerUrl; 371 | final String chainId; 372 | final String? displayName; 373 | final String? logo; 374 | final String rpcTarget; 375 | final String? ticker; 376 | final String? tickerName; 377 | 378 | ChainConfig({ 379 | this.chainNamespace = ChainNamespace.eip155, 380 | this.decimals = 18, 381 | this.blockExplorerUrl, 382 | required this.chainId, 383 | this.displayName, 384 | this.logo, 385 | required this.rpcTarget, 386 | this.ticker, 387 | this.tickerName, 388 | }); 389 | 390 | Map toJson() { 391 | return { 392 | 'chainNamespace': chainNamespace.name, 393 | 'decimals': decimals, 394 | 'blockExplorerUrl': blockExplorerUrl, 395 | 'chainId': chainId, 396 | 'displayName': displayName, 397 | 'logo': logo, 398 | 'rpcTarget': rpcTarget, 399 | 'ticker': ticker, 400 | 'tickerName': tickerName 401 | }; 402 | } 403 | } 404 | 405 | class Web3AuthOptions { 406 | /// Client id for web3auth. 407 | /// 408 | /// You can obtain your client id from the web3auth [developer dashboard](https://dashboard.web3auth.io/). 409 | final String clientId; 410 | 411 | /// Web3Auth Network to use for the session & the issued idToken. 412 | /// 413 | /// User [Network.sapphire_mainnet] for production build. 414 | final Network network; 415 | 416 | /// [buildEnv] is used for internal testing purposes. This buildEnv 417 | /// signifies the enviroment for Web3Auth, and doesn't signifies 418 | /// the enviorment of the application. 419 | final BuildEnv? buildEnv; 420 | 421 | /// Define the desired Web3Auth service url. 422 | final String? sdkUrl; 423 | final String? walletSdkUrl; 424 | 425 | /// Deeplinking for the application where user will be redirected after login. 426 | /// Ideally, it should be bundleId and package name for iOS and Android respectively. 427 | /// 428 | /// While using redirectUrl, please make sure you have whitelisted it 429 | /// developer dashboard. Checkout [SDK reference](https://web3auth.io/docs/sdk/pnp/flutter/install#configuration-1) more details. 430 | final Uri? redirectUrl; 431 | 432 | /// WhiteLabel options for web3auth. It helps you define 433 | /// custom UI, branding, and translations for your brand app. 434 | /// 435 | /// Checkout [WhiteLabelData] for more details. 436 | final WhiteLabelData? whiteLabel; 437 | 438 | /// Login config for the custom verifiers. 439 | final HashMap? loginConfig; 440 | 441 | /// Use [useCoreKitKey] to get the core kit key. 442 | final bool? useCoreKitKey; 443 | 444 | final ChainNamespace? chainNamespace; 445 | 446 | /// Allows developers to configure the [MfaSettings] for authentication. 447 | /// 448 | /// Checkout [MFA SDK Reference](https://web3auth.io/docs/sdk/pnp/flutter/mfa) for more details. 449 | final MfaSettings? mfaSettings; 450 | 451 | /// [sessionTime] allows developers to configure the session management time. 452 | /// 453 | /// Session Time is in seconds, default is 86400 seconds which is 1 day. [sessionTime] can be max 30 days. 454 | final int? sessionTime; 455 | 456 | final ChainConfig? chainConfig; 457 | 458 | final Map? originData; 459 | 460 | final String? dashboardUrl; 461 | 462 | Web3AuthOptions({ 463 | required this.clientId, 464 | required this.network, 465 | this.buildEnv = BuildEnv.production, 466 | String? sdkUrl, 467 | String? walletSdkUrl, 468 | this.redirectUrl, 469 | this.whiteLabel, 470 | this.loginConfig, 471 | this.useCoreKitKey, 472 | this.chainNamespace = ChainNamespace.eip155, 473 | this.sessionTime = 30 * 86400, 474 | this.mfaSettings, 475 | this.originData, 476 | String? dashboardUrl, 477 | }) : chainConfig = null, 478 | sdkUrl = sdkUrl ?? getSdkUrl(buildEnv ?? BuildEnv.production), 479 | walletSdkUrl = 480 | walletSdkUrl ?? getWalletSdkUrl(buildEnv ?? BuildEnv.production), 481 | dashboardUrl = 482 | dashboardUrl ?? getDashboardUrl(buildEnv ?? BuildEnv.production); 483 | 484 | Map toJson() { 485 | return { 486 | 'clientId': clientId, 487 | 'network': network.name, 488 | 'sdkUrl': sdkUrl, 489 | 'walletSdkUrl': walletSdkUrl, 490 | 'buildEnv': buildEnv?.name, 491 | 'redirectUrl': redirectUrl.toString(), 492 | 'whiteLabel': whiteLabel?.toJson(), 493 | 'loginConfig': loginConfig, 494 | 'useCoreKitKey': useCoreKitKey, 495 | 'chainNamespace': chainNamespace?.name, 496 | 'mfaSettings': mfaSettings, 497 | "sessionTime": sessionTime, 498 | "chainConfig": chainConfig?.toJson(), 499 | "originData": originData, 500 | "dashboardUrl": dashboardUrl, 501 | }; 502 | } 503 | } 504 | 505 | class UserCancelledException implements Exception {} 506 | 507 | class UnKnownException implements Exception { 508 | final String? message; 509 | 510 | UnKnownException(this.message); 511 | } 512 | 513 | String getSdkUrl(BuildEnv? buildEnv) { 514 | const String version = "v9"; 515 | switch (buildEnv) { 516 | case BuildEnv.staging: 517 | return "https://staging-auth.web3auth.io/$version"; 518 | case BuildEnv.testing: 519 | return "https://develop-auth.web3auth.io"; 520 | case BuildEnv.production: 521 | default: 522 | return "https://auth.web3auth.io/$version"; 523 | } 524 | } 525 | 526 | String getWalletSdkUrl(BuildEnv? buildEnv) { 527 | const String walletServicesVersion = "v4"; 528 | switch (buildEnv) { 529 | case BuildEnv.staging: 530 | return "https://staging-wallet.web3auth.io/$walletServicesVersion"; 531 | case BuildEnv.testing: 532 | return "https://develop-wallet.web3auth.io"; 533 | case BuildEnv.production: 534 | default: 535 | return "https://wallet.web3auth.io/$walletServicesVersion"; 536 | } 537 | } 538 | 539 | String getDashboardUrl(BuildEnv? buildEnv) { 540 | const String walletAccountConstant = "wallet/account"; 541 | switch (buildEnv) { 542 | case BuildEnv.staging: 543 | return "https://staging-account.web3auth.io/$walletAccountConstant"; 544 | case BuildEnv.testing: 545 | return "https://develop-account.web3auth.io/$walletAccountConstant"; 546 | case BuildEnv.production: 547 | default: 548 | return "https://account.web3auth.io/$walletAccountConstant"; 549 | } 550 | } 551 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 54; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 6417AE24CB5D754F3EE51410 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAE947EDDA0BA95CF16CB2DB /* Pods_Runner.framework */; }; 13 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 14 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 15 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 16 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXCopyFilesBuildPhase section */ 20 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 21 | isa = PBXCopyFilesBuildPhase; 22 | buildActionMask = 2147483647; 23 | dstPath = ""; 24 | dstSubfolderSpec = 10; 25 | files = ( 26 | ); 27 | name = "Embed Frameworks"; 28 | runOnlyForDeploymentPostprocessing = 0; 29 | }; 30 | /* End PBXCopyFilesBuildPhase section */ 31 | 32 | /* Begin PBXFileReference section */ 33 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 34 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 35 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 36 | 49E2672243B44F152D157658 /* 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 = ""; }; 37 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 38 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 39 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 40 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 41 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 42 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 44 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 45 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 46 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 47 | C0B5E6B6EADC136FC76675BC /* 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 = ""; }; 48 | E272415E1507670A4B46C447 /* 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 = ""; }; 49 | FAE947EDDA0BA95CF16CB2DB /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | /* End PBXFileReference section */ 51 | 52 | /* Begin PBXFrameworksBuildPhase section */ 53 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 54 | isa = PBXFrameworksBuildPhase; 55 | buildActionMask = 2147483647; 56 | files = ( 57 | 6417AE24CB5D754F3EE51410 /* Pods_Runner.framework in Frameworks */, 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | /* End PBXFrameworksBuildPhase section */ 62 | 63 | /* Begin PBXGroup section */ 64 | 279092E69AE319D1F47032A8 /* Pods */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | 49E2672243B44F152D157658 /* Pods-Runner.debug.xcconfig */, 68 | E272415E1507670A4B46C447 /* Pods-Runner.release.xcconfig */, 69 | C0B5E6B6EADC136FC76675BC /* Pods-Runner.profile.xcconfig */, 70 | ); 71 | path = Pods; 72 | sourceTree = ""; 73 | }; 74 | 9740EEB11CF90186004384FC /* Flutter */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 78 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 79 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 80 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 81 | ); 82 | name = Flutter; 83 | sourceTree = ""; 84 | }; 85 | 97C146E51CF9000F007C117D = { 86 | isa = PBXGroup; 87 | children = ( 88 | 9740EEB11CF90186004384FC /* Flutter */, 89 | 97C146F01CF9000F007C117D /* Runner */, 90 | 97C146EF1CF9000F007C117D /* Products */, 91 | 279092E69AE319D1F47032A8 /* Pods */, 92 | C00EEB87E95A29FDC4A0916C /* Frameworks */, 93 | ); 94 | sourceTree = ""; 95 | }; 96 | 97C146EF1CF9000F007C117D /* Products */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | 97C146EE1CF9000F007C117D /* Runner.app */, 100 | ); 101 | name = Products; 102 | sourceTree = ""; 103 | }; 104 | 97C146F01CF9000F007C117D /* Runner */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 108 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 109 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 110 | 97C147021CF9000F007C117D /* Info.plist */, 111 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 112 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 113 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 114 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 115 | ); 116 | path = Runner; 117 | sourceTree = ""; 118 | }; 119 | C00EEB87E95A29FDC4A0916C /* Frameworks */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | FAE947EDDA0BA95CF16CB2DB /* Pods_Runner.framework */, 123 | ); 124 | name = Frameworks; 125 | sourceTree = ""; 126 | }; 127 | /* End PBXGroup section */ 128 | 129 | /* Begin PBXNativeTarget section */ 130 | 97C146ED1CF9000F007C117D /* Runner */ = { 131 | isa = PBXNativeTarget; 132 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 133 | buildPhases = ( 134 | 4B4AAA849496B06830FDDC14 /* [CP] Check Pods Manifest.lock */, 135 | 9740EEB61CF901F6004384FC /* Run Script */, 136 | 97C146EA1CF9000F007C117D /* Sources */, 137 | 97C146EB1CF9000F007C117D /* Frameworks */, 138 | 97C146EC1CF9000F007C117D /* Resources */, 139 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 140 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 141 | E5621378860AA2F297ADA899 /* [CP] Embed Pods Frameworks */, 142 | ); 143 | buildRules = ( 144 | ); 145 | dependencies = ( 146 | ); 147 | name = Runner; 148 | productName = Runner; 149 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 150 | productType = "com.apple.product-type.application"; 151 | }; 152 | /* End PBXNativeTarget section */ 153 | 154 | /* Begin PBXProject section */ 155 | 97C146E61CF9000F007C117D /* Project object */ = { 156 | isa = PBXProject; 157 | attributes = { 158 | LastUpgradeCheck = 1510; 159 | ORGANIZATIONNAME = ""; 160 | TargetAttributes = { 161 | 97C146ED1CF9000F007C117D = { 162 | CreatedOnToolsVersion = 7.3.1; 163 | LastSwiftMigration = 1100; 164 | }; 165 | }; 166 | }; 167 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 168 | compatibilityVersion = "Xcode 9.3"; 169 | developmentRegion = en; 170 | hasScannedForEncodings = 0; 171 | knownRegions = ( 172 | en, 173 | Base, 174 | ); 175 | mainGroup = 97C146E51CF9000F007C117D; 176 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 177 | projectDirPath = ""; 178 | projectRoot = ""; 179 | targets = ( 180 | 97C146ED1CF9000F007C117D /* Runner */, 181 | ); 182 | }; 183 | /* End PBXProject section */ 184 | 185 | /* Begin PBXResourcesBuildPhase section */ 186 | 97C146EC1CF9000F007C117D /* Resources */ = { 187 | isa = PBXResourcesBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 191 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 192 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 193 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 194 | ); 195 | runOnlyForDeploymentPostprocessing = 0; 196 | }; 197 | /* End PBXResourcesBuildPhase section */ 198 | 199 | /* Begin PBXShellScriptBuildPhase section */ 200 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 201 | isa = PBXShellScriptBuildPhase; 202 | alwaysOutOfDate = 1; 203 | buildActionMask = 2147483647; 204 | files = ( 205 | ); 206 | inputPaths = ( 207 | "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", 208 | ); 209 | name = "Thin Binary"; 210 | outputPaths = ( 211 | ); 212 | runOnlyForDeploymentPostprocessing = 0; 213 | shellPath = /bin/sh; 214 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 215 | }; 216 | 4B4AAA849496B06830FDDC14 /* [CP] Check Pods Manifest.lock */ = { 217 | isa = PBXShellScriptBuildPhase; 218 | buildActionMask = 2147483647; 219 | files = ( 220 | ); 221 | inputFileListPaths = ( 222 | ); 223 | inputPaths = ( 224 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 225 | "${PODS_ROOT}/Manifest.lock", 226 | ); 227 | name = "[CP] Check Pods Manifest.lock"; 228 | outputFileListPaths = ( 229 | ); 230 | outputPaths = ( 231 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 232 | ); 233 | runOnlyForDeploymentPostprocessing = 0; 234 | shellPath = /bin/sh; 235 | 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"; 236 | showEnvVarsInLog = 0; 237 | }; 238 | 9740EEB61CF901F6004384FC /* Run Script */ = { 239 | isa = PBXShellScriptBuildPhase; 240 | alwaysOutOfDate = 1; 241 | buildActionMask = 2147483647; 242 | files = ( 243 | ); 244 | inputPaths = ( 245 | ); 246 | name = "Run Script"; 247 | outputPaths = ( 248 | ); 249 | runOnlyForDeploymentPostprocessing = 0; 250 | shellPath = /bin/sh; 251 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 252 | }; 253 | E5621378860AA2F297ADA899 /* [CP] Embed Pods Frameworks */ = { 254 | isa = PBXShellScriptBuildPhase; 255 | buildActionMask = 2147483647; 256 | files = ( 257 | ); 258 | inputFileListPaths = ( 259 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", 260 | ); 261 | name = "[CP] Embed Pods Frameworks"; 262 | outputFileListPaths = ( 263 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", 264 | ); 265 | runOnlyForDeploymentPostprocessing = 0; 266 | shellPath = /bin/sh; 267 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 268 | showEnvVarsInLog = 0; 269 | }; 270 | /* End PBXShellScriptBuildPhase section */ 271 | 272 | /* Begin PBXSourcesBuildPhase section */ 273 | 97C146EA1CF9000F007C117D /* Sources */ = { 274 | isa = PBXSourcesBuildPhase; 275 | buildActionMask = 2147483647; 276 | files = ( 277 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 278 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 279 | ); 280 | runOnlyForDeploymentPostprocessing = 0; 281 | }; 282 | /* End PBXSourcesBuildPhase section */ 283 | 284 | /* Begin PBXVariantGroup section */ 285 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 286 | isa = PBXVariantGroup; 287 | children = ( 288 | 97C146FB1CF9000F007C117D /* Base */, 289 | ); 290 | name = Main.storyboard; 291 | sourceTree = ""; 292 | }; 293 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 294 | isa = PBXVariantGroup; 295 | children = ( 296 | 97C147001CF9000F007C117D /* Base */, 297 | ); 298 | name = LaunchScreen.storyboard; 299 | sourceTree = ""; 300 | }; 301 | /* End PBXVariantGroup section */ 302 | 303 | /* Begin XCBuildConfiguration section */ 304 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 305 | isa = XCBuildConfiguration; 306 | buildSettings = { 307 | ALWAYS_SEARCH_USER_PATHS = NO; 308 | CLANG_ANALYZER_NONNULL = YES; 309 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 310 | CLANG_CXX_LIBRARY = "libc++"; 311 | CLANG_ENABLE_MODULES = YES; 312 | CLANG_ENABLE_OBJC_ARC = YES; 313 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 314 | CLANG_WARN_BOOL_CONVERSION = YES; 315 | CLANG_WARN_COMMA = YES; 316 | CLANG_WARN_CONSTANT_CONVERSION = YES; 317 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 318 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 319 | CLANG_WARN_EMPTY_BODY = YES; 320 | CLANG_WARN_ENUM_CONVERSION = YES; 321 | CLANG_WARN_INFINITE_RECURSION = YES; 322 | CLANG_WARN_INT_CONVERSION = YES; 323 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 324 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 325 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 326 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 327 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 328 | CLANG_WARN_STRICT_PROTOTYPES = YES; 329 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 330 | CLANG_WARN_UNREACHABLE_CODE = YES; 331 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 332 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 333 | COPY_PHASE_STRIP = NO; 334 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 335 | ENABLE_NS_ASSERTIONS = NO; 336 | ENABLE_STRICT_OBJC_MSGSEND = YES; 337 | GCC_C_LANGUAGE_STANDARD = gnu99; 338 | GCC_NO_COMMON_BLOCKS = YES; 339 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 340 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 341 | GCC_WARN_UNDECLARED_SELECTOR = YES; 342 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 343 | GCC_WARN_UNUSED_FUNCTION = YES; 344 | GCC_WARN_UNUSED_VARIABLE = YES; 345 | IPHONEOS_DEPLOYMENT_TARGET = 13.0; 346 | MTL_ENABLE_DEBUG_INFO = NO; 347 | SDKROOT = iphoneos; 348 | SUPPORTED_PLATFORMS = iphoneos; 349 | TARGETED_DEVICE_FAMILY = "1,2"; 350 | VALIDATE_PRODUCT = YES; 351 | }; 352 | name = Profile; 353 | }; 354 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 355 | isa = XCBuildConfiguration; 356 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 357 | buildSettings = { 358 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 359 | CLANG_ENABLE_MODULES = YES; 360 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 361 | DEVELOPMENT_TEAM = 2Q63NCPY55; 362 | ENABLE_BITCODE = NO; 363 | INFOPLIST_FILE = Runner/Info.plist; 364 | IPHONEOS_DEPLOYMENT_TARGET = 13.0; 365 | LD_RUNPATH_SEARCH_PATHS = ( 366 | "$(inherited)", 367 | "@executable_path/Frameworks", 368 | ); 369 | PRODUCT_BUNDLE_IDENTIFIER = com.web3auth.flutter.web3authflutterexample; 370 | PRODUCT_NAME = "$(TARGET_NAME)"; 371 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 372 | SWIFT_VERSION = 5.0; 373 | VERSIONING_SYSTEM = "apple-generic"; 374 | }; 375 | name = Profile; 376 | }; 377 | 97C147031CF9000F007C117D /* Debug */ = { 378 | isa = XCBuildConfiguration; 379 | buildSettings = { 380 | ALWAYS_SEARCH_USER_PATHS = NO; 381 | CLANG_ANALYZER_NONNULL = YES; 382 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 383 | CLANG_CXX_LIBRARY = "libc++"; 384 | CLANG_ENABLE_MODULES = YES; 385 | CLANG_ENABLE_OBJC_ARC = YES; 386 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 387 | CLANG_WARN_BOOL_CONVERSION = YES; 388 | CLANG_WARN_COMMA = YES; 389 | CLANG_WARN_CONSTANT_CONVERSION = YES; 390 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 391 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 392 | CLANG_WARN_EMPTY_BODY = YES; 393 | CLANG_WARN_ENUM_CONVERSION = YES; 394 | CLANG_WARN_INFINITE_RECURSION = YES; 395 | CLANG_WARN_INT_CONVERSION = YES; 396 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 397 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 398 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 399 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 400 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 401 | CLANG_WARN_STRICT_PROTOTYPES = YES; 402 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 403 | CLANG_WARN_UNREACHABLE_CODE = YES; 404 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 405 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 406 | COPY_PHASE_STRIP = NO; 407 | DEBUG_INFORMATION_FORMAT = dwarf; 408 | ENABLE_STRICT_OBJC_MSGSEND = YES; 409 | ENABLE_TESTABILITY = YES; 410 | GCC_C_LANGUAGE_STANDARD = gnu99; 411 | GCC_DYNAMIC_NO_PIC = NO; 412 | GCC_NO_COMMON_BLOCKS = YES; 413 | GCC_OPTIMIZATION_LEVEL = 0; 414 | GCC_PREPROCESSOR_DEFINITIONS = ( 415 | "DEBUG=1", 416 | "$(inherited)", 417 | ); 418 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 419 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 420 | GCC_WARN_UNDECLARED_SELECTOR = YES; 421 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 422 | GCC_WARN_UNUSED_FUNCTION = YES; 423 | GCC_WARN_UNUSED_VARIABLE = YES; 424 | IPHONEOS_DEPLOYMENT_TARGET = 13.0; 425 | MTL_ENABLE_DEBUG_INFO = YES; 426 | ONLY_ACTIVE_ARCH = YES; 427 | SDKROOT = iphoneos; 428 | TARGETED_DEVICE_FAMILY = "1,2"; 429 | }; 430 | name = Debug; 431 | }; 432 | 97C147041CF9000F007C117D /* Release */ = { 433 | isa = XCBuildConfiguration; 434 | buildSettings = { 435 | ALWAYS_SEARCH_USER_PATHS = NO; 436 | CLANG_ANALYZER_NONNULL = YES; 437 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 438 | CLANG_CXX_LIBRARY = "libc++"; 439 | CLANG_ENABLE_MODULES = YES; 440 | CLANG_ENABLE_OBJC_ARC = YES; 441 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 442 | CLANG_WARN_BOOL_CONVERSION = YES; 443 | CLANG_WARN_COMMA = YES; 444 | CLANG_WARN_CONSTANT_CONVERSION = YES; 445 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 446 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 447 | CLANG_WARN_EMPTY_BODY = YES; 448 | CLANG_WARN_ENUM_CONVERSION = YES; 449 | CLANG_WARN_INFINITE_RECURSION = YES; 450 | CLANG_WARN_INT_CONVERSION = YES; 451 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 452 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 453 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 454 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 455 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 456 | CLANG_WARN_STRICT_PROTOTYPES = YES; 457 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 458 | CLANG_WARN_UNREACHABLE_CODE = YES; 459 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 460 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 461 | COPY_PHASE_STRIP = NO; 462 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 463 | ENABLE_NS_ASSERTIONS = NO; 464 | ENABLE_STRICT_OBJC_MSGSEND = YES; 465 | GCC_C_LANGUAGE_STANDARD = gnu99; 466 | GCC_NO_COMMON_BLOCKS = YES; 467 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 468 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 469 | GCC_WARN_UNDECLARED_SELECTOR = YES; 470 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 471 | GCC_WARN_UNUSED_FUNCTION = YES; 472 | GCC_WARN_UNUSED_VARIABLE = YES; 473 | IPHONEOS_DEPLOYMENT_TARGET = 13.0; 474 | MTL_ENABLE_DEBUG_INFO = NO; 475 | SDKROOT = iphoneos; 476 | SUPPORTED_PLATFORMS = iphoneos; 477 | SWIFT_COMPILATION_MODE = wholemodule; 478 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 479 | TARGETED_DEVICE_FAMILY = "1,2"; 480 | VALIDATE_PRODUCT = YES; 481 | }; 482 | name = Release; 483 | }; 484 | 97C147061CF9000F007C117D /* Debug */ = { 485 | isa = XCBuildConfiguration; 486 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 487 | buildSettings = { 488 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 489 | CLANG_ENABLE_MODULES = YES; 490 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 491 | DEVELOPMENT_TEAM = 2Q63NCPY55; 492 | ENABLE_BITCODE = NO; 493 | INFOPLIST_FILE = Runner/Info.plist; 494 | IPHONEOS_DEPLOYMENT_TARGET = 13.0; 495 | LD_RUNPATH_SEARCH_PATHS = ( 496 | "$(inherited)", 497 | "@executable_path/Frameworks", 498 | ); 499 | PRODUCT_BUNDLE_IDENTIFIER = com.web3auth.flutter.web3authflutterexample; 500 | PRODUCT_NAME = "$(TARGET_NAME)"; 501 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 502 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 503 | SWIFT_VERSION = 5.0; 504 | VERSIONING_SYSTEM = "apple-generic"; 505 | }; 506 | name = Debug; 507 | }; 508 | 97C147071CF9000F007C117D /* Release */ = { 509 | isa = XCBuildConfiguration; 510 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 511 | buildSettings = { 512 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 513 | CLANG_ENABLE_MODULES = YES; 514 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 515 | DEVELOPMENT_TEAM = 2Q63NCPY55; 516 | ENABLE_BITCODE = NO; 517 | INFOPLIST_FILE = Runner/Info.plist; 518 | IPHONEOS_DEPLOYMENT_TARGET = 13.0; 519 | LD_RUNPATH_SEARCH_PATHS = ( 520 | "$(inherited)", 521 | "@executable_path/Frameworks", 522 | ); 523 | PRODUCT_BUNDLE_IDENTIFIER = com.web3auth.flutter.web3authflutterexample; 524 | PRODUCT_NAME = "$(TARGET_NAME)"; 525 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 526 | SWIFT_VERSION = 5.0; 527 | VERSIONING_SYSTEM = "apple-generic"; 528 | }; 529 | name = Release; 530 | }; 531 | /* End XCBuildConfiguration section */ 532 | 533 | /* Begin XCConfigurationList section */ 534 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 535 | isa = XCConfigurationList; 536 | buildConfigurations = ( 537 | 97C147031CF9000F007C117D /* Debug */, 538 | 97C147041CF9000F007C117D /* Release */, 539 | 249021D3217E4FDB00AE95B9 /* Profile */, 540 | ); 541 | defaultConfigurationIsVisible = 0; 542 | defaultConfigurationName = Release; 543 | }; 544 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 545 | isa = XCConfigurationList; 546 | buildConfigurations = ( 547 | 97C147061CF9000F007C117D /* Debug */, 548 | 97C147071CF9000F007C117D /* Release */, 549 | 249021D4217E4FDB00AE95B9 /* Profile */, 550 | ); 551 | defaultConfigurationIsVisible = 0; 552 | defaultConfigurationName = Release; 553 | }; 554 | /* End XCConfigurationList section */ 555 | }; 556 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 557 | } 558 | --------------------------------------------------------------------------------