Skip to content

Commit

Permalink
Feature/flutter 2 updates (#16)
Browse files Browse the repository at this point in the history
* Incremented version

* Incremented version

* Updated libraries and iOS build

* iOS ml_vision fixed

* Fixed bug to transfer when created/imported with seed phrase

* Updated release notes

* Updated generated files after codegen lib upgraded

* Added donation addresses

* Readme update
  • Loading branch information
allanclempe authored Mar 6, 2021
1 parent 3112974 commit 2e7c83e
Show file tree
Hide file tree
Showing 20 changed files with 215 additions and 218 deletions.
48 changes: 32 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,24 @@

A digital wallet app, developed in dart language and flutter framework. The idea is to help developers to understand how to build dApps using blockchain and associated technologies. This app can transfer tokens from one wallet to another, through an [ERC-20](https://en.wikipedia.org/wiki/ERC-20) Ethereum contract.


### What's being used

- Built in [Flutter](https://flutter.dev/docs/get-started/install) framework
- [Google ML Vision](https://firebase.google.com/docs/ml-kit) for QRCode scan.
- [Web3Dart](https://github.com/simolus3/web3dart) to interact with Ethereum blockchain
- [Flutter hooks](https://github.com/rrousselGit/flutter_hooks) to manage widget life-cycle.

Wallet | Send tokens | Processing
:-----:|:------------:|:------------:|
![Your wallet](https://faucet.clempe.dev/images/your-wallet.jpg) | ![Your wallet](https://faucet.clempe.dev/images/transfer-address.jpg) | ![Your wallet](https://faucet.clempe.dev/images/transfer-processing.jpg)


| Wallet | Send tokens | Processing |
| :--------------------------------------------------------------: | :-------------------------------------------------------------------: | :----------------------------------------------------------------------: |
| ![Your wallet](https://faucet.clempe.dev/images/your-wallet.jpg) | ![Your wallet](https://faucet.clempe.dev/images/transfer-address.jpg) | ![Your wallet](https://faucet.clempe.dev/images/transfer-processing.jpg) |

### Getting started

How to watch/build autogenerated files
How to watch/build autogenerated files

```bash
$ flutter packages pub run build_runner build # to build
$ flutter packages pub run build_runner watch # to watch
$ flutter packages pub run build_runner build # to build
$ flutter packages pub run build_runner watch # to watch
```

How to run the app
Expand All @@ -34,6 +31,7 @@ $ flutter run
```

How to run tests

```bash
$ flutter test
```
Expand All @@ -42,32 +40,50 @@ $ flutter test

For those who don't want to play with smart contracts yet, you can claim some test coins (tokens) and ether using the following links or check out [this repo](https://github.com/allanclempe/ether-wallet-contract) to understand how to deploy your own contract.

***Transfer test TOKENS to your wallet:***
**_Transfer test TOKENS to your wallet:_**

After setting up your wallet, you will need some tokens to play with. Use the link below to transfer some tokens to your wallet.

[https://faucet.clempe.dev](https://faucet.clempe.dev)


***Transfer test Ether to your wallet***
**_Transfer test Ether to your wallet_**

Also to process transactions on the network, you will also need ETH to pay transaction fees, called gas. You also can claim some using the link below.

[https://faucet.ropsten.be/](https://faucet.ropsten.be/)

just be patient, the transaction might take a while to be processed.
just be patient, the transaction might take a while to be processed.

### The smart contract

Feel free to check out the smart contract used in this project [https://github.com/allanclempe/ether-wallet-contract](https://github.com/allanclempe/ether-wallet-contract)

### Release notes

2021 feb 27: App running and tested on iOS and android with flutter version 1.22 (dart 2.10.5). Flutter and libraries has been upgraded. Small code changes just to get rid of deprecated flutter components.
1.3.0+6:

- Flutter has been upgraded to version 2.0.1 (dart 2.12.0).
- Libraries has been upgraded.
- Fixed issue to generate and store private key when imported from seed phrase.

1.2.0+5:

- Flutter has been upgraded to version 1.22 (dart 2.10.5).
- Libraries has been upgraded.
- Small code changes just to get rid of deprecated flutter components.

### Buy me a coffee

If you enjoy my work, a small donation would be greatly appreciated.

| BTC | ETH |
| :------------------------------------------------------------------------: | :--------------------------------------------------------------------------: |
| <img src="https://faucet.clempe.dev/images/btc-address.png" width="150" /> | <img src="https://faucet.clempe.dev/images/eth-address.png" width="150" /> |

### License

Copyright © 2019-present Allan Clempe. This source code is licensed under the MIT license found in the [LICENSE.txt](https://github.com/allanclempe/ether-wallet-flutter/blob/master/LICENSE.txt) file.
Copyright © 2019-present Allan Clempe. This source code is licensed under the MIT license found in the [LICENSE.txt](https://github.com/allanclempe/ether-wallet-flutter/blob/master/LICENSE.txt) file.

---
dart wallet cryto flutter eth smart contracts - by [Allan Clempe](https://twitter.com/aclempe)

dart wallet cryto flutter eth smart contracts - by [Allan Clempe](https://twitter.com/aclempe)
1 change: 1 addition & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ android {

dependencies {
api 'com.google.firebase:firebase-ml-vision-image-label-model:17.0.2'
// api 'com.google.mlkit:image-labeling:17.0.2' TODO: upgrade.
}
}

Expand Down
3 changes: 2 additions & 1 deletion ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
# platform :ios, '10.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down Expand Up @@ -28,6 +28,7 @@ require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelpe
flutter_ios_podfile_setup

target 'Runner' do
# pod 'GoogleMLKit/BarcodeScanning' - TODO: update.
pod 'Firebase/MLVisionBarcodeModel'
use_frameworks!
use_modular_headers!
Expand Down
36 changes: 18 additions & 18 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
PODS:
- camera (0.0.1):
- Flutter
- Firebase/Analytics (6.33.0):
- Firebase/Analytics (6.34.0):
- Firebase/Core
- Firebase/Core (6.33.0):
- Firebase/Core (6.34.0):
- Firebase/CoreOnly
- FirebaseAnalytics (= 6.8.3)
- Firebase/CoreOnly (6.33.0):
- FirebaseCore (= 6.10.3)
- Firebase/MLVision (6.33.0):
- FirebaseAnalytics (= 6.9.0)
- Firebase/CoreOnly (6.34.0):
- FirebaseCore (= 6.10.4)
- Firebase/MLVision (6.34.0):
- Firebase/CoreOnly
- FirebaseMLVision (~> 0.21.0)
- Firebase/MLVisionBarcodeModel (6.33.0):
- Firebase/MLVisionBarcodeModel (6.34.0):
- Firebase/CoreOnly
- FirebaseMLVisionBarcodeModel (~> 0.21.0)
- firebase_analytics (0.0.1):
Expand All @@ -22,16 +22,16 @@ PODS:
- Firebase/Core
- Firebase/MLVision
- Flutter
- FirebaseAnalytics (6.8.3):
- FirebaseAnalytics (6.9.0):
- FirebaseCore (~> 6.10)
- FirebaseInstallations (~> 1.6)
- GoogleAppMeasurement (= 6.8.3)
- FirebaseInstallations (~> 1.7)
- GoogleAppMeasurement (= 6.9.0)
- GoogleUtilities/AppDelegateSwizzler (~> 6.7)
- GoogleUtilities/MethodSwizzler (~> 6.7)
- GoogleUtilities/Network (~> 6.7)
- "GoogleUtilities/NSData+zlib (~> 6.7)"
- nanopb (~> 1.30906.0)
- FirebaseCore (6.10.3):
- FirebaseCore (6.10.4):
- FirebaseCoreDiagnostics (~> 1.6)
- GoogleUtilities/Environment (~> 6.7)
- GoogleUtilities/Logger (~> 6.7)
Expand Down Expand Up @@ -71,7 +71,7 @@ PODS:
- GoogleAPIClientForREST/Vision (1.5.1):
- GoogleAPIClientForREST/Core
- GTMSessionFetcher (>= 1.1.7)
- GoogleAppMeasurement (6.8.3):
- GoogleAppMeasurement (6.9.0):
- GoogleUtilities/AppDelegateSwizzler (~> 6.7)
- GoogleUtilities/MethodSwizzler (~> 6.7)
- GoogleUtilities/Network (~> 6.7)
Expand Down Expand Up @@ -172,19 +172,19 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
camera: a0ca5080336f7af47b88436e5e26da3dee5568f0
Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5
Firebase: c23a36d9e4cdf7877dfcba8dd0c58add66358999
firebase_analytics: 9118044ffb98bee71d84733fc594f5134fe4bc1b
firebase_ml_vision: cf3db3a9b870a2424e4c1c369b2123d31177cc9f
FirebaseAnalytics: 5dd088bd2e67bb9d13dbf792d1164ceaf3052193
FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd
FirebaseAnalytics: 3bb096873ee0d7fa4b6c70f5e9166b6da413cc7f
FirebaseCore: d3a978a3cfa3240bf7e4ba7d137fdf5b22b628ec
FirebaseCoreDiagnostics: 770ac5958e1372ce67959ae4b4f31d8e127c3ac1
FirebaseInstallations: 466c7b4d1f58fe16707693091da253726a731ed2
FirebaseMLCommon: f42d067ca7fed962e09f02ba94a24e06ee50d933
FirebaseMLVision: fd7cdd33d067c976c16fd521e7e92c26c980c947
FirebaseMLVisionBarcodeModel: 394cd61c52dc03558088caf82b0dade8028f57d5
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
GoogleAPIClientForREST: 4bb409633efcc2e1b3f945afe7e35039b5a61db2
GoogleAppMeasurement: 966e88df9d19c15715137bb2ddaf52373f111436
GoogleAppMeasurement: a6a3a066369828db64eda428cb2856dc1cdc7c4e
GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833
GoogleToolboxForMac: 471e0c05d39506e50e6398f46fa9a12ae0efeff9
GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3
Expand All @@ -195,6 +195,6 @@ SPEC CHECKSUMS:
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef

PODFILE CHECKSUM: 76cfc2fa0003e9287778eb8d305c4079de8a0386
PODFILE CHECKSUM: 92de5e6e176219356a0144477ff81b3a723353c3

COCOAPODS: 1.10.1
17 changes: 10 additions & 7 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1020;
LastUpgradeCheck = 1240;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -325,6 +325,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand All @@ -343,7 +344,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand All @@ -362,7 +363,7 @@
DEVELOPMENT_TEAM = CUFZ3BA873;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -398,6 +399,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand All @@ -422,7 +424,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -453,6 +455,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand All @@ -471,7 +474,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand All @@ -492,7 +495,7 @@
DEVELOPMENT_TEAM = CUFZ3BA873;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -516,7 +519,7 @@
DEVELOPMENT_TEAM = CUFZ3BA873;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
10 changes: 3 additions & 7 deletions ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -27,8 +27,6 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
Expand All @@ -38,8 +36,8 @@
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -61,8 +59,6 @@
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Profile"
Expand Down
2 changes: 1 addition & 1 deletion lib/components/copyButton/copy_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CopyButton extends StatelessWidget {
onPressed: () {
Clipboard.setData(ClipboardData(text: this.value));

Scaffold.of(context).showSnackBar(SnackBar(
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text("Copied"),
));
},
Expand Down
6 changes: 3 additions & 3 deletions lib/context/hook_provider.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/widgets.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:provider/provider.dart' as p;
import 'package:provider/provider.dart';

typedef HookWidgetBuilder<Handler> = Widget Function(
BuildContext context, Handler store);
Expand All @@ -12,9 +12,9 @@ abstract class ContextProviderWidget<T> extends HookWidget {
ContextProviderWidget({this.child, this.builder});

Widget provide(BuildContext context, T handler) {
return p.MultiProvider(
return MultiProvider(
providers: [
p.Provider.value(value: handler),
Provider.value(value: handler),
],
child: builder != null ? builder(context, handler) : child,
);
Expand Down
6 changes: 3 additions & 3 deletions lib/context/setup/wallet_setup_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:etherwallet/service/address_service.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_hooks/flutter_hooks.dart';

import 'package:provider/provider.dart' as p;
import 'package:provider/provider.dart';

import '../hook_provider.dart';

Expand All @@ -19,7 +19,7 @@ class WalletSetupProvider extends ContextProviderWidget<WalletSetupHandler> {
final store = useReducer<WalletSetup, WalletSetupAction>(reducer,
initialState: WalletSetup());

final addressService = p.Provider.of<AddressService>(context);
final addressService = Provider.of<AddressService>(context);
final handler = useMemoized(
() => WalletSetupHandler(store, addressService),
[addressService, store],
Expand All @@ -30,7 +30,7 @@ class WalletSetupProvider extends ContextProviderWidget<WalletSetupHandler> {
}

WalletSetupHandler useWalletSetup(BuildContext context) {
var handler = p.Provider.of<WalletSetupHandler>(context);
var handler = Provider.of<WalletSetupHandler>(context);

return handler;
}
Loading

0 comments on commit 2e7c83e

Please sign in to comment.