mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-05 10:29:23 +00:00
CAKE-53 | added dai to cryptocurrencies list; added dai to currency picker; added dai logo to contact list page; added address validator for dai
This commit is contained in:
parent
9eb74f7155
commit
360e04cc4c
7 changed files with 43 additions and 44 deletions
BIN
assets/images/dai.png
Normal file
BIN
assets/images/dai.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 72 KiB |
|
@ -22,6 +22,8 @@ class AddressValidator extends TextValidator {
|
||||||
return '[0-9a-zA-Z]';
|
return '[0-9a-zA-Z]';
|
||||||
case CryptoCurrency.btc:
|
case CryptoCurrency.btc:
|
||||||
return '[0-9a-zA-Z]';
|
return '[0-9a-zA-Z]';
|
||||||
|
case CryptoCurrency.dai:
|
||||||
|
return '[0-9a-zA-Z]';
|
||||||
case CryptoCurrency.dash:
|
case CryptoCurrency.dash:
|
||||||
return '[0-9a-zA-Z]';
|
return '[0-9a-zA-Z]';
|
||||||
case CryptoCurrency.eos:
|
case CryptoCurrency.eos:
|
||||||
|
@ -57,6 +59,8 @@ class AddressValidator extends TextValidator {
|
||||||
return [42];
|
return [42];
|
||||||
case CryptoCurrency.btc:
|
case CryptoCurrency.btc:
|
||||||
return [34, 42];
|
return [34, 42];
|
||||||
|
case CryptoCurrency.dai:
|
||||||
|
return [42];
|
||||||
case CryptoCurrency.dash:
|
case CryptoCurrency.dash:
|
||||||
return [34];
|
return [34];
|
||||||
case CryptoCurrency.eos:
|
case CryptoCurrency.eos:
|
||||||
|
|
|
@ -14,6 +14,7 @@ class CryptoCurrency extends EnumerableItem<int> with Serializable<int> {
|
||||||
CryptoCurrency.bch,
|
CryptoCurrency.bch,
|
||||||
CryptoCurrency.bnb,
|
CryptoCurrency.bnb,
|
||||||
CryptoCurrency.btc,
|
CryptoCurrency.btc,
|
||||||
|
CryptoCurrency.dai,
|
||||||
CryptoCurrency.dash,
|
CryptoCurrency.dash,
|
||||||
CryptoCurrency.eos,
|
CryptoCurrency.eos,
|
||||||
CryptoCurrency.eth,
|
CryptoCurrency.eth,
|
||||||
|
@ -29,15 +30,16 @@ class CryptoCurrency extends EnumerableItem<int> with Serializable<int> {
|
||||||
static const bch = CryptoCurrency(title: 'BCH', raw: 2);
|
static const bch = CryptoCurrency(title: 'BCH', raw: 2);
|
||||||
static const bnb = CryptoCurrency(title: 'BNB', raw: 3);
|
static const bnb = CryptoCurrency(title: 'BNB', raw: 3);
|
||||||
static const btc = CryptoCurrency(title: 'BTC', raw: 4);
|
static const btc = CryptoCurrency(title: 'BTC', raw: 4);
|
||||||
static const dash = CryptoCurrency(title: 'DASH', raw: 5);
|
static const dai = CryptoCurrency(title: 'DAI', raw: 5);
|
||||||
static const eos = CryptoCurrency(title: 'EOS', raw: 6);
|
static const dash = CryptoCurrency(title: 'DASH', raw: 6);
|
||||||
static const eth = CryptoCurrency(title: 'ETH', raw: 7);
|
static const eos = CryptoCurrency(title: 'EOS', raw: 7);
|
||||||
static const ltc = CryptoCurrency(title: 'LTC', raw: 8);
|
static const eth = CryptoCurrency(title: 'ETH', raw: 8);
|
||||||
static const nano = CryptoCurrency(title: 'NANO', raw: 9);
|
static const ltc = CryptoCurrency(title: 'LTC', raw: 9);
|
||||||
static const trx = CryptoCurrency(title: 'TRX', raw: 10);
|
static const nano = CryptoCurrency(title: 'NANO', raw: 10);
|
||||||
static const usdt = CryptoCurrency(title: 'USDT', raw: 11);
|
static const trx = CryptoCurrency(title: 'TRX', raw: 11);
|
||||||
static const xlm = CryptoCurrency(title: 'XLM', raw: 12);
|
static const usdt = CryptoCurrency(title: 'USDT', raw: 12);
|
||||||
static const xrp = CryptoCurrency(title: 'XRP', raw: 13);
|
static const xlm = CryptoCurrency(title: 'XLM', raw: 13);
|
||||||
|
static const xrp = CryptoCurrency(title: 'XRP', raw: 14);
|
||||||
|
|
||||||
static CryptoCurrency deserialize({int raw}) {
|
static CryptoCurrency deserialize({int raw}) {
|
||||||
switch (raw) {
|
switch (raw) {
|
||||||
|
@ -52,22 +54,24 @@ class CryptoCurrency extends EnumerableItem<int> with Serializable<int> {
|
||||||
case 4:
|
case 4:
|
||||||
return CryptoCurrency.btc;
|
return CryptoCurrency.btc;
|
||||||
case 5:
|
case 5:
|
||||||
return CryptoCurrency.dash;
|
return CryptoCurrency.dai;
|
||||||
case 6:
|
case 6:
|
||||||
return CryptoCurrency.eos;
|
return CryptoCurrency.dash;
|
||||||
case 7:
|
case 7:
|
||||||
return CryptoCurrency.eth;
|
return CryptoCurrency.eos;
|
||||||
case 8:
|
case 8:
|
||||||
return CryptoCurrency.ltc;
|
return CryptoCurrency.eth;
|
||||||
case 9:
|
case 9:
|
||||||
return CryptoCurrency.nano;
|
return CryptoCurrency.ltc;
|
||||||
case 10:
|
case 10:
|
||||||
return CryptoCurrency.trx;
|
return CryptoCurrency.nano;
|
||||||
case 11:
|
case 11:
|
||||||
return CryptoCurrency.usdt;
|
return CryptoCurrency.trx;
|
||||||
case 12:
|
case 12:
|
||||||
return CryptoCurrency.xlm;
|
return CryptoCurrency.usdt;
|
||||||
case 13:
|
case 13:
|
||||||
|
return CryptoCurrency.xlm;
|
||||||
|
case 14:
|
||||||
return CryptoCurrency.xrp;
|
return CryptoCurrency.xrp;
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
|
@ -86,6 +90,8 @@ class CryptoCurrency extends EnumerableItem<int> with Serializable<int> {
|
||||||
return CryptoCurrency.bnb;
|
return CryptoCurrency.bnb;
|
||||||
case 'btc':
|
case 'btc':
|
||||||
return CryptoCurrency.btc;
|
return CryptoCurrency.btc;
|
||||||
|
case 'dai':
|
||||||
|
return CryptoCurrency.dai;
|
||||||
case 'dash':
|
case 'dash':
|
||||||
return CryptoCurrency.dash;
|
return CryptoCurrency.dash;
|
||||||
case 'eos':
|
case 'eos':
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:cake_wallet/core/amount_converter.dart';
|
import 'package:cake_wallet/core/amount_converter.dart';
|
||||||
import 'package:cake_wallet/monero/monero_amount_format.dart';
|
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
import 'package:cake_wallet/exchange/trade_not_found_exeption.dart';
|
import 'package:cake_wallet/exchange/trade_not_found_exeption.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
|
|
|
@ -211,6 +211,9 @@ class ContactListPage extends BasePage {
|
||||||
case CryptoCurrency.btc:
|
case CryptoCurrency.btc:
|
||||||
image = Image.asset('assets/images/bitcoin.png', height: 24, width: 24);
|
image = Image.asset('assets/images/bitcoin.png', height: 24, width: 24);
|
||||||
break;
|
break;
|
||||||
|
case CryptoCurrency.dai:
|
||||||
|
image = Image.asset('assets/images/dai.png', height: 24, width: 24);
|
||||||
|
break;
|
||||||
case CryptoCurrency.dash:
|
case CryptoCurrency.dash:
|
||||||
image = Image.asset('assets/images/dash.png', height: 24, width: 24);
|
image = Image.asset('assets/images/dash.png', height: 24, width: 24);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -62,13 +62,7 @@ class CurrencyPicker extends StatelessWidget {
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
crossAxisSpacing: 1,
|
crossAxisSpacing: 1,
|
||||||
mainAxisSpacing: 1,
|
mainAxisSpacing: 1,
|
||||||
children: List.generate(15, (index) {
|
children: List.generate(items.length, (index) {
|
||||||
|
|
||||||
if (index == 14) {
|
|
||||||
return Container(
|
|
||||||
color: Theme.of(context).accentTextTheme.title.color,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
final item = items[index];
|
final item = items[index];
|
||||||
final isItemSelected = index == selectedAtIndex;
|
final isItemSelected = index == selectedAtIndex;
|
||||||
|
|
31
pubspec.lock
31
pubspec.lock
|
@ -42,7 +42,7 @@ packages:
|
||||||
name: async
|
name: async
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.4.2"
|
version: "2.4.1"
|
||||||
auto_size_text:
|
auto_size_text:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -210,7 +210,7 @@ packages:
|
||||||
name: collection
|
name: collection
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.14.13"
|
version: "1.14.12"
|
||||||
connectivity:
|
connectivity:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -252,7 +252,7 @@ packages:
|
||||||
name: crypto
|
name: crypto
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.5"
|
version: "2.1.4"
|
||||||
csslib:
|
csslib:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -330,13 +330,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.2"
|
version: "1.0.2"
|
||||||
fake_async:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: fake_async
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.1.0"
|
|
||||||
ffi:
|
ffi:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -505,7 +498,7 @@ packages:
|
||||||
name: image
|
name: image
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.17"
|
version: "2.1.12"
|
||||||
intl:
|
intl:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -554,7 +547,7 @@ packages:
|
||||||
name: matcher
|
name: matcher
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.8"
|
version: "0.12.6"
|
||||||
meta:
|
meta:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -624,7 +617,7 @@ packages:
|
||||||
name: path
|
name: path
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.7.0"
|
version: "1.6.4"
|
||||||
path_drawing:
|
path_drawing:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -687,7 +680,7 @@ packages:
|
||||||
name: petitparser
|
name: petitparser
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.4"
|
version: "2.4.0"
|
||||||
platform:
|
platform:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -874,7 +867,7 @@ packages:
|
||||||
name: stack_trace
|
name: stack_trace
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.9.5"
|
version: "1.9.3"
|
||||||
stream_channel:
|
stream_channel:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -909,7 +902,7 @@ packages:
|
||||||
name: test_api
|
name: test_api
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.2.17"
|
version: "0.2.15"
|
||||||
time:
|
time:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -930,7 +923,7 @@ packages:
|
||||||
name: typed_data
|
name: typed_data
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.0"
|
version: "1.1.6"
|
||||||
url_launcher:
|
url_launcher:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -1021,7 +1014,7 @@ packages:
|
||||||
name: xml
|
name: xml
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.5.1"
|
version: "3.6.1"
|
||||||
yaml:
|
yaml:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -1030,5 +1023,5 @@ packages:
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.1"
|
version: "2.2.1"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.9.0-14.0.dev <3.0.0"
|
dart: ">=2.7.0 <3.0.0"
|
||||||
flutter: ">=1.12.13+hotfix.5 <2.0.0"
|
flutter: ">=1.12.13+hotfix.5 <2.0.0"
|
||||||
|
|
Loading…
Reference in a new issue