├── .github └── FUNDING.yml ├── .gitignore ├── .idx └── dev.nix ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── Makefile ├── README.md ├── example ├── .gitignore ├── .metadata ├── Makefile ├── README.md ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── example │ │ │ │ │ └── MainActivity.kt │ │ │ └── res │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── 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 │ │ │ │ ├── values-night │ │ │ │ └── styles.xml │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ └── WorkspaceSettings.xcsettings │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── Runner │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── 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-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── Runner-Bridging-Header.h ├── lib │ ├── eip712Signing.dart │ ├── main.dart │ └── utils.dart ├── pubspec.lock ├── pubspec.yaml ├── test │ └── widget_test.dart └── web │ ├── favicon.png │ ├── icons │ ├── Icon-192.png │ └── Icon-512.png │ ├── index.html │ └── manifest.json ├── lib ├── ethereum.dart ├── ethers.dart └── flutter_web3_provider.dart ├── pubspec.lock ├── pubspec.yaml └── test └── flutter_web3_provider_test.dart /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: treeder 4 | -------------------------------------------------------------------------------- /.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 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | build/ 32 | 33 | # Android related 34 | **/android/**/gradle-wrapper.jar 35 | **/android/.gradle 36 | **/android/captures/ 37 | **/android/gradlew 38 | **/android/gradlew.bat 39 | **/android/local.properties 40 | **/android/**/GeneratedPluginRegistrant.java 41 | 42 | # iOS/XCode related 43 | **/ios/**/*.mode1v3 44 | **/ios/**/*.mode2v3 45 | **/ios/**/*.moved-aside 46 | **/ios/**/*.pbxuser 47 | **/ios/**/*.perspectivev3 48 | **/ios/**/*sync/ 49 | **/ios/**/.sconsign.dblite 50 | **/ios/**/.tags* 51 | **/ios/**/.vagrant/ 52 | **/ios/**/DerivedData/ 53 | **/ios/**/Icon? 54 | **/ios/**/Pods/ 55 | **/ios/**/.symlinks/ 56 | **/ios/**/profile 57 | **/ios/**/xcuserdata 58 | **/ios/.generated/ 59 | **/ios/Flutter/App.framework 60 | **/ios/Flutter/Flutter.framework 61 | **/ios/Flutter/Flutter.podspec 62 | **/ios/Flutter/Generated.xcconfig 63 | **/ios/Flutter/app.flx 64 | **/ios/Flutter/app.zip 65 | **/ios/Flutter/flutter_assets/ 66 | **/ios/Flutter/flutter_export_environment.sh 67 | **/ios/ServiceDefinitions.json 68 | **/ios/Runner/GeneratedPluginRegistrant.* 69 | 70 | # Exceptions to above rules. 71 | !**/ios/**/default.mode1v3 72 | !**/ios/**/default.mode2v3 73 | !**/ios/**/default.pbxuser 74 | !**/ios/**/default.perspectivev3 75 | -------------------------------------------------------------------------------- /.idx/dev.nix: -------------------------------------------------------------------------------- 1 | # To learn more about how to use Nix to configure your environment 2 | # see: https://developers.google.com/idx/guides/customize-idx-env 3 | { pkgs, ... }: { 4 | # Which nixpkgs channel to use. 5 | channel = "stable-23.11"; # or "unstable" 6 | 7 | # Use https://search.nixos.org/packages to find packages 8 | packages = [ 9 | # pkgs.go 10 | # pkgs.python311 11 | # pkgs.python311Packages.pip 12 | # pkgs.nodejs_20 13 | # pkgs.nodePackages.nodemon 14 | pkgs.gnumake 15 | ]; 16 | 17 | # Sets environment variables in the workspace 18 | env = { }; 19 | services.docker.enable = true; 20 | idx = { 21 | # Search for the extensions you want on https://open-vsx.org/ and use "publisher.id" 22 | extensions = [ 23 | # "vscodevim.vim" 24 | ]; 25 | 26 | # Enable previews 27 | previews = { 28 | enable = true; 29 | previews = { 30 | # web = { 31 | # # Example: run "npm run dev" with PORT set to IDX's defined port for previews, 32 | # # and show it in IDX's web preview panel 33 | # command = ["npm" "run" "dev"]; 34 | # manager = "web"; 35 | # env = { 36 | # # Environment variables to set for your server 37 | # PORT = "$PORT"; 38 | # }; 39 | # }; 40 | }; 41 | }; 42 | 43 | # Workspace lifecycle hooks 44 | workspace = { 45 | # Runs when a workspace is first created 46 | onCreate = { 47 | # Example: install JS dependencies from NPM 48 | # npm-install = "npm install"; 49 | }; 50 | # Runs when the workspace is (re)started 51 | onStart = { 52 | # Example: start a background task to watch and re-build backend code 53 | # watch-backend = "npm run watch-backend"; 54 | }; 55 | }; 56 | }; 57 | } 58 | -------------------------------------------------------------------------------- /.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: a83755763499472053b5af8acc0f53b8727a4826 8 | channel: master 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [0.0.1] - TODO: Add release date. 2 | 3 | * TODO: Describe initial release. 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2020 GoChain.io 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: build run bump publish 2 | 3 | bump: 4 | docker run --rm -it -v ${CURDIR}:/app -w /app treeder/bump --filename pubspec.yaml bump 5 | 6 | publish: bump 7 | flutter pub publish -f 8 | git commit -am "new version" 9 | git push 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # flutter_web3_provider 2 | 3 | Flutter wrapper for using web3 providers, ie: accessing `window.ethereum`. 4 | 5 | NOTE: This is for web only! 6 | 7 | ## Getting Started 8 | 9 | For full example, see: https://github.com/gochain/flutter_web3_provider/blob/main/example/lib/main.dart 10 | 11 | Add import `import 'package:flutter_web3_provider/ethereum.dart';` 12 | 13 | Then you can access it just be using the `ethereum` variable. 14 | 15 | ```dart 16 | if(ethereum != null){ 17 | // then an ethereum provider was injected 18 | print(ethereum.selectedAddress); 19 | } 20 | ``` 21 | 22 | Ask user to connect their wallet: 23 | 24 | ```dart 25 | RaisedButton( 26 | child: Text("Connect Wallet"), 27 | onPressed: () async { 28 | var accounts = await promiseToFuture( 29 | ethereum.request(RequestParams(method: 'eth_requestAccounts'))); 30 | print(accounts); 31 | String se = ethereum.selectedAddress; 32 | print("selectedAddress: $se"); 33 | setState(() { 34 | selectedAddress = se; 35 | }); 36 | }, 37 | ) 38 | ``` 39 | 40 | ### Using ethers.js 41 | 42 | Add ethers.js to `web/index.html`. 43 | 44 | ```html 45 | 50 | ``` 51 | 52 | Import package: 53 | 54 | ``` 55 | import 'package:flutter_web3_provider/ethers.dart'; 56 | ``` 57 | 58 | Then create an ethers provider: 59 | 60 | ```dart 61 | // For a read-only provider: 62 | var provider = JsonRpcProvider("https://rpc.gochain.io"); 63 | // For a read-write provider (ie: metamask, trust wallet, etc) 64 | var web3 = BrowserProvider(ethereum); 65 | ``` 66 | 67 | Then you can do things like check balance and submit transactions, etc: 68 | 69 | ```dart 70 | var abalanceF = promiseToFuture(web3.getBalance(ethereum.selectedAddress)); 71 | 72 | Future tx = promiseToFuture(web3.Signer().sendTransaction(TxParams( 73 | to: to, 74 | value: "0x" + 75 | BigInt.parse(toBase(amount, 18).toString()).toRadixString(16)))); 76 | ``` 77 | 78 | Or use a contract: 79 | 80 | ```dart 81 | const erc20Abi = [ 82 | // Some details about the token 83 | "function name() view returns (string)", 84 | "function symbol() view returns (string)", 85 | 86 | // Get the account balance 87 | "function balanceOf(address) view returns (uint)", 88 | 89 | // Send some of your tokens to someone else 90 | "function transfer(address to, uint amount)", 91 | 92 | // An event triggered whenever anyone transfers to someone else 93 | "event Transfer(address indexed from, address indexed to, uint amount)" 94 | ]; 95 | var contract = Contract(contractAddress, erc20Abi, web3); 96 | // call balanceOf function 97 | var usdcBalanceF = promiseToFuture( 98 | callMethod(contract, "balanceOf", [ethereum.selectedAddress])); 99 | 100 | // to make a write transaction, first get the signer (this will use metamask/wallet) 101 | contract = contract.connect(await promiseToFuture(web3.getSigner())); // uses the connected wallet as signer 102 | // then call the function: 103 | var res = 104 | await promiseToFuture(callMethod(contract, "transfer", [ 105 | '0x39C5190c09ec04cF09C782bA4311C469473Ffe83', 106 | "0x" + amount.toString()).toRadixString(16) 107 | ])); 108 | ``` 109 | 110 | If you need to additional overrides like set gas price or passing the `value` param, you can add one extra param in the array with those fields, eg: 111 | 112 | ```dart 113 | var res = await promiseToFuture(callMethod( 114 | contract, "transfer", ['0x39C5190c09ec04cF09C782bA4311C469473Ffe83', "0x" + amount.toString()).toRadixString(16), 115 | TxParams(value: "1000000000000000000")])); 116 | ``` 117 | 118 | NOTES: 119 | 120 | * If you're using the human readable ABI's (ethers.js feature) like above, use `uint`, not `uint256` even if the real abi is a uint256. 121 | * There are some common functions on the Contract, but you can also call any method using `callMethod` like above. 122 | 123 | ## Developers 124 | 125 | To publish: 126 | 127 | ```sh 128 | make publish 129 | ``` 130 | -------------------------------------------------------------------------------- /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/.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: 198df796aa80073ef22bdf249e614e2ff33c6895 8 | channel: beta 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: build run 2 | 3 | run: 4 | flutter run -d web-server --web-hostname 0.0.0.0 --web-port 5000 5 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # example 2 | 3 | Start: 4 | 5 | ```sh 6 | flutter run -d web-server --web-hostname 0.0.0.0 --web-port 5000 7 | ``` 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 29 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.example.example" 42 | minSdkVersion 16 43 | targetSdkVersion 29 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | } 47 | 48 | buildTypes { 49 | release { 50 | // TODO: Add your own signing config for the release build. 51 | // Signing with the debug keys for now, so `flutter run --release` works. 52 | signingConfig signingConfigs.debug 53 | } 54 | } 55 | } 56 | 57 | flutter { 58 | source '../..' 59 | } 60 | 61 | dependencies { 62 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 63 | } 64 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 13 | 17 | 21 | 26 | 30 | 31 | 32 | 33 | 34 | 35 | 37 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/com/example/example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /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/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gochain/flutter_web3_provider/aeba068206961aff1949f931ad8f7f25c1830121/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/gochain/flutter_web3_provider/aeba068206961aff1949f931ad8f7f25c1830121/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/gochain/flutter_web3_provider/aeba068206961aff1949f931ad8f7f25c1830121/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/gochain/flutter_web3_provider/aeba068206961aff1949f931ad8f7f25c1830121/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/gochain/flutter_web3_provider/aeba068206961aff1949f931ad8f7f25c1830121/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.5.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /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-5.6.2-all.zip 7 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 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 | 9.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 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 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 13 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXCopyFilesBuildPhase section */ 19 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 20 | isa = PBXCopyFilesBuildPhase; 21 | buildActionMask = 2147483647; 22 | dstPath = ""; 23 | dstSubfolderSpec = 10; 24 | files = ( 25 | ); 26 | name = "Embed Frameworks"; 27 | runOnlyForDeploymentPostprocessing = 0; 28 | }; 29 | /* End PBXCopyFilesBuildPhase section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 33 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 34 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 35 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 36 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 38 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 39 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 40 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 42 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 43 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 44 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | /* End PBXFileReference section */ 46 | 47 | /* Begin PBXFrameworksBuildPhase section */ 48 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 49 | isa = PBXFrameworksBuildPhase; 50 | buildActionMask = 2147483647; 51 | files = ( 52 | ); 53 | runOnlyForDeploymentPostprocessing = 0; 54 | }; 55 | /* End PBXFrameworksBuildPhase section */ 56 | 57 | /* Begin PBXGroup section */ 58 | 9740EEB11CF90186004384FC /* Flutter */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 62 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 63 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 64 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 65 | ); 66 | name = Flutter; 67 | sourceTree = ""; 68 | }; 69 | 97C146E51CF9000F007C117D = { 70 | isa = PBXGroup; 71 | children = ( 72 | 9740EEB11CF90186004384FC /* Flutter */, 73 | 97C146F01CF9000F007C117D /* Runner */, 74 | 97C146EF1CF9000F007C117D /* Products */, 75 | ); 76 | sourceTree = ""; 77 | }; 78 | 97C146EF1CF9000F007C117D /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 97C146EE1CF9000F007C117D /* Runner.app */, 82 | ); 83 | name = Products; 84 | sourceTree = ""; 85 | }; 86 | 97C146F01CF9000F007C117D /* Runner */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 90 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 91 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 92 | 97C147021CF9000F007C117D /* Info.plist */, 93 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 94 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 95 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 96 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 97 | ); 98 | path = Runner; 99 | sourceTree = ""; 100 | }; 101 | /* End PBXGroup section */ 102 | 103 | /* Begin PBXNativeTarget section */ 104 | 97C146ED1CF9000F007C117D /* Runner */ = { 105 | isa = PBXNativeTarget; 106 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 107 | buildPhases = ( 108 | 9740EEB61CF901F6004384FC /* Run Script */, 109 | 97C146EA1CF9000F007C117D /* Sources */, 110 | 97C146EB1CF9000F007C117D /* Frameworks */, 111 | 97C146EC1CF9000F007C117D /* Resources */, 112 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 113 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 114 | ); 115 | buildRules = ( 116 | ); 117 | dependencies = ( 118 | ); 119 | name = Runner; 120 | productName = Runner; 121 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 122 | productType = "com.apple.product-type.application"; 123 | }; 124 | /* End PBXNativeTarget section */ 125 | 126 | /* Begin PBXProject section */ 127 | 97C146E61CF9000F007C117D /* Project object */ = { 128 | isa = PBXProject; 129 | attributes = { 130 | LastUpgradeCheck = 1020; 131 | ORGANIZATIONNAME = ""; 132 | TargetAttributes = { 133 | 97C146ED1CF9000F007C117D = { 134 | CreatedOnToolsVersion = 7.3.1; 135 | LastSwiftMigration = 1100; 136 | }; 137 | }; 138 | }; 139 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 140 | compatibilityVersion = "Xcode 9.3"; 141 | developmentRegion = en; 142 | hasScannedForEncodings = 0; 143 | knownRegions = ( 144 | en, 145 | Base, 146 | ); 147 | mainGroup = 97C146E51CF9000F007C117D; 148 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 149 | projectDirPath = ""; 150 | projectRoot = ""; 151 | targets = ( 152 | 97C146ED1CF9000F007C117D /* Runner */, 153 | ); 154 | }; 155 | /* End PBXProject section */ 156 | 157 | /* Begin PBXResourcesBuildPhase section */ 158 | 97C146EC1CF9000F007C117D /* Resources */ = { 159 | isa = PBXResourcesBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 163 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 164 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 165 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 166 | ); 167 | runOnlyForDeploymentPostprocessing = 0; 168 | }; 169 | /* End PBXResourcesBuildPhase section */ 170 | 171 | /* Begin PBXShellScriptBuildPhase section */ 172 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 173 | isa = PBXShellScriptBuildPhase; 174 | buildActionMask = 2147483647; 175 | files = ( 176 | ); 177 | inputPaths = ( 178 | ); 179 | name = "Thin Binary"; 180 | outputPaths = ( 181 | ); 182 | runOnlyForDeploymentPostprocessing = 0; 183 | shellPath = /bin/sh; 184 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 185 | }; 186 | 9740EEB61CF901F6004384FC /* Run Script */ = { 187 | isa = PBXShellScriptBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | ); 191 | inputPaths = ( 192 | ); 193 | name = "Run Script"; 194 | outputPaths = ( 195 | ); 196 | runOnlyForDeploymentPostprocessing = 0; 197 | shellPath = /bin/sh; 198 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 199 | }; 200 | /* End PBXShellScriptBuildPhase section */ 201 | 202 | /* Begin PBXSourcesBuildPhase section */ 203 | 97C146EA1CF9000F007C117D /* Sources */ = { 204 | isa = PBXSourcesBuildPhase; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 208 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 209 | ); 210 | runOnlyForDeploymentPostprocessing = 0; 211 | }; 212 | /* End PBXSourcesBuildPhase section */ 213 | 214 | /* Begin PBXVariantGroup section */ 215 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 216 | isa = PBXVariantGroup; 217 | children = ( 218 | 97C146FB1CF9000F007C117D /* Base */, 219 | ); 220 | name = Main.storyboard; 221 | sourceTree = ""; 222 | }; 223 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 224 | isa = PBXVariantGroup; 225 | children = ( 226 | 97C147001CF9000F007C117D /* Base */, 227 | ); 228 | name = LaunchScreen.storyboard; 229 | sourceTree = ""; 230 | }; 231 | /* End PBXVariantGroup section */ 232 | 233 | /* Begin XCBuildConfiguration section */ 234 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 235 | isa = XCBuildConfiguration; 236 | buildSettings = { 237 | ALWAYS_SEARCH_USER_PATHS = NO; 238 | CLANG_ANALYZER_NONNULL = YES; 239 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 240 | CLANG_CXX_LIBRARY = "libc++"; 241 | CLANG_ENABLE_MODULES = YES; 242 | CLANG_ENABLE_OBJC_ARC = YES; 243 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 244 | CLANG_WARN_BOOL_CONVERSION = YES; 245 | CLANG_WARN_COMMA = YES; 246 | CLANG_WARN_CONSTANT_CONVERSION = YES; 247 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 248 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 249 | CLANG_WARN_EMPTY_BODY = YES; 250 | CLANG_WARN_ENUM_CONVERSION = YES; 251 | CLANG_WARN_INFINITE_RECURSION = YES; 252 | CLANG_WARN_INT_CONVERSION = YES; 253 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 254 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 255 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 256 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 257 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 258 | CLANG_WARN_STRICT_PROTOTYPES = YES; 259 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 260 | CLANG_WARN_UNREACHABLE_CODE = YES; 261 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 262 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 263 | COPY_PHASE_STRIP = NO; 264 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 265 | ENABLE_NS_ASSERTIONS = NO; 266 | ENABLE_STRICT_OBJC_MSGSEND = YES; 267 | GCC_C_LANGUAGE_STANDARD = gnu99; 268 | GCC_NO_COMMON_BLOCKS = YES; 269 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 270 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 271 | GCC_WARN_UNDECLARED_SELECTOR = YES; 272 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 273 | GCC_WARN_UNUSED_FUNCTION = YES; 274 | GCC_WARN_UNUSED_VARIABLE = YES; 275 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 276 | MTL_ENABLE_DEBUG_INFO = NO; 277 | SDKROOT = iphoneos; 278 | SUPPORTED_PLATFORMS = iphoneos; 279 | TARGETED_DEVICE_FAMILY = "1,2"; 280 | VALIDATE_PRODUCT = YES; 281 | }; 282 | name = Profile; 283 | }; 284 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 285 | isa = XCBuildConfiguration; 286 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 287 | buildSettings = { 288 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 289 | CLANG_ENABLE_MODULES = YES; 290 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 291 | ENABLE_BITCODE = NO; 292 | FRAMEWORK_SEARCH_PATHS = ( 293 | "$(inherited)", 294 | "$(PROJECT_DIR)/Flutter", 295 | ); 296 | INFOPLIST_FILE = Runner/Info.plist; 297 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 298 | LIBRARY_SEARCH_PATHS = ( 299 | "$(inherited)", 300 | "$(PROJECT_DIR)/Flutter", 301 | ); 302 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 303 | PRODUCT_NAME = "$(TARGET_NAME)"; 304 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 305 | SWIFT_VERSION = 5.0; 306 | VERSIONING_SYSTEM = "apple-generic"; 307 | }; 308 | name = Profile; 309 | }; 310 | 97C147031CF9000F007C117D /* Debug */ = { 311 | isa = XCBuildConfiguration; 312 | buildSettings = { 313 | ALWAYS_SEARCH_USER_PATHS = NO; 314 | CLANG_ANALYZER_NONNULL = YES; 315 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 316 | CLANG_CXX_LIBRARY = "libc++"; 317 | CLANG_ENABLE_MODULES = YES; 318 | CLANG_ENABLE_OBJC_ARC = YES; 319 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 320 | CLANG_WARN_BOOL_CONVERSION = YES; 321 | CLANG_WARN_COMMA = YES; 322 | CLANG_WARN_CONSTANT_CONVERSION = YES; 323 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 324 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 325 | CLANG_WARN_EMPTY_BODY = YES; 326 | CLANG_WARN_ENUM_CONVERSION = YES; 327 | CLANG_WARN_INFINITE_RECURSION = YES; 328 | CLANG_WARN_INT_CONVERSION = YES; 329 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 330 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 331 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 332 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 333 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 334 | CLANG_WARN_STRICT_PROTOTYPES = YES; 335 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 336 | CLANG_WARN_UNREACHABLE_CODE = YES; 337 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 338 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 339 | COPY_PHASE_STRIP = NO; 340 | DEBUG_INFORMATION_FORMAT = dwarf; 341 | ENABLE_STRICT_OBJC_MSGSEND = YES; 342 | ENABLE_TESTABILITY = YES; 343 | GCC_C_LANGUAGE_STANDARD = gnu99; 344 | GCC_DYNAMIC_NO_PIC = NO; 345 | GCC_NO_COMMON_BLOCKS = YES; 346 | GCC_OPTIMIZATION_LEVEL = 0; 347 | GCC_PREPROCESSOR_DEFINITIONS = ( 348 | "DEBUG=1", 349 | "$(inherited)", 350 | ); 351 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 352 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 353 | GCC_WARN_UNDECLARED_SELECTOR = YES; 354 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 355 | GCC_WARN_UNUSED_FUNCTION = YES; 356 | GCC_WARN_UNUSED_VARIABLE = YES; 357 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 358 | MTL_ENABLE_DEBUG_INFO = YES; 359 | ONLY_ACTIVE_ARCH = YES; 360 | SDKROOT = iphoneos; 361 | TARGETED_DEVICE_FAMILY = "1,2"; 362 | }; 363 | name = Debug; 364 | }; 365 | 97C147041CF9000F007C117D /* Release */ = { 366 | isa = XCBuildConfiguration; 367 | buildSettings = { 368 | ALWAYS_SEARCH_USER_PATHS = NO; 369 | CLANG_ANALYZER_NONNULL = YES; 370 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 371 | CLANG_CXX_LIBRARY = "libc++"; 372 | CLANG_ENABLE_MODULES = YES; 373 | CLANG_ENABLE_OBJC_ARC = YES; 374 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 375 | CLANG_WARN_BOOL_CONVERSION = YES; 376 | CLANG_WARN_COMMA = YES; 377 | CLANG_WARN_CONSTANT_CONVERSION = YES; 378 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 379 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 380 | CLANG_WARN_EMPTY_BODY = YES; 381 | CLANG_WARN_ENUM_CONVERSION = YES; 382 | CLANG_WARN_INFINITE_RECURSION = YES; 383 | CLANG_WARN_INT_CONVERSION = YES; 384 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 385 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 386 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 387 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 388 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 389 | CLANG_WARN_STRICT_PROTOTYPES = YES; 390 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 391 | CLANG_WARN_UNREACHABLE_CODE = YES; 392 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 393 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 394 | COPY_PHASE_STRIP = NO; 395 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 396 | ENABLE_NS_ASSERTIONS = NO; 397 | ENABLE_STRICT_OBJC_MSGSEND = YES; 398 | GCC_C_LANGUAGE_STANDARD = gnu99; 399 | GCC_NO_COMMON_BLOCKS = YES; 400 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 401 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 402 | GCC_WARN_UNDECLARED_SELECTOR = YES; 403 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 404 | GCC_WARN_UNUSED_FUNCTION = YES; 405 | GCC_WARN_UNUSED_VARIABLE = YES; 406 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 407 | MTL_ENABLE_DEBUG_INFO = NO; 408 | SDKROOT = iphoneos; 409 | SUPPORTED_PLATFORMS = iphoneos; 410 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 411 | TARGETED_DEVICE_FAMILY = "1,2"; 412 | VALIDATE_PRODUCT = YES; 413 | }; 414 | name = Release; 415 | }; 416 | 97C147061CF9000F007C117D /* Debug */ = { 417 | isa = XCBuildConfiguration; 418 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 419 | buildSettings = { 420 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 421 | CLANG_ENABLE_MODULES = YES; 422 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 423 | ENABLE_BITCODE = NO; 424 | FRAMEWORK_SEARCH_PATHS = ( 425 | "$(inherited)", 426 | "$(PROJECT_DIR)/Flutter", 427 | ); 428 | INFOPLIST_FILE = Runner/Info.plist; 429 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 430 | LIBRARY_SEARCH_PATHS = ( 431 | "$(inherited)", 432 | "$(PROJECT_DIR)/Flutter", 433 | ); 434 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 435 | PRODUCT_NAME = "$(TARGET_NAME)"; 436 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 437 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 438 | SWIFT_VERSION = 5.0; 439 | VERSIONING_SYSTEM = "apple-generic"; 440 | }; 441 | name = Debug; 442 | }; 443 | 97C147071CF9000F007C117D /* Release */ = { 444 | isa = XCBuildConfiguration; 445 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 446 | buildSettings = { 447 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 448 | CLANG_ENABLE_MODULES = YES; 449 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 450 | ENABLE_BITCODE = NO; 451 | FRAMEWORK_SEARCH_PATHS = ( 452 | "$(inherited)", 453 | "$(PROJECT_DIR)/Flutter", 454 | ); 455 | INFOPLIST_FILE = Runner/Info.plist; 456 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 457 | LIBRARY_SEARCH_PATHS = ( 458 | "$(inherited)", 459 | "$(PROJECT_DIR)/Flutter", 460 | ); 461 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 462 | PRODUCT_NAME = "$(TARGET_NAME)"; 463 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 464 | SWIFT_VERSION = 5.0; 465 | VERSIONING_SYSTEM = "apple-generic"; 466 | }; 467 | name = Release; 468 | }; 469 | /* End XCBuildConfiguration section */ 470 | 471 | /* Begin XCConfigurationList section */ 472 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 473 | isa = XCConfigurationList; 474 | buildConfigurations = ( 475 | 97C147031CF9000F007C117D /* Debug */, 476 | 97C147041CF9000F007C117D /* Release */, 477 | 249021D3217E4FDB00AE95B9 /* Profile */, 478 | ); 479 | defaultConfigurationIsVisible = 0; 480 | defaultConfigurationName = Release; 481 | }; 482 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 483 | isa = XCConfigurationList; 484 | buildConfigurations = ( 485 | 97C147061CF9000F007C117D /* Debug */, 486 | 97C147071CF9000F007C117D /* Release */, 487 | 249021D4217E4FDB00AE95B9 /* Profile */, 488 | ); 489 | defaultConfigurationIsVisible = 0; 490 | defaultConfigurationName = Release; 491 | }; 492 | /* End XCConfigurationList section */ 493 | }; 494 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 495 | } 496 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 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 | -------------------------------------------------------------------------------- /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/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gochain/flutter_web3_provider/aeba068206961aff1949f931ad8f7f25c1830121/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gochain/flutter_web3_provider/aeba068206961aff1949f931ad8f7f25c1830121/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/gochain/flutter_web3_provider/aeba068206961aff1949f931ad8f7f25c1830121/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/gochain/flutter_web3_provider/aeba068206961aff1949f931ad8f7f25c1830121/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/gochain/flutter_web3_provider/aeba068206961aff1949f931ad8f7f25c1830121/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/gochain/flutter_web3_provider/aeba068206961aff1949f931ad8f7f25c1830121/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/gochain/flutter_web3_provider/aeba068206961aff1949f931ad8f7f25c1830121/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/gochain/flutter_web3_provider/aeba068206961aff1949f931ad8f7f25c1830121/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/gochain/flutter_web3_provider/aeba068206961aff1949f931ad8f7f25c1830121/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/gochain/flutter_web3_provider/aeba068206961aff1949f931ad8f7f25c1830121/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/gochain/flutter_web3_provider/aeba068206961aff1949f931ad8f7f25c1830121/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/gochain/flutter_web3_provider/aeba068206961aff1949f931ad8f7f25c1830121/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/gochain/flutter_web3_provider/aeba068206961aff1949f931ad8f7f25c1830121/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/gochain/flutter_web3_provider/aeba068206961aff1949f931ad8f7f25c1830121/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gochain/flutter_web3_provider/aeba068206961aff1949f931ad8f7f25c1830121/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gochain/flutter_web3_provider/aeba068206961aff1949f931ad8f7f25c1830121/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gochain/flutter_web3_provider/aeba068206961aff1949f931ad8f7f25c1830121/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gochain/flutter_web3_provider/aeba068206961aff1949f931ad8f7f25c1830121/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /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/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/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 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /example/lib/eip712Signing.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'dart:js_util'; 3 | 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter_web3_provider/ethereum.dart'; 6 | 7 | void main() { 8 | runApp(MyApp()); 9 | } 10 | 11 | class MyApp extends StatelessWidget { 12 | @override 13 | Widget build(BuildContext context) { 14 | return MaterialApp( 15 | title: 'Flutter Demo', 16 | theme: ThemeData( 17 | primarySwatch: Colors.blue, 18 | ), 19 | home: MyHomePage(title: 'Flutter Demo Home Page'), 20 | ); 21 | } 22 | } 23 | 24 | class MyHomePage extends StatefulWidget { 25 | MyHomePage({this.title="Home"}) ; 26 | 27 | final String title; 28 | 29 | @override 30 | _MyHomePageState createState() => _MyHomePageState(); 31 | } 32 | 33 | class _MyHomePageState extends State { 34 | String? selectedAddress; 35 | 36 | Future init() async { 37 | var accounts = await promiseToFuture( 38 | ethereum!.request(RequestParams(method: 'eth_requestAccounts'))); 39 | print(accounts); 40 | String se = ethereum!.selectedAddress; 41 | print("selectedAddress: $se"); 42 | setState(() { 43 | selectedAddress = se; 44 | }); 45 | } 46 | 47 | @override 48 | void initState() { 49 | init(); 50 | super.initState(); 51 | } 52 | 53 | var nonce = 0; 54 | var spender = "0xD7ACd2a9FD159E69Bb102A1ca21C9a3e3A5F771B"; 55 | 56 | var _eip712DomainType = [ 57 | { 58 | "name": "name", 59 | "type": "string", 60 | }, 61 | { 62 | "name": "version", 63 | "type": "string", 64 | }, 65 | { 66 | "name": "chainId", 67 | "type": "uint256", 68 | }, 69 | { 70 | "name": "verifyingContract", 71 | "type": "address", 72 | }, 73 | ]; 74 | 75 | var _permitType = [ 76 | { 77 | "name": "holder", 78 | "type": "address", 79 | }, 80 | { 81 | "name": "spender", 82 | "type": "address", 83 | }, 84 | { 85 | "name": "nonce", 86 | "type": "uint256", 87 | }, 88 | { 89 | "name": "allowance", 90 | "type": "uint256", 91 | }, 92 | ]; 93 | 94 | var _eip712Domain = { 95 | "name": "Dai Stablecoin", 96 | "version": "1", 97 | "chainId": 42, 98 | "verifyingContract": "0xaE036c65C649172b43ef7156b009c6221B596B8b", 99 | }; 100 | 101 | Future makeSigningRequest() async { 102 | var message = { 103 | "holder": selectedAddress, 104 | "spender": spender, 105 | "nonce": nonce, 106 | "allowance": 20, 107 | }; 108 | var typedData = jsonEncode({ 109 | "types": { 110 | "EIP712Domain": _eip712DomainType, 111 | "Permit": _permitType, 112 | }, 113 | "primaryType": "Permit", 114 | "domain": _eip712Domain, 115 | "message": message, 116 | }); 117 | 118 | print(typedData); 119 | 120 | String signature = await promiseToFuture(ethereum!.request(RequestParams( 121 | method: 'eth_signTypedData_v3', params: [selectedAddress, typedData]))); 122 | print(signature); 123 | String r = signature.substring(0, 66); 124 | String s = "0x" + signature.substring(66, 130); 125 | String vHexa = "0x" + signature.substring(130, 132); 126 | String v = int.parse(vHexa).toString(); 127 | 128 | print(r); 129 | print(s); 130 | print(v); 131 | } 132 | 133 | @override 134 | Widget build(BuildContext context) { 135 | return Scaffold( 136 | appBar: AppBar( 137 | title: Text(widget.title), 138 | ), 139 | body: Center( 140 | child: ElevatedButton( 141 | onPressed: makeSigningRequest, child: Text("Sign Message"))), 142 | ); 143 | } 144 | } 145 | 146 | // contract EIP712Verify{ 147 | 148 | // uint chainId_ = 42; 149 | // bytes32 public DOMAIN_SEPARATOR = keccak256(abi.encode( 150 | // keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), 151 | // keccak256(bytes(name)), 152 | // keccak256(bytes(version)), 153 | // chainId_, 154 | // address(this) 155 | // )); 156 | 157 | // //HERE 158 | // bytes32 public constant PERMIT_TYPEHASH = keccak256("Permit(address holder,address spender,uint256 nonce,uint256 allowance)"); 159 | // // bytes32 public constant PERMIT_TYPEHASH = 0xea2aa0a1be11a07ed86d755c93467f4f82362b452371d1ba94d1715123511acb; 160 | // mapping (address => uint) public nonces; 161 | 162 | // string public constant name = "Dai Stablecoin"; 163 | // string public constant version = "1"; 164 | // uint256 public totalSupply; 165 | // //HERE 166 | // // --- Approve by signature --- 167 | // function permit(address holder, address spender, uint256 nonce, uint allowance, 168 | // uint8 v, bytes32 r, bytes32 s) public view returns (address) 169 | // { 170 | // bytes32 digest = 171 | // keccak256(abi.encodePacked( 172 | // "\x19\x01", 173 | // DOMAIN_SEPARATOR, 174 | // keccak256(abi.encode(PERMIT_TYPEHASH, 175 | // holder, 176 | // spender, 177 | // nonce, 178 | // allowance 179 | // )) 180 | // )); 181 | 182 | // require(holder != address(0), "Dai/invalid-address-0"); 183 | // require(holder == ecrecover(digest, v, r, s), "Dai/invalid-permit"); 184 | // require(nonce == nonces[holder], "Dai/invalid-nonce"); 185 | // return ecrecover(digest, v, r, s); 186 | // } 187 | // } 188 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:js_util'; 2 | 3 | import 'package:decimal/decimal.dart'; 4 | import 'package:example/utils.dart'; 5 | import 'package:flutter/material.dart'; 6 | import 'package:flutter_web3_provider/ethereum.dart'; 7 | import 'package:flutter_web3_provider/ethers.dart'; 8 | 9 | void main() { 10 | runApp(MyApp()); 11 | } 12 | 13 | class MyApp extends StatelessWidget { 14 | // This widget is the root of your application. 15 | @override 16 | Widget build(BuildContext context) { 17 | return MaterialApp( 18 | title: 'Flutter Demo', 19 | theme: ThemeData( 20 | // This is the theme of your application. 21 | // 22 | // Try running your application with "flutter run". You'll see the 23 | // application has a blue toolbar. Then, without quitting the app, try 24 | // changing the primarySwatch below to Colors.green and then invoke 25 | // "hot reload" (press "r" in the console where you ran "flutter run", 26 | // or simply save your changes to "hot reload" in a Flutter IDE). 27 | // Notice that the counter didn't reset back to zero; the application 28 | // is not restarted. 29 | primarySwatch: Colors.blue, 30 | ), 31 | home: MyHomePage(title: 'Flutter Demo Home Page'), 32 | ); 33 | } 34 | } 35 | 36 | const erc20Abi = [ 37 | // Some details about the token 38 | "function name() view returns (string)", 39 | "function symbol() view returns (string)", 40 | 41 | // Get the account balance 42 | "function balanceOf(address) view returns (uint)", 43 | 44 | // Send some of your tokens to someone else 45 | "function transfer(address to, uint amount)", 46 | 47 | // An event triggered whenever anyone transfers to someone else 48 | "event Transfer(address indexed from, address indexed to, uint amount)" 49 | ]; 50 | const goUsdcAddress = '0x97a19aD887262d7Eca45515814cdeF75AcC4f713'; 51 | 52 | class MyHomePage extends StatefulWidget { 53 | MyHomePage({this.title = "Home"}); 54 | 55 | // This widget is the home page of your application. It is stateful, meaning 56 | // that it has a State object (defined below) that contains fields that affect 57 | // how it looks. 58 | 59 | // This class is the configuration for the state. It holds the values (in this 60 | // case the title) provided by the parent (in this case the App widget) and 61 | // used by the build method of the State. Fields in a Widget subclass are 62 | // always marked "final". 63 | 64 | final String title; 65 | 66 | @override 67 | _MyHomePageState createState() => _MyHomePageState(); 68 | } 69 | 70 | class _MyHomePageState extends State { 71 | int _counter = 0; 72 | String? selectedAddress; 73 | BrowserProvider? web3; 74 | TextEditingController _controller = TextEditingController(); 75 | TextEditingController _verifyController = TextEditingController(); 76 | Future? balanceF; 77 | Future? usdcBalanceF; 78 | 79 | @override 80 | void initState() { 81 | super.initState(); 82 | if (ethereum != null) { 83 | print("ethereum: ${ethereum}"); 84 | print("ethereum.selectedAddress: ${ethereum!.selectedAddress}"); 85 | web3 = BrowserProvider(ethereum!); 86 | balanceF = promiseToFuture(web3!.getBalance(ethereum!.selectedAddress)); 87 | var contract = Contract(goUsdcAddress, erc20Abi, web3); 88 | usdcBalanceF = promiseToFuture( 89 | callMethod(contract, "balanceOf", [ethereum!.selectedAddress])); 90 | } 91 | _controller = TextEditingController(); 92 | _verifyController = TextEditingController(); 93 | } 94 | 95 | @override 96 | void dispose() { 97 | _controller.dispose(); 98 | _verifyController.dispose(); 99 | super.dispose(); 100 | } 101 | 102 | void _incrementCounter() { 103 | setState(() { 104 | // This call to setState tells the Flutter framework that something has 105 | // changed in this State, which causes it to rerun the build method below 106 | // so that the display can reflect the updated values. If we changed 107 | // _counter without calling setState(), then the build method would not be 108 | // called again, and so nothing would appear to happen. 109 | _counter++; 110 | }); 111 | } 112 | 113 | @override 114 | Widget build(BuildContext context) { 115 | // This method is rerun every time setState is called, for instance as done 116 | // by the _incrementCounter method above. 117 | // 118 | // The Flutter framework has been optimized to make rerunning build methods 119 | // fast, so that you can just rebuild anything that needs updating rather 120 | // than having to individually change instances of widgets. 121 | return Scaffold( 122 | appBar: AppBar( 123 | // Here we take the value from the MyHomePage object that was created by 124 | // the App.build method, and use it to set our appbar title. 125 | title: Text(widget.title), 126 | ), 127 | body: Center( 128 | // Center is a layout widget. It takes a single child and positions it 129 | // in the middle of the parent. 130 | child: Column( 131 | // Column is also a layout widget. It takes a list of children and 132 | // arranges them vertically. By default, it sizes itself to fit its 133 | // children horizontally, and tries to be as tall as its parent. 134 | // 135 | // Invoke "debug painting" (press "p" in the console, choose the 136 | // "Toggle Debug Paint" action from the Flutter Inspector in Android 137 | // Studio, or the "Toggle Debug Paint" command in Visual Studio Code) 138 | // to see the wireframe for each widget. 139 | // 140 | // Column has various properties to control how it sizes itself and 141 | // how it positions its children. Here we use mainAxisAlignment to 142 | // center the children vertically; the main axis here is the vertical 143 | // axis because Columns are vertical (the cross axis would be 144 | // horizontal). 145 | mainAxisAlignment: MainAxisAlignment.center, 146 | children: [ 147 | Text( 148 | 'You have pushed the button this many times:', 149 | ), 150 | Text( 151 | '$_counter', 152 | style: Theme.of(context).textTheme.headlineMedium, 153 | ), 154 | connectedStuff(), 155 | ], 156 | ), 157 | ), 158 | floatingActionButton: FloatingActionButton( 159 | onPressed: _incrementCounter, 160 | tooltip: 'Increment', 161 | child: Icon(Icons.add), 162 | ), // This trailing comma makes auto-formatting nicer for build methods. 163 | ); 164 | } 165 | 166 | Widget connectedStuff() { 167 | if (ethereum == null) { 168 | return Text("Dapp Browser not found"); 169 | } 170 | return Column( 171 | children: [ 172 | (selectedAddress != null) 173 | ? Text(selectedAddress!) 174 | : ElevatedButton( 175 | child: Text("Connect Wallet"), 176 | onPressed: () async { 177 | var accounts = await promiseToFuture(ethereum! 178 | .request(RequestParams(method: 'eth_requestAccounts'))); 179 | print(accounts); 180 | String se = ethereum!.selectedAddress; 181 | print("selectedAddress: $se"); 182 | setState(() { 183 | selectedAddress = se; 184 | }); 185 | }, 186 | ), 187 | SizedBox(height: 10), 188 | Text("Native balance:"), 189 | FutureBuilder( 190 | future: balanceF, 191 | builder: (context, snapshot) { 192 | if (snapshot.hasError) { 193 | return Text("error: ${snapshot.error}"); 194 | } 195 | if (!snapshot.hasData) { 196 | return CircularProgressIndicator(); 197 | } 198 | var big = BigInt.parse(snapshot.data.toString()); 199 | var d = toDecimal(big, 18); 200 | return Text("${d}"); 201 | }, 202 | ), 203 | SizedBox(height: 10), 204 | Text("GO:USDC balance:"), 205 | FutureBuilder( 206 | future: usdcBalanceF, 207 | builder: (context, snapshot) { 208 | if (snapshot.hasError) { 209 | return Text("error: ${snapshot.error}"); 210 | } 211 | if (!snapshot.hasData) { 212 | return CircularProgressIndicator(); 213 | } 214 | var big = BigInt.parse(snapshot.data.toString()); 215 | var d = toDecimal(big, 6); 216 | return Text("${d}"); 217 | }, 218 | ), 219 | ElevatedButton( 220 | child: Text("Transfer \$0.01"), 221 | onPressed: () async { 222 | var contract = Contract(goUsdcAddress, erc20Abi, web3); 223 | var contract2 = contract.connect(await web3!.getSigner()); 224 | try { 225 | // DEPRECATED: 226 | // var res = await promiseToFuture(contract2.transfer( 227 | // '0x39C5190c09ec04cF09C782bA4311C469473Ffe83', 228 | // "0x" + 229 | // BigInt.parse(toBase(Decimal.parse("0.01"), 6).toString()) 230 | // .toRadixString(16))); 231 | // USE THIS INSTEAD: 232 | var res = 233 | await promiseToFuture(callMethod(contract2, "transfer", [ 234 | '0x39C5190c09ec04cF09C782bA4311C469473Ffe83', 235 | "0x" + 236 | BigInt.parse(toBase(Decimal.parse("0.01"), 6).toString()) 237 | .toRadixString(16) 238 | ])); 239 | print("Transferred: ${res.toString()}"); 240 | } catch (e) { 241 | print("EXCEPTION:" + e.toString()); 242 | } 243 | // setState(() { 244 | // _controller.text = signature; 245 | // }); 246 | }, 247 | ), 248 | SizedBox(height: 10), 249 | ElevatedButton( 250 | child: Text("Sign Message"), 251 | onPressed: () async { 252 | var signer = await promiseToFuture(web3!.getSigner()); 253 | print("signer: ${signer}"); 254 | // signer = await signer; 255 | // print("signer: ${signer}"); 256 | var signature = 257 | await promiseToFuture(signer.signMessage("Sign this message")); 258 | print(signature); 259 | setState(() { 260 | _controller.text = signature; 261 | }); 262 | }, 263 | ), 264 | Text("Signature:"), 265 | TextField( 266 | maxLines: 4, 267 | decoration: InputDecoration( 268 | border: OutlineInputBorder(), 269 | // labelText: 'Password', 270 | ), 271 | controller: _controller, 272 | ), 273 | ElevatedButton( 274 | child: Text("Verify Signature"), 275 | onPressed: () async { 276 | var verified = verifyMessage("Sign this message", _controller.text); 277 | print("verified?: ${verified}"); 278 | setState(() { 279 | _verifyController.text = verified; 280 | }); 281 | }, 282 | ), 283 | Text("Verified Address"), 284 | TextField( 285 | maxLines: 4, 286 | decoration: InputDecoration( 287 | border: OutlineInputBorder(), 288 | // labelText: 'Password', 289 | ), 290 | controller: _verifyController, 291 | ), 292 | ], 293 | ); 294 | } 295 | } 296 | -------------------------------------------------------------------------------- /example/lib/utils.dart: -------------------------------------------------------------------------------- 1 | import 'package:decimal/decimal.dart'; 2 | 3 | BigInt toBase(Decimal amount, int decimals) { 4 | Decimal baseUnit = Decimal.fromInt(10).pow(decimals).toDecimal(); 5 | print("baseUnit: $baseUnit"); 6 | Decimal inbase = amount * baseUnit; 7 | print("inbase: $inbase"); 8 | return BigInt.parse(inbase.toString()); 9 | } 10 | Decimal toDecimal(BigInt amount, int decimals) { 11 | var x = Decimal.fromBigInt(amount).toRational() / Decimal.fromInt(10).pow(decimals); 12 | return x.toDecimal(); 13 | } 14 | -------------------------------------------------------------------------------- /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 | decimal: 45 | dependency: "direct main" 46 | description: 47 | name: decimal 48 | sha256: "4140a688f9e443e2f4de3a1162387bf25e1ac6d51e24c9da263f245210f41440" 49 | url: "https://pub.dev" 50 | source: hosted 51 | version: "3.0.2" 52 | fake_async: 53 | dependency: transitive 54 | description: 55 | name: fake_async 56 | sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" 57 | url: "https://pub.dev" 58 | source: hosted 59 | version: "1.3.1" 60 | flutter: 61 | dependency: "direct main" 62 | description: flutter 63 | source: sdk 64 | version: "0.0.0" 65 | flutter_test: 66 | dependency: "direct dev" 67 | description: flutter 68 | source: sdk 69 | version: "0.0.0" 70 | flutter_web3_provider: 71 | dependency: "direct main" 72 | description: 73 | path: ".." 74 | relative: true 75 | source: path 76 | version: "1.0.6" 77 | intl: 78 | dependency: transitive 79 | description: 80 | name: intl 81 | sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf 82 | url: "https://pub.dev" 83 | source: hosted 84 | version: "0.19.0" 85 | js: 86 | dependency: transitive 87 | description: 88 | name: js 89 | sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf 90 | url: "https://pub.dev" 91 | source: hosted 92 | version: "0.7.1" 93 | leak_tracker: 94 | dependency: transitive 95 | description: 96 | name: leak_tracker 97 | sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" 98 | url: "https://pub.dev" 99 | source: hosted 100 | version: "10.0.5" 101 | leak_tracker_flutter_testing: 102 | dependency: transitive 103 | description: 104 | name: leak_tracker_flutter_testing 105 | sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" 106 | url: "https://pub.dev" 107 | source: hosted 108 | version: "3.0.5" 109 | leak_tracker_testing: 110 | dependency: transitive 111 | description: 112 | name: leak_tracker_testing 113 | sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" 114 | url: "https://pub.dev" 115 | source: hosted 116 | version: "3.0.1" 117 | matcher: 118 | dependency: transitive 119 | description: 120 | name: matcher 121 | sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb 122 | url: "https://pub.dev" 123 | source: hosted 124 | version: "0.12.16+1" 125 | material_color_utilities: 126 | dependency: transitive 127 | description: 128 | name: material_color_utilities 129 | sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec 130 | url: "https://pub.dev" 131 | source: hosted 132 | version: "0.11.1" 133 | meta: 134 | dependency: transitive 135 | description: 136 | name: meta 137 | sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 138 | url: "https://pub.dev" 139 | source: hosted 140 | version: "1.15.0" 141 | path: 142 | dependency: transitive 143 | description: 144 | name: path 145 | sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" 146 | url: "https://pub.dev" 147 | source: hosted 148 | version: "1.9.0" 149 | rational: 150 | dependency: transitive 151 | description: 152 | name: rational 153 | sha256: cb808fb6f1a839e6fc5f7d8cb3b0a10e1db48b3be102de73938c627f0b636336 154 | url: "https://pub.dev" 155 | source: hosted 156 | version: "2.2.3" 157 | sky_engine: 158 | dependency: transitive 159 | description: flutter 160 | source: sdk 161 | version: "0.0.99" 162 | source_span: 163 | dependency: transitive 164 | description: 165 | name: source_span 166 | sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" 167 | url: "https://pub.dev" 168 | source: hosted 169 | version: "1.10.0" 170 | stack_trace: 171 | dependency: transitive 172 | description: 173 | name: stack_trace 174 | sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" 175 | url: "https://pub.dev" 176 | source: hosted 177 | version: "1.11.1" 178 | stream_channel: 179 | dependency: transitive 180 | description: 181 | name: stream_channel 182 | sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 183 | url: "https://pub.dev" 184 | source: hosted 185 | version: "2.1.2" 186 | string_scanner: 187 | dependency: transitive 188 | description: 189 | name: string_scanner 190 | sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" 191 | url: "https://pub.dev" 192 | source: hosted 193 | version: "1.2.0" 194 | term_glyph: 195 | dependency: transitive 196 | description: 197 | name: term_glyph 198 | sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 199 | url: "https://pub.dev" 200 | source: hosted 201 | version: "1.2.1" 202 | test_api: 203 | dependency: transitive 204 | description: 205 | name: test_api 206 | sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" 207 | url: "https://pub.dev" 208 | source: hosted 209 | version: "0.7.2" 210 | vector_math: 211 | dependency: transitive 212 | description: 213 | name: vector_math 214 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" 215 | url: "https://pub.dev" 216 | source: hosted 217 | version: "2.1.4" 218 | vm_service: 219 | dependency: transitive 220 | description: 221 | name: vm_service 222 | sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" 223 | url: "https://pub.dev" 224 | source: hosted 225 | version: "14.2.5" 226 | sdks: 227 | dart: ">=3.3.0 <4.0.0" 228 | flutter: ">=3.18.0-18.0.pre.54" 229 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: example 2 | description: A new Flutter project. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `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 | # The following defines the version and build number for your application. 9 | # A version number is three numbers separated by dots, like 1.2.43 10 | # followed by an optional build number separated by a +. 11 | # Both the version and the builder number may be overridden in flutter 12 | # build by specifying --build-name and --build-number, respectively. 13 | # In Android, build-name is used as versionName while build-number used as versionCode. 14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 16 | # Read more about iOS versioning at 17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 18 | version: 1.0.0 19 | 20 | environment: 21 | sdk: '>=3.0.0 <4.0.0' 22 | flutter: ">=3.0.0 <4.0.0" 23 | 24 | dependencies: 25 | flutter: 26 | sdk: flutter 27 | decimal: 28 | flutter_web3_provider: 29 | path: ../ 30 | 31 | dev_dependencies: 32 | flutter_test: 33 | sdk: flutter 34 | 35 | # For information on the generic Dart part of this file, see the 36 | # following page: https://dart.dev/tools/pub/pubspec 37 | 38 | # The following section is specific to Flutter. 39 | flutter: 40 | # The following line ensures that the Material Icons font is 41 | # included with your application, so that you can use the icons in 42 | # the material Icons class. 43 | uses-material-design: true 44 | # To add assets to your application, add an assets section, like this: 45 | # assets: 46 | # - images/a_dot_burr.jpeg 47 | # - images/a_dot_ham.jpeg 48 | # An image asset can refer to one or more resolution-specific "variants", see 49 | # https://flutter.dev/assets-and-images/#resolution-aware. 50 | # For details regarding adding assets from package dependencies, see 51 | # https://flutter.dev/assets-and-images/#from-packages 52 | # To add custom fonts to your application, add a fonts section here, 53 | # in this "flutter" section. Each entry in this list should have a 54 | # "family" key with the font family name, and a "fonts" key with a 55 | # list giving the asset and other descriptors for the font. For 56 | # example: 57 | # fonts: 58 | # - family: Schyler 59 | # fonts: 60 | # - asset: fonts/Schyler-Regular.ttf 61 | # - asset: fonts/Schyler-Italic.ttf 62 | # style: italic 63 | # - family: Trajan Pro 64 | # fonts: 65 | # - asset: fonts/TrajanPro.ttf 66 | # - asset: fonts/TrajanPro_Bold.ttf 67 | # weight: 700 68 | # 69 | # For details regarding fonts from package dependencies, 70 | # see https://flutter.dev/custom-fonts/#from-packages 71 | -------------------------------------------------------------------------------- /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:example/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /example/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gochain/flutter_web3_provider/aeba068206961aff1949f931ad8f7f25c1830121/example/web/favicon.png -------------------------------------------------------------------------------- /example/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gochain/flutter_web3_provider/aeba068206961aff1949f931ad8f7f25c1830121/example/web/icons/Icon-192.png -------------------------------------------------------------------------------- /example/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gochain/flutter_web3_provider/aeba068206961aff1949f931ad8f7f25c1830121/example/web/icons/Icon-512.png -------------------------------------------------------------------------------- /example/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | example 31 | 32 | 33 | 34 | 35 | 40 | 41 | 44 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /example/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "short_name": "example", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /lib/ethereum.dart: -------------------------------------------------------------------------------- 1 | @JS("window") 2 | library ethereum; 3 | 4 | import 'package:js/js.dart'; 5 | 6 | @JS("ethereum") 7 | external Ethereum? get ethereum; 8 | 9 | @JS("BinanceChain") 10 | external Ethereum? get binanceChain; 11 | 12 | @Deprecated('web3') 13 | @JS("web3") 14 | external Ethereum? get web3; 15 | 16 | @JS("") 17 | class Ethereum { 18 | @JS("chainId") 19 | external String chainId(); 20 | 21 | @JS("isConnected") 22 | external bool isConnected(); 23 | 24 | @Deprecated('selectedAddress') 25 | @JS("selectedAddress") 26 | external String get selectedAddress; 27 | 28 | @JS("request") 29 | external Future request(RequestParams params); 30 | 31 | /// Add a listener to be triggered for each eventName event. 32 | @JS("on") 33 | external Future on(String eventName, Function func); 34 | 35 | /// Add a listener to be triggered for only the next eventName event, at which time it will be removed. 36 | @JS("once") 37 | external Future once(String eventName, Function func); 38 | 39 | /// Add a listener to be triggered for only the next eventName event, at which time it will be removed. 40 | @JS("off") 41 | external Future off(String eventName, Function func); 42 | 43 | /// Add a listener to be triggered for only the next eventName event, at which time it will be removed. 44 | @JS("removeAllListeners") 45 | external Future removeAllListeners(String? events); 46 | 47 | /// Return the number of listeners that are subscribed to event. If no event is provided, returns the total count of all events. 48 | @JS("listenerCount") 49 | external Future listenerCount(String eventName); 50 | 51 | /// Return a list of listeners that are subscribed to event. 52 | @JS("listeners") 53 | external Future listeners(); 54 | 55 | @JS("autoRefreshOnNetworkChange") 56 | external set autoRefreshOnNetworkChange(bool b); 57 | } 58 | 59 | @JS() 60 | @anonymous 61 | class RequestParams { 62 | external String get method; 63 | 64 | external dynamic get params; 65 | 66 | // Must have an unnamed factory constructor with named arguments. 67 | external factory RequestParams({String? method, dynamic params}); 68 | } 69 | 70 | @JS("JSON.stringify") 71 | external String stringify(dynamic obj); 72 | 73 | @JS() 74 | @anonymous 75 | class WatchAssetParameters { 76 | external String get type; 77 | 78 | external WatchAssetOptions get options; 79 | 80 | external factory WatchAssetParameters( 81 | {required String type, required WatchAssetOptions options}); 82 | } 83 | 84 | @JS() 85 | @anonymous 86 | class WatchAssetOptions { 87 | external String get address; 88 | 89 | external String get symbol; 90 | 91 | external int get decimals; 92 | 93 | external String? get image; 94 | 95 | external factory WatchAssetOptions({ 96 | required String address, 97 | required String symbol, 98 | required int decimals, 99 | String? image, 100 | }); 101 | } 102 | 103 | @JS() 104 | @anonymous 105 | class CurrencyParams { 106 | external String get name; 107 | 108 | external String get symbol; 109 | 110 | external int get decimals; 111 | 112 | external factory CurrencyParams({String name, String symbol, int decimals}); 113 | } 114 | 115 | @JS() 116 | @anonymous 117 | class ChainParams { 118 | external String get chainId; 119 | 120 | external String get chainName; 121 | 122 | external CurrencyParams get nativeCurrency; 123 | 124 | external List get rpcUrls; 125 | 126 | external List get blockExplorerUrls; 127 | 128 | external factory ChainParams( 129 | {String chainId, 130 | String chainName, 131 | CurrencyParams nativeCurrency, 132 | List rpcUrls, 133 | List blockExplorerUrls}); 134 | } 135 | -------------------------------------------------------------------------------- /lib/ethers.dart: -------------------------------------------------------------------------------- 1 | @JS("ethers") 2 | library ethers; 3 | 4 | import 'package:js/js.dart'; 5 | 6 | import 'ethereum.dart'; 7 | 8 | @JS("providers") 9 | class Provider { 10 | @JS("waitForTransaction") 11 | external Future waitForTransaction( 12 | String hash, [ 13 | int confirms = 1, 14 | ]); 15 | } 16 | 17 | @JS() 18 | @anonymous 19 | class TxReceipt { 20 | external String? get to; 21 | external String get from; 22 | external String? get contractAddress; 23 | external int get transactionIndex; 24 | external String? get root; 25 | external BigNumber get gasUsed; 26 | external String get logsBloom; 27 | external String get blockHash; 28 | external String get transactionHash; 29 | external List get logs; 30 | external int get blockNumber; 31 | external int get confirmations; 32 | external BigNumber get cumulativeGasUsed; 33 | external bool get byzantium; 34 | external int get status; 35 | 36 | external factory TxReceipt({ 37 | String? to, 38 | String from, 39 | String? contractAddress, 40 | int transactionIndex, 41 | String? root, 42 | BigNumber gasUsed, 43 | String logsBloom, 44 | String blockHash, 45 | String transactionHash, 46 | List logs, 47 | int blockNumber, 48 | int confirmations, 49 | BigNumber cumulativeGasUsed, 50 | bool byzantium, 51 | int status, 52 | }); 53 | } 54 | 55 | @JS() 56 | @anonymous 57 | class Log { 58 | external int get blockNumber; 59 | external String get blockHash; 60 | external bool get removed; 61 | external int get transactionLogIndex; 62 | external String get address; 63 | external String get data; 64 | external List get topics; 65 | external String get transactionHash; 66 | external String get transactionIndex; 67 | external String get logIndex; 68 | 69 | external factory Log({ 70 | int blockNumber, 71 | String blockHash, 72 | bool removed, 73 | int transactionLogIndex, 74 | String address, 75 | String data, 76 | List topics, 77 | String transactionHash, 78 | String transactionIndex, 79 | String logIndex, 80 | }); 81 | } 82 | 83 | @JS("BrowserProvider") 84 | class BrowserProvider extends Provider { 85 | external BrowserProvider(Ethereum eth); 86 | 87 | @JS("getSigner") 88 | external Future getSigner(); 89 | 90 | @JS("getBalance") 91 | external Future getBalance(String address); 92 | 93 | @JS("getNetwork") 94 | external Future getNetwork(); 95 | 96 | @JS("getBlockNumber") 97 | external Future getBlockNumber(); 98 | } 99 | 100 | @JS("providers.JsonRpcProvider") 101 | class JsonRpcProvider extends Provider { 102 | external JsonRpcProvider(String rpcUrl); 103 | 104 | @JS("getBalance") 105 | external Future getBalance(String address); 106 | } 107 | 108 | @JS("networks.Network") 109 | class Network { 110 | @JS("chainId") 111 | external int get chainId; 112 | } 113 | 114 | @JS("signer.Signer") 115 | class Signer { 116 | @JS("getAddress") 117 | external Future getAddress(); 118 | 119 | @JS("sendTransaction") 120 | external Future sendTransaction(TxParams params); 121 | 122 | @JS("signMessage") 123 | external Future signMessage(String message); 124 | } 125 | 126 | @JS("verifyMessage") 127 | external String verifyMessage(String hash, String sig); 128 | 129 | @JS("utils") 130 | class Utils { 131 | // external static String verifyMessage(var hash, var sig); 132 | 133 | external static String arrayify(var hash); 134 | 135 | external static String getAddress(var address); 136 | 137 | @JS("defaultAbiCoder") 138 | external static AbiCoder get defaultAbiCoder; 139 | } 140 | 141 | @JS("AbiCoder") 142 | class AbiCoder { 143 | @JS("encode") 144 | external String encode(List types, List values); 145 | 146 | @JS("decode") 147 | external String decode(List types, String data); 148 | } 149 | 150 | @JS("BigNumber") 151 | class BigNumber { 152 | external static BigNumber from(String num); 153 | 154 | external int toNumber(); 155 | 156 | external String toString(); 157 | 158 | external String toHexString(); 159 | } 160 | 161 | extension BigNumberExtension on BigNumber { 162 | BigInt get toBigInt => BigInt.parse(this.toString()); 163 | 164 | int get toInt => int.parse(this.toString()); 165 | } 166 | 167 | @JS() 168 | @anonymous 169 | class TxParams { 170 | external String get method; 171 | 172 | external String get to; 173 | 174 | external String get value; 175 | 176 | external String get gasLimit; 177 | 178 | external String get gasPrice; 179 | 180 | external String get nonce; 181 | 182 | // Must have an unnamed factory constructor with named arguments. 183 | external factory TxParams( 184 | {String? to, 185 | String? value, 186 | String? gasLimit, 187 | String? gasPrice, 188 | String? nonce}); 189 | } 190 | 191 | // I couldn't figure out how to call any ol' function with this package:js stuff 192 | // so I'm just adding the most common functions from ERC20 and ERC721. 193 | // To call other functions, use `callMethod`, see README for example. 194 | @JS("Contract") 195 | class Contract { 196 | external Contract(String address, List abi, dynamic provider); 197 | 198 | @JS("name") 199 | external Future name(); 200 | 201 | @JS("symbol") 202 | external Future symbol(); 203 | 204 | @JS("connect") 205 | external Contract connect(Signer signer); 206 | 207 | @JS("transfer") 208 | external Future transfer(String to, String amount); 209 | 210 | @JS("balanceOf") 211 | external Future balanceOf(String address); 212 | 213 | @JS("tokenURI") 214 | external Future tokenURI(BigNumber tokenID); 215 | 216 | /// Return the number of listeners that are subscribed to event. If no event is provided, returns the total count of all events. 217 | @JS("listenerCount") 218 | external Future listenerCount(String eventName); 219 | 220 | /// Return a list of listeners that are subscribed to event. 221 | @JS("listeners") 222 | external Future listeners(); 223 | 224 | /// Subscribe to event calling listener when the event occurs. 225 | @JS("on") 226 | external Future on(String eventName, Function func); 227 | 228 | /// Subscribe once to event calling listener when the event occurs. 229 | @JS("once") 230 | external Future once(String eventName, Function func); 231 | 232 | /// Unsubscribe listener to event. 233 | @JS("off") 234 | external Future off(String eventName, Function func); 235 | 236 | /// Unsubscribe all listeners for event. If no event is provided, all events are unsubscribed. 237 | @JS("removeAllListeners") 238 | external Future removeAllListeners(String? events); 239 | } 240 | -------------------------------------------------------------------------------- /lib/flutter_web3_provider.dart: -------------------------------------------------------------------------------- 1 | library flutter_web3_provider; 2 | 3 | import 'ethereum.dart'; 4 | import 'ethers.dart'; 5 | 6 | BrowserProvider? getWeb3Provider() { 7 | final provider = ethereum ?? binanceChain ?? web3; 8 | if (provider != null) { 9 | return BrowserProvider(provider); 10 | } 11 | return null; 12 | } 13 | 14 | 15 | BrowserProvider? getBrowserProvider() { 16 | final provider = ethereum ?? binanceChain ?? web3; 17 | if (provider != null) { 18 | return BrowserProvider(provider); 19 | } 20 | return null; 21 | } 22 | -------------------------------------------------------------------------------- /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 | fake_async: 45 | dependency: transitive 46 | description: 47 | name: fake_async 48 | sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" 49 | url: "https://pub.dev" 50 | source: hosted 51 | version: "1.3.1" 52 | flutter: 53 | dependency: "direct main" 54 | description: flutter 55 | source: sdk 56 | version: "0.0.0" 57 | flutter_test: 58 | dependency: "direct dev" 59 | description: flutter 60 | source: sdk 61 | version: "0.0.0" 62 | js: 63 | dependency: "direct main" 64 | description: 65 | name: js 66 | sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf 67 | url: "https://pub.dev" 68 | source: hosted 69 | version: "0.7.1" 70 | leak_tracker: 71 | dependency: transitive 72 | description: 73 | name: leak_tracker 74 | sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" 75 | url: "https://pub.dev" 76 | source: hosted 77 | version: "10.0.5" 78 | leak_tracker_flutter_testing: 79 | dependency: transitive 80 | description: 81 | name: leak_tracker_flutter_testing 82 | sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" 83 | url: "https://pub.dev" 84 | source: hosted 85 | version: "3.0.5" 86 | leak_tracker_testing: 87 | dependency: transitive 88 | description: 89 | name: leak_tracker_testing 90 | sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" 91 | url: "https://pub.dev" 92 | source: hosted 93 | version: "3.0.1" 94 | matcher: 95 | dependency: transitive 96 | description: 97 | name: matcher 98 | sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb 99 | url: "https://pub.dev" 100 | source: hosted 101 | version: "0.12.16+1" 102 | material_color_utilities: 103 | dependency: transitive 104 | description: 105 | name: material_color_utilities 106 | sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec 107 | url: "https://pub.dev" 108 | source: hosted 109 | version: "0.11.1" 110 | meta: 111 | dependency: transitive 112 | description: 113 | name: meta 114 | sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 115 | url: "https://pub.dev" 116 | source: hosted 117 | version: "1.15.0" 118 | path: 119 | dependency: transitive 120 | description: 121 | name: path 122 | sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" 123 | url: "https://pub.dev" 124 | source: hosted 125 | version: "1.9.0" 126 | sky_engine: 127 | dependency: transitive 128 | description: flutter 129 | source: sdk 130 | version: "0.0.99" 131 | source_span: 132 | dependency: transitive 133 | description: 134 | name: source_span 135 | sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" 136 | url: "https://pub.dev" 137 | source: hosted 138 | version: "1.10.0" 139 | stack_trace: 140 | dependency: transitive 141 | description: 142 | name: stack_trace 143 | sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" 144 | url: "https://pub.dev" 145 | source: hosted 146 | version: "1.11.1" 147 | stream_channel: 148 | dependency: transitive 149 | description: 150 | name: stream_channel 151 | sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 152 | url: "https://pub.dev" 153 | source: hosted 154 | version: "2.1.2" 155 | string_scanner: 156 | dependency: transitive 157 | description: 158 | name: string_scanner 159 | sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" 160 | url: "https://pub.dev" 161 | source: hosted 162 | version: "1.2.0" 163 | term_glyph: 164 | dependency: transitive 165 | description: 166 | name: term_glyph 167 | sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 168 | url: "https://pub.dev" 169 | source: hosted 170 | version: "1.2.1" 171 | test_api: 172 | dependency: transitive 173 | description: 174 | name: test_api 175 | sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" 176 | url: "https://pub.dev" 177 | source: hosted 178 | version: "0.7.2" 179 | vector_math: 180 | dependency: transitive 181 | description: 182 | name: vector_math 183 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" 184 | url: "https://pub.dev" 185 | source: hosted 186 | version: "2.1.4" 187 | vm_service: 188 | dependency: transitive 189 | description: 190 | name: vm_service 191 | sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" 192 | url: "https://pub.dev" 193 | source: hosted 194 | version: "14.2.5" 195 | sdks: 196 | dart: ">=3.3.0 <4.0.0" 197 | flutter: ">=3.18.0-18.0.pre.54" 198 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_web3_provider 2 | description: Flutter web web3 provider. 3 | version: 2.0.2 4 | homepage: https://gochain.io 5 | repository: https://github.com/gochain/flutter_web3_provider 6 | issue_tracker: https://github.com/gochain/flutter_web3_provider/issues 7 | 8 | environment: 9 | sdk: '>=3.0.0 <4.0.0' 10 | flutter: ">=3.0.0 <4.0.0" 11 | 12 | dependencies: 13 | flutter: 14 | sdk: flutter 15 | js: ^0.7.1 16 | 17 | dev_dependencies: 18 | flutter_test: 19 | sdk: flutter 20 | 21 | # For information on the generic Dart part of this file, see the 22 | # following page: https://dart.dev/tools/pub/pubspec 23 | 24 | # The following section is specific to Flutter. 25 | flutter: 26 | # To add assets to your package, add an assets section, like this: 27 | # assets: 28 | # - images/a_dot_burr.jpeg 29 | # - images/a_dot_ham.jpeg 30 | # 31 | # For details regarding assets in packages, see 32 | # https://flutter.dev/assets-and-images/#from-packages 33 | # 34 | # An image asset can refer to one or more resolution-specific "variants", see 35 | # https://flutter.dev/assets-and-images/#resolution-aware. 36 | # To add custom fonts to your package, add a fonts section here, 37 | # in this "flutter" section. Each entry in this list should have a 38 | # "family" key with the font family name, and a "fonts" key with a 39 | # list giving the asset and other descriptors for the font. For 40 | # example: 41 | # fonts: 42 | # - family: Schyler 43 | # fonts: 44 | # - asset: fonts/Schyler-Regular.ttf 45 | # - asset: fonts/Schyler-Italic.ttf 46 | # style: italic 47 | # - family: Trajan Pro 48 | # fonts: 49 | # - asset: fonts/TrajanPro.ttf 50 | # - asset: fonts/TrajanPro_Bold.ttf 51 | # weight: 700 52 | # 53 | # For details regarding fonts in packages, see 54 | # https://flutter.dev/custom-fonts/#from-packages 55 | -------------------------------------------------------------------------------- /test/flutter_web3_provider_test.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | void main() { 4 | // test('adds one to input values', () { 5 | // final calculator = Calculator(); 6 | // expect(calculator.addOne(2), 3); 7 | // expect(calculator.addOne(-7), -6); 8 | // expect(calculator.addOne(0), 1); 9 | // expect(() => calculator.addOne(null), throwsNoSuchMethodError); 10 | // }); 11 | } 12 | --------------------------------------------------------------------------------