Fixes
|
@ -1 +1 @@
|
||||||
bc336703210c48e30d7216fac3fe1c0f
|
4dc2ef1ba73deeed13cd85894dacb10b
|
|
@ -354,7 +354,7 @@
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 2;
|
CURRENT_PROJECT_VERSION = 3;
|
||||||
DEVELOPMENT_TEAM = 32J6BB6VUS;
|
DEVELOPMENT_TEAM = 32J6BB6VUS;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
|
@ -493,7 +493,7 @@
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 2;
|
CURRENT_PROJECT_VERSION = 3;
|
||||||
DEVELOPMENT_TEAM = 32J6BB6VUS;
|
DEVELOPMENT_TEAM = 32J6BB6VUS;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
|
@ -526,7 +526,7 @@
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 2;
|
CURRENT_PROJECT_VERSION = 3;
|
||||||
DEVELOPMENT_TEAM = 32J6BB6VUS;
|
DEVELOPMENT_TEAM = 32J6BB6VUS;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
|
|
|
@ -1,117 +1,96 @@
|
||||||
{
|
{
|
||||||
"images" : [
|
"images" : [
|
||||||
{
|
{
|
||||||
"size" : "20x20",
|
|
||||||
"idiom" : "iphone",
|
"idiom" : "iphone",
|
||||||
"filename" : "Icon-App-20x20@2x.png",
|
"size" : "20x20",
|
||||||
"scale" : "2x"
|
"scale" : "2x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"size" : "20x20",
|
|
||||||
"idiom" : "iphone",
|
"idiom" : "iphone",
|
||||||
"filename" : "Icon-App-20x20@3x.png",
|
"size" : "20x20",
|
||||||
"scale" : "3x"
|
"scale" : "3x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"size" : "29x29",
|
|
||||||
"idiom" : "iphone",
|
"idiom" : "iphone",
|
||||||
"filename" : "Icon-App-29x29@1x.png",
|
|
||||||
"scale" : "1x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"size" : "29x29",
|
"size" : "29x29",
|
||||||
"idiom" : "iphone",
|
|
||||||
"filename" : "Icon-App-29x29@2x.png",
|
|
||||||
"scale" : "2x"
|
"scale" : "2x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"size" : "29x29",
|
|
||||||
"idiom" : "iphone",
|
"idiom" : "iphone",
|
||||||
"filename" : "Icon-App-29x29@3x.png",
|
"size" : "29x29",
|
||||||
"scale" : "3x"
|
"scale" : "3x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"size" : "40x40",
|
|
||||||
"idiom" : "iphone",
|
"idiom" : "iphone",
|
||||||
"filename" : "Icon-App-40x40@2x.png",
|
"size" : "40x40",
|
||||||
"scale" : "2x"
|
"scale" : "2x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"size" : "40x40",
|
|
||||||
"idiom" : "iphone",
|
"idiom" : "iphone",
|
||||||
"filename" : "Icon-App-40x40@3x.png",
|
"size" : "40x40",
|
||||||
"scale" : "3x"
|
"scale" : "3x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"size" : "60x60",
|
"size" : "60x60",
|
||||||
"idiom" : "iphone",
|
"idiom" : "iphone",
|
||||||
"filename" : "Icon-App-60x60@2x.png",
|
"filename" : "cake_xmr_120.png",
|
||||||
"scale" : "2x"
|
"scale" : "2x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"size" : "60x60",
|
"size" : "60x60",
|
||||||
"idiom" : "iphone",
|
"idiom" : "iphone",
|
||||||
"filename" : "Icon-App-60x60@3x.png",
|
"filename" : "cake_xmr_180.png",
|
||||||
"scale" : "3x"
|
"scale" : "3x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"idiom" : "ipad",
|
||||||
"size" : "20x20",
|
"size" : "20x20",
|
||||||
"idiom" : "ipad",
|
|
||||||
"filename" : "Icon-App-20x20@1x.png",
|
|
||||||
"scale" : "1x"
|
"scale" : "1x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"idiom" : "ipad",
|
||||||
"size" : "20x20",
|
"size" : "20x20",
|
||||||
"idiom" : "ipad",
|
|
||||||
"filename" : "Icon-App-20x20@2x.png",
|
|
||||||
"scale" : "2x"
|
"scale" : "2x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"idiom" : "ipad",
|
||||||
"size" : "29x29",
|
"size" : "29x29",
|
||||||
"idiom" : "ipad",
|
|
||||||
"filename" : "Icon-App-29x29@1x.png",
|
|
||||||
"scale" : "1x"
|
"scale" : "1x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"idiom" : "ipad",
|
||||||
"size" : "29x29",
|
"size" : "29x29",
|
||||||
"idiom" : "ipad",
|
|
||||||
"filename" : "Icon-App-29x29@2x.png",
|
|
||||||
"scale" : "2x"
|
"scale" : "2x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"size" : "40x40",
|
|
||||||
"idiom" : "ipad",
|
"idiom" : "ipad",
|
||||||
"filename" : "Icon-App-40x40@1x.png",
|
"size" : "40x40",
|
||||||
"scale" : "1x"
|
"scale" : "1x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"size" : "40x40",
|
|
||||||
"idiom" : "ipad",
|
"idiom" : "ipad",
|
||||||
"filename" : "Icon-App-40x40@2x.png",
|
"size" : "40x40",
|
||||||
"scale" : "2x"
|
"scale" : "2x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"size" : "76x76",
|
|
||||||
"idiom" : "ipad",
|
"idiom" : "ipad",
|
||||||
"filename" : "Icon-App-76x76@1x.png",
|
"size" : "76x76",
|
||||||
"scale" : "1x"
|
"scale" : "1x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"size" : "76x76",
|
|
||||||
"idiom" : "ipad",
|
"idiom" : "ipad",
|
||||||
"filename" : "Icon-App-76x76@2x.png",
|
"size" : "76x76",
|
||||||
"scale" : "2x"
|
"scale" : "2x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"idiom" : "ipad",
|
||||||
"size" : "83.5x83.5",
|
"size" : "83.5x83.5",
|
||||||
"idiom" : "ipad",
|
|
||||||
"filename" : "Icon-App-83.5x83.5@2x.png",
|
|
||||||
"scale" : "2x"
|
"scale" : "2x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"size" : "1024x1024",
|
"size" : "1024x1024",
|
||||||
"idiom" : "ios-marketing",
|
"idiom" : "ios-marketing",
|
||||||
"filename" : "Icon-App-1024x1024@1x.png",
|
"filename" : "cake_xmr_1024.png",
|
||||||
"scale" : "1x"
|
"scale" : "1x"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -119,4 +98,4 @@
|
||||||
"version" : 1,
|
"version" : 1,
|
||||||
"author" : "xcode"
|
"author" : "xcode"
|
||||||
}
|
}
|
||||||
}
|
}
|
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 564 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.5 KiB |
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/cake_xmr_1024.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/cake_xmr_120.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
ios/Runner/Assets.xcassets/AppIcon.appiconset/cake_xmr_180.png
Normal file
After Width: | Height: | Size: 14 KiB |
|
@ -39,12 +39,17 @@ class Node extends HiveObject with Keyable {
|
||||||
int typeRaw;
|
int typeRaw;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
dynamic get keyIndex => key;
|
dynamic get keyIndex {
|
||||||
|
_keyIndex ??= key;
|
||||||
|
return _keyIndex;
|
||||||
|
}
|
||||||
|
|
||||||
WalletType get type => deserializeFromInt(typeRaw);
|
WalletType get type => deserializeFromInt(typeRaw);
|
||||||
|
|
||||||
set type(WalletType type) => typeRaw = serializeToInt(type);
|
set type(WalletType type) => typeRaw = serializeToInt(type);
|
||||||
|
|
||||||
|
dynamic _keyIndex;
|
||||||
|
|
||||||
Future<bool> requestNode() async {
|
Future<bool> requestNode() async {
|
||||||
try {
|
try {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
|
|
@ -39,9 +39,9 @@ Future<List<Node>> loadElectrumServerList() async {
|
||||||
|
|
||||||
Future resetToDefault(Box<Node> nodeSource) async {
|
Future resetToDefault(Box<Node> nodeSource) async {
|
||||||
final moneroNodes = await loadDefaultNodes();
|
final moneroNodes = await loadDefaultNodes();
|
||||||
final bitcoinElectrumServerList = await loadElectrumServerList();
|
// final bitcoinElectrumServerList = await loadElectrumServerList();
|
||||||
final nodes = moneroNodes + bitcoinElectrumServerList;
|
// final nodes = moneroNodes + bitcoinElectrumServerList;
|
||||||
|
|
||||||
await nodeSource.clear();
|
await nodeSource.clear();
|
||||||
await nodeSource.addAll(nodes);
|
await nodeSource.addAll(moneroNodes);
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,8 +39,22 @@ abstract class MoneroSubaddressListBase with Store {
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Subaddress> getAll() {
|
List<Subaddress> getAll() {
|
||||||
return subaddress_list
|
final subaddresses = subaddress_list.getAllSubaddresses();
|
||||||
.getAllSubaddresses()
|
if (subaddresses.length > 1) {
|
||||||
|
// final primary = subaddresses.first;
|
||||||
|
// final last = subaddresses.last;
|
||||||
|
// subaddresses[subaddresses.length - 1] = primary;
|
||||||
|
// subaddresses[0] = last;
|
||||||
|
|
||||||
|
// for (var i = subaddresses.length - 1; i >= 0; i--) {
|
||||||
|
// final pre = subaddresses[i];
|
||||||
|
// final post = subaddresses[subaddresses.length - i];
|
||||||
|
// subaddresses[subaddresses.length - i] = pre;
|
||||||
|
// subaddresses[i] = post;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
return subaddresses
|
||||||
.map((subaddressRow) => Subaddress.fromRow(subaddressRow))
|
.map((subaddressRow) => Subaddress.fromRow(subaddressRow))
|
||||||
.toList();
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,7 @@ class MoneroWalletService extends WalletService<
|
||||||
Future<MoneroWallet> openWallet(String name, String password) async {
|
Future<MoneroWallet> openWallet(String name, String password) async {
|
||||||
try {
|
try {
|
||||||
final path = await pathForWallet(name: name, type: WalletType.monero);
|
final path = await pathForWallet(name: name, type: WalletType.monero);
|
||||||
monero_wallet_manager.openWallet(path: path, password: password);
|
await monero_wallet_manager.openWalletAsync({'path': path, 'password': password});
|
||||||
final walletInfo = walletInfoSource.values.firstWhere(
|
final walletInfo = walletInfoSource.values.firstWhere(
|
||||||
(info) => info.id == WalletBase.idFor(name, WalletType.monero), orElse: () => null);
|
(info) => info.id == WalletBase.idFor(name, WalletType.monero), orElse: () => null);
|
||||||
final wallet = MoneroWallet(
|
final wallet = MoneroWallet(
|
||||||
|
|
|
@ -11,7 +11,10 @@ class Subaddress {
|
||||||
Subaddress.fromRow(SubaddressRow row)
|
Subaddress.fromRow(SubaddressRow row)
|
||||||
: this.id = row.getId(),
|
: this.id = row.getId(),
|
||||||
this.address = row.getAddress(),
|
this.address = row.getAddress(),
|
||||||
this.label = row.getLabel();
|
this.label = row.getId() == 0 &&
|
||||||
|
row.getLabel().toLowerCase() == 'Primary account'.toLowerCase()
|
||||||
|
? 'Primary address'
|
||||||
|
: row.getLabel();
|
||||||
|
|
||||||
final int id;
|
final int id;
|
||||||
final String address;
|
final String address;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'package:cake_wallet/utils/show_bar.dart';
|
||||||
|
import 'package:flushbar/flushbar.dart';
|
||||||
import 'package:mobx/mobx.dart';
|
import 'package:mobx/mobx.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
|
@ -29,6 +31,8 @@ class AuthPageState extends State<AuthPage> {
|
||||||
final _backArrowImageDarkTheme =
|
final _backArrowImageDarkTheme =
|
||||||
Image.asset('assets/images/close_button.png');
|
Image.asset('assets/images/close_button.png');
|
||||||
ReactionDisposer _reaction;
|
ReactionDisposer _reaction;
|
||||||
|
Flushbar<void> _authBar;
|
||||||
|
Flushbar<void> _progressBar;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
|
@ -39,37 +43,26 @@ class AuthPageState extends State<AuthPage> {
|
||||||
if (widget.onAuthenticationFinished != null) {
|
if (widget.onAuthenticationFinished != null) {
|
||||||
widget.onAuthenticationFinished(true, this);
|
widget.onAuthenticationFinished(true, this);
|
||||||
} else {
|
} else {
|
||||||
_key.currentState.showSnackBar(
|
_authBar?.dismiss();
|
||||||
SnackBar(
|
showBar<void>(context, S.of(context).authenticated);
|
||||||
content: Text(S.of(context).authenticated),
|
|
||||||
backgroundColor: Colors.green,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state is IsExecutingState) {
|
if (state is IsExecutingState) {
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
_key.currentState.showSnackBar(
|
_authBar =
|
||||||
SnackBar(
|
createBar<void>(S.of(context).authentication, duration: null)
|
||||||
content: Text(S.of(context).authentication),
|
..show(context);
|
||||||
backgroundColor: Colors.green,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state is FailureState) {
|
if (state is FailureState) {
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
_pinCodeKey.currentState.clear();
|
_pinCodeKey.currentState.clear();
|
||||||
_key.currentState.hideCurrentSnackBar();
|
_authBar?.dismiss();
|
||||||
_key.currentState.showSnackBar(
|
showBar<void>(
|
||||||
SnackBar(
|
context, S.of(context).failed_authentication(state.error));
|
||||||
content: Text(S.of(context).failed_authentication(state.error)),
|
|
||||||
backgroundColor: Colors.red,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
if (widget.onAuthenticationFinished != null) {
|
if (widget.onAuthenticationFinished != null) {
|
||||||
widget.onAuthenticationFinished(false, this);
|
widget.onAuthenticationFinished(false, this);
|
||||||
|
@ -80,13 +73,9 @@ class AuthPageState extends State<AuthPage> {
|
||||||
if (state is AuthenticationBanned) {
|
if (state is AuthenticationBanned) {
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
_pinCodeKey.currentState.clear();
|
_pinCodeKey.currentState.clear();
|
||||||
_key.currentState.hideCurrentSnackBar();
|
_authBar?.dismiss();
|
||||||
_key.currentState.showSnackBar(
|
showBar<void>(
|
||||||
SnackBar(
|
context, S.of(context).failed_authentication(state.error));
|
||||||
content: Text(S.of(context).failed_authentication(state.error)),
|
|
||||||
backgroundColor: Colors.red,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
if (widget.onAuthenticationFinished != null) {
|
if (widget.onAuthenticationFinished != null) {
|
||||||
widget.onAuthenticationFinished(false, this);
|
widget.onAuthenticationFinished(false, this);
|
||||||
|
@ -111,10 +100,22 @@ class AuthPageState extends State<AuthPage> {
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
void changeProcessText(String text) => _key.currentState.showSnackBar(
|
void changeProcessText(String text) {
|
||||||
SnackBar(content: Text(text), backgroundColor: Colors.green));
|
_authBar?.dismiss();
|
||||||
|
_progressBar = createBar<void>(text, duration: null)
|
||||||
|
..show(_key.currentContext);
|
||||||
|
}
|
||||||
|
|
||||||
void close() => Navigator.of(_key.currentContext).pop();
|
void hideProgressText() {
|
||||||
|
_progressBar?.dismiss();
|
||||||
|
_progressBar = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
void close() {
|
||||||
|
_authBar?.dismiss();
|
||||||
|
_progressBar?.dismiss();
|
||||||
|
Navigator.of(_key.currentContext).pop();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -123,20 +124,20 @@ class AuthPageState extends State<AuthPage> {
|
||||||
appBar: CupertinoNavigationBar(
|
appBar: CupertinoNavigationBar(
|
||||||
leading: widget.closable
|
leading: widget.closable
|
||||||
? Container(
|
? Container(
|
||||||
padding: EdgeInsets.only(top: 10),
|
padding: EdgeInsets.only(top: 10),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: 37,
|
height: 37,
|
||||||
width: 37,
|
width: 37,
|
||||||
child: ButtonTheme(
|
child: ButtonTheme(
|
||||||
minWidth: double.minPositive,
|
minWidth: double.minPositive,
|
||||||
child: FlatButton(
|
child: FlatButton(
|
||||||
highlightColor: Colors.transparent,
|
highlightColor: Colors.transparent,
|
||||||
splashColor: Colors.transparent,
|
splashColor: Colors.transparent,
|
||||||
padding: EdgeInsets.all(0),
|
padding: EdgeInsets.all(0),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
child: _backArrowImageDarkTheme),
|
child: _backArrowImageDarkTheme),
|
||||||
),
|
),
|
||||||
))
|
))
|
||||||
: Container(),
|
: Container(),
|
||||||
backgroundColor: Theme.of(context).backgroundColor,
|
backgroundColor: Theme.of(context).backgroundColor,
|
||||||
border: null),
|
border: null),
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import 'package:cake_wallet/utils/show_bar.dart';
|
||||||
import 'package:cake_wallet/utils/show_pop_up.dart';
|
import 'package:cake_wallet/utils/show_pop_up.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
|
@ -56,16 +57,6 @@ class ContactListPage extends BasePage {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget body(BuildContext context) {
|
Widget body(BuildContext context) {
|
||||||
final shortDivider = Container(
|
|
||||||
height: 1,
|
|
||||||
padding: EdgeInsets.only(left: 24),
|
|
||||||
color: Theme.of(context).backgroundColor,
|
|
||||||
child: Container(
|
|
||||||
height: 1,
|
|
||||||
color: Theme.of(context).primaryTextTheme.title.backgroundColor,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
padding: EdgeInsets.only(top: 20.0, bottom: 20.0),
|
padding: EdgeInsets.only(top: 20.0, bottom: 20.0),
|
||||||
child: Observer(
|
child: Observer(
|
||||||
|
@ -92,16 +83,8 @@ class ContactListPage extends BasePage {
|
||||||
if (isCopied != null && isCopied) {
|
if (isCopied != null && isCopied) {
|
||||||
await Clipboard.setData(
|
await Clipboard.setData(
|
||||||
ClipboardData(text: contact.address));
|
ClipboardData(text: contact.address));
|
||||||
Scaffold.of(context).showSnackBar(
|
await showBar<void>(context,
|
||||||
SnackBar(
|
S.of(context).copied_to_clipboard);
|
||||||
content: Text(
|
|
||||||
S.of(context).copied_to_clipboard,
|
|
||||||
style: TextStyle(color: Colors.white),
|
|
||||||
),
|
|
||||||
backgroundColor: Colors.green,
|
|
||||||
duration: Duration(milliseconds: 1500),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|
|
@ -13,6 +13,7 @@ class WalletMenu {
|
||||||
|
|
||||||
final List<String> items = [
|
final List<String> items = [
|
||||||
S.current.reconnect,
|
S.current.reconnect,
|
||||||
|
S.current.rescan,
|
||||||
S.current.wallets,
|
S.current.wallets,
|
||||||
S.current.nodes,
|
S.current.nodes,
|
||||||
S.current.show_seed,
|
S.current.show_seed,
|
||||||
|
@ -23,6 +24,7 @@ class WalletMenu {
|
||||||
|
|
||||||
final List<Image> images = [
|
final List<Image> images = [
|
||||||
Image.asset('assets/images/reconnect_menu.png', height: 16, width: 16),
|
Image.asset('assets/images/reconnect_menu.png', height: 16, width: 16),
|
||||||
|
Image.asset('assets/images/filter_icon.png', height: 16, width: 16),
|
||||||
Image.asset('assets/images/wallet_menu.png', height: 16, width: 16),
|
Image.asset('assets/images/wallet_menu.png', height: 16, width: 16),
|
||||||
Image.asset('assets/images/nodes_menu.png', height: 16, width: 16),
|
Image.asset('assets/images/nodes_menu.png', height: 16, width: 16),
|
||||||
Image.asset('assets/images/eye_menu.png', height: 16, width: 16),
|
Image.asset('assets/images/eye_menu.png', height: 16, width: 16),
|
||||||
|
@ -40,12 +42,15 @@ class WalletMenu {
|
||||||
_presentReconnectAlert(context);
|
_presentReconnectAlert(context);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
Navigator.of(context).pushNamed(Routes.walletList);
|
Navigator.of(context).pushNamed(Routes.rescan);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
Navigator.of(context).pushNamed(Routes.nodeList);
|
Navigator.of(context).pushNamed(Routes.walletList);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
|
Navigator.of(context).pushNamed(Routes.nodeList);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
Navigator.of(context).pushNamed(Routes.auth,
|
Navigator.of(context).pushNamed(Routes.auth,
|
||||||
arguments: (bool isAuthenticatedSuccessfully, AuthPageState auth) =>
|
arguments: (bool isAuthenticatedSuccessfully, AuthPageState auth) =>
|
||||||
isAuthenticatedSuccessfully
|
isAuthenticatedSuccessfully
|
||||||
|
@ -53,7 +58,7 @@ class WalletMenu {
|
||||||
: null);
|
: null);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 5:
|
||||||
Navigator.of(context).pushNamed(Routes.auth,
|
Navigator.of(context).pushNamed(Routes.auth,
|
||||||
arguments: (bool isAuthenticatedSuccessfully, AuthPageState auth) =>
|
arguments: (bool isAuthenticatedSuccessfully, AuthPageState auth) =>
|
||||||
isAuthenticatedSuccessfully
|
isAuthenticatedSuccessfully
|
||||||
|
@ -61,10 +66,10 @@ class WalletMenu {
|
||||||
.popAndPushNamed(Routes.showKeys)
|
.popAndPushNamed(Routes.showKeys)
|
||||||
: null);
|
: null);
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 6:
|
||||||
Navigator.of(context).pushNamed(Routes.addressBook);
|
Navigator.of(context).pushNamed(Routes.addressBook);
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 7:
|
||||||
Navigator.of(context).pushNamed(Routes.settings);
|
Navigator.of(context).pushNamed(Routes.settings);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import 'package:cake_wallet/utils/show_bar.dart';
|
||||||
import 'package:cake_wallet/utils/show_pop_up.dart';
|
import 'package:cake_wallet/utils/show_pop_up.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
@ -270,14 +271,8 @@ class ExchangeCardState extends State<ExchangeCard> {
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Clipboard.setData(
|
Clipboard.setData(
|
||||||
ClipboardData(text: addressController.text));
|
ClipboardData(text: addressController.text));
|
||||||
Scaffold.of(context).showSnackBar(SnackBar(
|
showBar<void>(context,
|
||||||
content: Text(
|
S.of(context).copied_to_clipboard);
|
||||||
S.of(context).copied_to_clipboard,
|
|
||||||
style: TextStyle(color: Colors.white),
|
|
||||||
),
|
|
||||||
backgroundColor: Colors.green,
|
|
||||||
duration: Duration(milliseconds: 500),
|
|
||||||
));
|
|
||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import 'package:cake_wallet/store/dashboard/trades_store.dart';
|
import 'package:cake_wallet/store/dashboard/trades_store.dart';
|
||||||
|
import 'package:cake_wallet/utils/show_bar.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
@ -25,91 +26,84 @@ class ExchangeConfirmPage extends BasePage {
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Flexible(
|
Flexible(
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
S.of(context).exchange_result_write_down_trade_id,
|
S.of(context).exchange_result_write_down_trade_id,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 18.0,
|
fontSize: 18.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
color: Theme.of(context).primaryTextTheme.title.color),
|
color: Theme.of(context).primaryTextTheme.title.color),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
Container(
|
||||||
|
height: 178,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(30)),
|
||||||
|
border: Border.all(
|
||||||
|
width: 1,
|
||||||
|
color: Theme.of(context).accentTextTheme.caption.color),
|
||||||
|
color: Theme.of(context).accentTextTheme.title.color),
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.all(24),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: <Widget>[
|
||||||
|
Text(
|
||||||
|
S.of(context).trade_id,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12.0,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Theme.of(context)
|
||||||
|
.primaryTextTheme
|
||||||
|
.overline
|
||||||
|
.color),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
trade.id,
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Theme.of(context)
|
||||||
|
.primaryTextTheme
|
||||||
|
.title
|
||||||
|
.color),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.fromLTRB(10, 0, 10, 10),
|
||||||
|
child: Builder(
|
||||||
|
builder: (context) => PrimaryButton(
|
||||||
|
onPressed: () {
|
||||||
|
Clipboard.setData(ClipboardData(text: trade.id));
|
||||||
|
showBar<void>(
|
||||||
|
context, S.of(context).copied_to_clipboard);
|
||||||
|
},
|
||||||
|
text: S.of(context).copy_id,
|
||||||
|
color: Theme.of(context)
|
||||||
|
.accentTextTheme
|
||||||
|
.caption
|
||||||
|
.backgroundColor,
|
||||||
|
textColor:
|
||||||
|
Theme.of(context).primaryTextTheme.title.color),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
),
|
],
|
||||||
Container(
|
),
|
||||||
height: 178,
|
),
|
||||||
decoration: BoxDecoration(
|
Flexible(child: Offstage()),
|
||||||
borderRadius: BorderRadius.all(Radius.circular(30)),
|
],
|
||||||
border: Border.all(
|
)),
|
||||||
width: 1,
|
|
||||||
color: Theme.of(context).accentTextTheme.caption.color
|
|
||||||
),
|
|
||||||
color: Theme.of(context).accentTextTheme.title.color
|
|
||||||
),
|
|
||||||
child: Column(
|
|
||||||
children: <Widget>[
|
|
||||||
Expanded(
|
|
||||||
child: Padding(
|
|
||||||
padding: EdgeInsets.all(24),
|
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: <Widget>[
|
|
||||||
Text(
|
|
||||||
S.of(context).trade_id,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 12.0,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
color: Theme.of(context).primaryTextTheme.overline.color
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
trade.id,
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
color: Theme.of(context).primaryTextTheme.title.color
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.fromLTRB(10, 0, 10, 10),
|
|
||||||
child: Builder(
|
|
||||||
builder: (context) => PrimaryButton(
|
|
||||||
onPressed: () {
|
|
||||||
Clipboard.setData(ClipboardData(text: trade.id));
|
|
||||||
Scaffold.of(context).showSnackBar(SnackBar(
|
|
||||||
content: Text(
|
|
||||||
S.of(context).copied_to_clipboard,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(color: Colors.white),
|
|
||||||
),
|
|
||||||
backgroundColor: Colors.green,
|
|
||||||
duration: Duration(milliseconds: 1500),
|
|
||||||
));
|
|
||||||
},
|
|
||||||
text: S.of(context).copy_id,
|
|
||||||
color: Theme.of(context).accentTextTheme.caption.backgroundColor,
|
|
||||||
textColor: Theme.of(context).primaryTextTheme.title.color
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Flexible(
|
|
||||||
child: Offstage()
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
),
|
|
||||||
PrimaryButton(
|
PrimaryButton(
|
||||||
onPressed: () => Navigator.of(context)
|
onPressed: () => Navigator.of(context)
|
||||||
.pushReplacementNamed(Routes.exchangeTrade),
|
.pushReplacementNamed(Routes.exchangeTrade),
|
||||||
|
|
|
@ -4,6 +4,7 @@ import 'package:cake_wallet/exchange/exchange_provider_description.dart';
|
||||||
import 'package:cake_wallet/src/screens/exchange_trade/exchange_trade_item.dart';
|
import 'package:cake_wallet/src/screens/exchange_trade/exchange_trade_item.dart';
|
||||||
import 'package:cake_wallet/src/screens/exchange_trade/information_page.dart';
|
import 'package:cake_wallet/src/screens/exchange_trade/information_page.dart';
|
||||||
import 'package:cake_wallet/src/widgets/standart_list_row.dart';
|
import 'package:cake_wallet/src/widgets/standart_list_row.dart';
|
||||||
|
import 'package:cake_wallet/utils/show_bar.dart';
|
||||||
import 'package:cake_wallet/utils/show_pop_up.dart';
|
import 'package:cake_wallet/utils/show_pop_up.dart';
|
||||||
import 'package:cake_wallet/view_model/exchange/exchange_trade_view_model.dart';
|
import 'package:cake_wallet/view_model/exchange/exchange_trade_view_model.dart';
|
||||||
import 'package:mobx/mobx.dart';
|
import 'package:mobx/mobx.dart';
|
||||||
|
@ -13,6 +14,7 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:cake_wallet/generated/i18n.dart';
|
import 'package:cake_wallet/generated/i18n.dart';
|
||||||
|
|
||||||
// import 'package:cake_wallet/src/stores/exchange_trade/exchange_trade_store.dart';
|
// import 'package:cake_wallet/src/stores/exchange_trade/exchange_trade_store.dart';
|
||||||
// import 'package:cake_wallet/src/stores/send/send_store.dart';
|
// import 'package:cake_wallet/src/stores/send/send_store.dart';
|
||||||
// import 'package:cake_wallet/src/stores/send/sending_state.dart';
|
// import 'package:cake_wallet/src/stores/send/sending_state.dart';
|
||||||
|
@ -25,23 +27,21 @@ import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
|
||||||
import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
|
import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
|
||||||
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
|
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
|
||||||
|
|
||||||
void showInformation(ExchangeTradeViewModel exchangeTradeViewModel, BuildContext context) {
|
void showInformation(
|
||||||
|
ExchangeTradeViewModel exchangeTradeViewModel, BuildContext context) {
|
||||||
final fetchingLabel = S.current.fetching;
|
final fetchingLabel = S.current.fetching;
|
||||||
final trade = exchangeTradeViewModel.trade;
|
final trade = exchangeTradeViewModel.trade;
|
||||||
final walletName = exchangeTradeViewModel.wallet.name;
|
final walletName = exchangeTradeViewModel.wallet.name;
|
||||||
|
|
||||||
final information = exchangeTradeViewModel.isSendable
|
final information = exchangeTradeViewModel.isSendable
|
||||||
? S.current.exchange_result_confirm(
|
? S.current.exchange_result_confirm(
|
||||||
trade.amount ?? fetchingLabel,
|
trade.amount ?? fetchingLabel, trade.from.toString(), walletName)
|
||||||
trade.from.toString(),
|
|
||||||
walletName)
|
|
||||||
: S.current.exchange_result_description(
|
: S.current.exchange_result_description(
|
||||||
trade.amount ?? fetchingLabel, trade.from.toString());
|
trade.amount ?? fetchingLabel, trade.from.toString());
|
||||||
|
|
||||||
showPopUp<void>(
|
showPopUp<void>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (_) => InformationPage(information: information)
|
builder: (_) => InformationPage(information: information));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class ExchangeTradePage extends BasePage {
|
class ExchangeTradePage extends BasePage {
|
||||||
|
@ -73,7 +73,8 @@ class ExchangeTradePage extends BasePage {
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget body(BuildContext context) => ExchangeTradeForm(exchangeTradeViewModel);
|
Widget body(BuildContext context) =>
|
||||||
|
ExchangeTradeForm(exchangeTradeViewModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
class ExchangeTradeForm extends StatefulWidget {
|
class ExchangeTradeForm extends StatefulWidget {
|
||||||
|
@ -87,6 +88,7 @@ class ExchangeTradeForm extends StatefulWidget {
|
||||||
|
|
||||||
class ExchangeTradeState extends State<ExchangeTradeForm> {
|
class ExchangeTradeState extends State<ExchangeTradeForm> {
|
||||||
final fetchingLabel = S.current.fetching;
|
final fetchingLabel = S.current.fetching;
|
||||||
|
|
||||||
String get title => S.current.exchange;
|
String get title => S.current.exchange;
|
||||||
|
|
||||||
bool _effectsInstalled = false;
|
bool _effectsInstalled = false;
|
||||||
|
@ -104,127 +106,133 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final copyImage = Image.asset('assets/images/copy_content.png',
|
final copyImage = Image.asset('assets/images/copy_content.png',
|
||||||
height: 16, width: 16,
|
height: 16,
|
||||||
|
width: 16,
|
||||||
color: Theme.of(context).primaryTextTheme.overline.color);
|
color: Theme.of(context).primaryTextTheme.overline.color);
|
||||||
|
|
||||||
//_setEffects(context);
|
//_setEffects(context);
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
child: ScrollableWithBottomSection(
|
child: ScrollableWithBottomSection(
|
||||||
contentPadding: EdgeInsets.only(top: 10, bottom: 16),
|
contentPadding: EdgeInsets.only(top: 10, bottom: 16),
|
||||||
content: Observer(builder: (_) {
|
content: Observer(builder: (_) {
|
||||||
final trade = widget.exchangeTradeViewModel.trade;
|
final trade = widget.exchangeTradeViewModel.trade;
|
||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
trade.expiredAt != null
|
trade.expiredAt != null
|
||||||
? Row(
|
? Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text(
|
Text(
|
||||||
S.of(context).offer_expires_in,
|
S.of(context).offer_expires_in,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
color: Theme.of(context).primaryTextTheme.overline.color),
|
color: Theme.of(context)
|
||||||
),
|
.primaryTextTheme
|
||||||
TimerWidget(trade.expiredAt,
|
.overline
|
||||||
color: Theme.of(context).primaryTextTheme.title.color)
|
.color),
|
||||||
])
|
),
|
||||||
: Offstage(),
|
TimerWidget(trade.expiredAt,
|
||||||
Padding(
|
color: Theme.of(context)
|
||||||
padding: EdgeInsets.only(top: 32),
|
.primaryTextTheme
|
||||||
child: Row(children: <Widget>[
|
.title
|
||||||
Spacer(flex: 3),
|
.color)
|
||||||
Flexible(
|
])
|
||||||
flex: 4,
|
: Offstage(),
|
||||||
child: Center(
|
Padding(
|
||||||
child: AspectRatio(
|
padding: EdgeInsets.only(top: 32),
|
||||||
aspectRatio: 1.0,
|
child: Row(children: <Widget>[
|
||||||
child: QrImage(
|
Spacer(flex: 3),
|
||||||
data: trade.inputAddress ?? fetchingLabel,
|
Flexible(
|
||||||
backgroundColor: Colors.transparent,
|
flex: 4,
|
||||||
foregroundColor: Theme.of(context)
|
child: Center(
|
||||||
.accentTextTheme.subtitle.color,
|
child: AspectRatio(
|
||||||
)))),
|
aspectRatio: 1.0,
|
||||||
Spacer(flex: 3)
|
child: QrImage(
|
||||||
]),
|
data: trade.inputAddress ?? fetchingLabel,
|
||||||
),
|
backgroundColor: Colors.transparent,
|
||||||
Padding(
|
foregroundColor: Theme.of(context)
|
||||||
padding: EdgeInsets.only(top: 16),
|
.accentTextTheme
|
||||||
child: ListView.separated(
|
.subtitle
|
||||||
shrinkWrap: true,
|
.color,
|
||||||
physics: NeverScrollableScrollPhysics(),
|
)))),
|
||||||
itemCount: widget.exchangeTradeViewModel.items.length,
|
Spacer(flex: 3)
|
||||||
separatorBuilder: (context, index) => Container(
|
]),
|
||||||
height: 1,
|
|
||||||
color: Theme.of(context).accentTextTheme.subtitle.backgroundColor,
|
|
||||||
),
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
final item = widget.exchangeTradeViewModel.items[index];
|
|
||||||
String value;
|
|
||||||
|
|
||||||
final content = Observer(
|
|
||||||
builder: (_) {
|
|
||||||
switch (index) {
|
|
||||||
case 0:
|
|
||||||
value = '${widget.exchangeTradeViewModel.trade.id ?? fetchingLabel}';
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
value = '${widget.exchangeTradeViewModel.trade.amount ?? fetchingLabel}';
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
value = '${widget.exchangeTradeViewModel.trade.state ?? fetchingLabel}';
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
value = widget.exchangeTradeViewModel.trade.inputAddress ?? fetchingLabel;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return StandartListRow(
|
|
||||||
title: item.title,
|
|
||||||
value: value,
|
|
||||||
valueFontSize: 14,
|
|
||||||
image: item.isCopied ? copyImage : null,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
return item.isCopied
|
|
||||||
? Builder(
|
|
||||||
builder: (context) =>
|
|
||||||
GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
Clipboard.setData(ClipboardData(text: value));
|
|
||||||
Scaffold.of(context).showSnackBar(SnackBar(
|
|
||||||
content: Text(
|
|
||||||
S.of(context).copied_to_clipboard,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(color: Colors.white),
|
|
||||||
),
|
|
||||||
backgroundColor: Colors.green,
|
|
||||||
duration: Duration(milliseconds: 1500),
|
|
||||||
));
|
|
||||||
},
|
|
||||||
child: content,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
: content;
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
),
|
Padding(
|
||||||
],
|
padding: EdgeInsets.only(top: 16),
|
||||||
);
|
child: ListView.separated(
|
||||||
}),
|
shrinkWrap: true,
|
||||||
bottomSectionPadding: EdgeInsets.fromLTRB(24, 0, 24, 24),
|
physics: NeverScrollableScrollPhysics(),
|
||||||
bottomSection: PrimaryButton(
|
itemCount: widget.exchangeTradeViewModel.items.length,
|
||||||
onPressed: () {},
|
separatorBuilder: (context, index) => Container(
|
||||||
text: S.of(context).confirm,
|
height: 1,
|
||||||
color: Theme.of(context).accentTextTheme.body2.color,
|
color: Theme.of(context)
|
||||||
textColor: Colors.white
|
.accentTextTheme
|
||||||
)
|
.subtitle
|
||||||
/*Observer(
|
.backgroundColor,
|
||||||
|
),
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final item = widget.exchangeTradeViewModel.items[index];
|
||||||
|
String value;
|
||||||
|
|
||||||
|
final content = Observer(builder: (_) {
|
||||||
|
switch (index) {
|
||||||
|
case 0:
|
||||||
|
value =
|
||||||
|
'${widget.exchangeTradeViewModel.trade.id ?? fetchingLabel}';
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
value =
|
||||||
|
'${widget.exchangeTradeViewModel.trade.amount ?? fetchingLabel}';
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
value =
|
||||||
|
'${widget.exchangeTradeViewModel.trade.state ?? fetchingLabel}';
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
value = widget.exchangeTradeViewModel.trade
|
||||||
|
.inputAddress ??
|
||||||
|
fetchingLabel;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return StandartListRow(
|
||||||
|
title: item.title,
|
||||||
|
value: value,
|
||||||
|
valueFontSize: 14,
|
||||||
|
image: item.isCopied ? copyImage : null,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
return item.isCopied
|
||||||
|
? Builder(
|
||||||
|
builder: (context) => GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
Clipboard.setData(
|
||||||
|
ClipboardData(text: value));
|
||||||
|
showBar<void>(context,
|
||||||
|
S.of(context).copied_to_clipboard);
|
||||||
|
},
|
||||||
|
child: content,
|
||||||
|
))
|
||||||
|
: content;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
bottomSectionPadding: EdgeInsets.fromLTRB(24, 0, 24, 24),
|
||||||
|
bottomSection: PrimaryButton(
|
||||||
|
onPressed: () {},
|
||||||
|
text: S.of(context).confirm,
|
||||||
|
color: Theme.of(context).accentTextTheme.body2.color,
|
||||||
|
textColor: Colors.white)
|
||||||
|
/*Observer(
|
||||||
builder: (_) => tradeStore.trade.from == CryptoCurrency.xmr &&
|
builder: (_) => tradeStore.trade.from == CryptoCurrency.xmr &&
|
||||||
!(sendStore.state is TransactionCommitted)
|
!(sendStore.state is TransactionCommitted)
|
||||||
? LoadingPrimaryButton(
|
? LoadingPrimaryButton(
|
||||||
|
@ -242,7 +250,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
|
||||||
color: Colors.blue,
|
color: Colors.blue,
|
||||||
textColor: Colors.white)
|
textColor: Colors.white)
|
||||||
: Offstage()),*/
|
: Offstage()),*/
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,114 +0,0 @@
|
||||||
// import 'package:cake_wallet/src/stores/auth/auth_state.dart';
|
|
||||||
// import 'package:cake_wallet/src/stores/login/login_store.dart';
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:flutter/cupertino.dart';
|
|
||||||
// import 'package:mobx/mobx.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:cake_wallet/src/screens/pin_code/pin_code.dart';
|
|
||||||
// import 'package:cake_wallet/src/screens/base_page.dart';
|
|
||||||
|
|
||||||
// class LoginPage extends BasePage {
|
|
||||||
// @override
|
|
||||||
// Widget leading(BuildContext context) => Container();
|
|
||||||
|
|
||||||
// @override
|
|
||||||
// Widget body(BuildContext context) => _LoginPinCode();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// class _LoginPinCode extends PinCode {
|
|
||||||
// _LoginPinCode([Key key]) : super((_, __) => null, false, key);
|
|
||||||
|
|
||||||
// @override
|
|
||||||
// _LoginPinCodeState createState() => _LoginPinCodeState();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// class _LoginPinCodeState extends PinCodeState<_LoginPinCode> {
|
|
||||||
// LoginStore _loginStore;
|
|
||||||
// String title = 'Enter your PIN';
|
|
||||||
|
|
||||||
// @override
|
|
||||||
// Future onPinCodeEntered(PinCodeState state) async {
|
|
||||||
// final password = pin.fold("", (ac, val) => ac + '$val');
|
|
||||||
|
|
||||||
// await _loginStore.authStore.auth(password: password);
|
|
||||||
// super.onPinCodeEntered(state);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// _setLoginStore(store: Provider.of<LoginStore>(context));
|
|
||||||
// return body(context);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// void _setLoginStore({LoginStore store}) {
|
|
||||||
// if (_loginStore != null) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// _loginStore = store;
|
|
||||||
|
|
||||||
// reaction((_) => _loginStore.authStore.state, (state) {
|
|
||||||
// if (state is AuthenticationFailure) {
|
|
||||||
// WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
||||||
// clear();
|
|
||||||
// Scaffold.of(context).showSnackBar(
|
|
||||||
// SnackBar(
|
|
||||||
// content: Text(state.error),
|
|
||||||
// backgroundColor: Colors.red,
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (state is AuthenticationBanned) {
|
|
||||||
// WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
||||||
// clear();
|
|
||||||
// Scaffold.of(context).showSnackBar(
|
|
||||||
// SnackBar(
|
|
||||||
// content: Text(state.error),
|
|
||||||
// backgroundColor: Colors.red,
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (state is AuthenticationInProgress) {
|
|
||||||
// WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
||||||
// Scaffold.of(context).hideCurrentSnackBar();
|
|
||||||
// Scaffold.of(context).showSnackBar(
|
|
||||||
// SnackBar(
|
|
||||||
// content: Text('Authentication'),
|
|
||||||
// backgroundColor: Colors.green,
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
// reaction((_) => _loginStore.state, (state) {
|
|
||||||
// if (state is LoadedCurrentWalletFailure) {
|
|
||||||
// WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
||||||
// clear();
|
|
||||||
// Scaffold.of(context).showSnackBar(
|
|
||||||
// SnackBar(
|
|
||||||
// content: Text(state.errorMessage),
|
|
||||||
// backgroundColor: Colors.red,
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (state is LoadingCurrentWallet) {
|
|
||||||
// WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
||||||
// Scaffold.of(context).hideCurrentSnackBar();
|
|
||||||
// Scaffold.of(context).showSnackBar(
|
|
||||||
// SnackBar(
|
|
||||||
// content: Text('Loading your wallet'),
|
|
||||||
// backgroundColor: Colors.green,
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// }
|
|
|
@ -95,7 +95,7 @@ class ReceivePage extends BasePage {
|
||||||
context: context,
|
context: context,
|
||||||
builder: (_) =>
|
builder: (_) =>
|
||||||
getIt.get<MoneroAccountListPage>()),
|
getIt.get<MoneroAccountListPage>()),
|
||||||
title: addressListViewModel.accountLabel,
|
title: S.of(context).accounts,
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.arrow_forward_ios,
|
Icons.arrow_forward_ios,
|
||||||
size: 14,
|
size: 14,
|
||||||
|
@ -136,7 +136,7 @@ class ReceivePage extends BasePage {
|
||||||
isCurrent: isCurrent,
|
isCurrent: isCurrent,
|
||||||
backgroundColor: backgroundColor,
|
backgroundColor: backgroundColor,
|
||||||
textColor: textColor,
|
textColor: textColor,
|
||||||
onTap: (_) => addressListViewModel.address = item,
|
onTap: (_) => addressListViewModel.setAddress(item),
|
||||||
onEdit: () => Navigator.of(context).pushNamed(
|
onEdit: () => Navigator.of(context).pushNamed(
|
||||||
Routes.newSubaddress,
|
Routes.newSubaddress,
|
||||||
arguments: item));
|
arguments: item));
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import 'package:cake_wallet/utils/show_bar.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
@ -9,13 +10,12 @@ import 'package:cake_wallet/core/amount_validator.dart';
|
||||||
import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_view_model.dart';
|
import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_view_model.dart';
|
||||||
|
|
||||||
class QRWidget extends StatelessWidget {
|
class QRWidget extends StatelessWidget {
|
||||||
QRWidget({
|
QRWidget(
|
||||||
@required this.addressListViewModel,
|
{@required this.addressListViewModel, this.isAmountFieldShow = false})
|
||||||
this.isAmountFieldShow = false
|
: amountController = TextEditingController(),
|
||||||
}) : amountController = TextEditingController(),
|
_formKey = GlobalKey<FormState>() {
|
||||||
_formKey = GlobalKey<FormState>() {
|
|
||||||
amountController.addListener(() => addressListViewModel.amount =
|
amountController.addListener(() => addressListViewModel.amount =
|
||||||
_formKey.currentState.validate() ? amountController.text : '');
|
_formKey.currentState.validate() ? amountController.text : '');
|
||||||
}
|
}
|
||||||
|
|
||||||
final WalletAddressListViewModel addressListViewModel;
|
final WalletAddressListViewModel addressListViewModel;
|
||||||
|
@ -26,7 +26,7 @@ class QRWidget extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final copyImage = Image.asset('assets/images/copy_address.png',
|
final copyImage = Image.asset('assets/images/copy_address.png',
|
||||||
color: Theme.of(context).textTheme.subhead.decorationColor);
|
color: Theme.of(context).textTheme.subhead.decorationColor);
|
||||||
final addressTopOffset = isAmountFieldShow ? 60.0 : 40.0;
|
final addressTopOffset = isAmountFieldShow ? 60.0 : 40.0;
|
||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
|
@ -36,16 +36,17 @@ class QRWidget extends StatelessWidget {
|
||||||
Row(children: <Widget>[
|
Row(children: <Widget>[
|
||||||
Spacer(flex: 3),
|
Spacer(flex: 3),
|
||||||
Observer(
|
Observer(
|
||||||
builder: (_) => Flexible(
|
builder: (_) => Flexible(
|
||||||
flex: 5,
|
flex: 5,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: AspectRatio(
|
child: AspectRatio(
|
||||||
aspectRatio: 1.0,
|
aspectRatio: 1.0,
|
||||||
child: QrImage(
|
child: QrImage(
|
||||||
data: addressListViewModel.uri.toString(),
|
data: addressListViewModel.uri.toString(),
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
foregroundColor: Theme.of(context).textTheme.headline.color,
|
foregroundColor:
|
||||||
))))),
|
Theme.of(context).textTheme.headline.color,
|
||||||
|
))))),
|
||||||
Spacer(flex: 3)
|
Spacer(flex: 3)
|
||||||
]),
|
]),
|
||||||
Padding(
|
Padding(
|
||||||
|
@ -53,85 +54,80 @@ class QRWidget extends StatelessWidget {
|
||||||
child: Text(
|
child: Text(
|
||||||
S.of(context).scan_qr_code,
|
S.of(context).scan_qr_code,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
color: Theme.of(context).indicatorColor
|
color: Theme.of(context).indicatorColor),
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
isAmountFieldShow
|
isAmountFieldShow
|
||||||
? Padding(
|
? Padding(
|
||||||
padding: EdgeInsets.only(top: 40),
|
padding: EdgeInsets.only(top: 40),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Form(
|
child: Form(
|
||||||
key: _formKey,
|
key: _formKey,
|
||||||
child: BaseTextFormField(
|
child: BaseTextFormField(
|
||||||
controller: amountController,
|
controller: amountController,
|
||||||
keyboardType:
|
keyboardType: TextInputType.numberWithOptions(
|
||||||
TextInputType.numberWithOptions(decimal: true),
|
decimal: true),
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
BlacklistingTextInputFormatter(
|
BlacklistingTextInputFormatter(
|
||||||
RegExp('[\\-|\\ |\\,]'))
|
RegExp('[\\-|\\ |\\,]'))
|
||||||
],
|
],
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
hintText: S.of(context).receive_amount,
|
hintText: S.of(context).receive_amount,
|
||||||
textColor: Colors.white,
|
textColor: Colors.white,
|
||||||
borderColor: Theme.of(context).textTheme.headline.decorationColor,
|
borderColor: Theme.of(context)
|
||||||
validator: AmountValidator(
|
.textTheme
|
||||||
type: addressListViewModel.type,
|
.headline
|
||||||
isAutovalidate: true
|
.decorationColor,
|
||||||
),
|
validator: AmountValidator(
|
||||||
autovalidate: true,
|
type: addressListViewModel.type,
|
||||||
placeholderTextStyle: TextStyle(
|
isAutovalidate: true),
|
||||||
color: Theme.of(context).hoverColor,
|
autovalidate: true,
|
||||||
fontSize: 18,
|
placeholderTextStyle: TextStyle(
|
||||||
fontWeight: FontWeight.w500))))
|
color: Theme.of(context).hoverColor,
|
||||||
],
|
fontSize: 18,
|
||||||
),
|
fontWeight: FontWeight.w500))))
|
||||||
)
|
],
|
||||||
: Offstage(),
|
),
|
||||||
|
)
|
||||||
|
: Offstage(),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(top: addressTopOffset),
|
padding: EdgeInsets.only(top: addressTopOffset),
|
||||||
child: Builder(
|
child: Builder(
|
||||||
builder: (context) => Observer(
|
builder: (context) => Observer(
|
||||||
builder: (context) => GestureDetector(
|
builder: (context) => GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Clipboard.setData(ClipboardData(
|
Clipboard.setData(ClipboardData(
|
||||||
text: addressListViewModel.address.address));
|
text: addressListViewModel.address.address));
|
||||||
Scaffold.of(context).showSnackBar(SnackBar(
|
showBar<void>(
|
||||||
content: Text(
|
context, S.of(context).copied_to_clipboard);
|
||||||
S.of(context).copied_to_clipboard,
|
},
|
||||||
style: TextStyle(color: Colors.white),
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
addressListViewModel.address.address,
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Colors.white),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(left: 12),
|
||||||
|
child: copyImage,
|
||||||
|
)
|
||||||
|
],
|
||||||
),
|
),
|
||||||
backgroundColor: Colors.green,
|
))),
|
||||||
duration: Duration(milliseconds: 500),
|
|
||||||
));
|
|
||||||
},
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: <Widget>[
|
|
||||||
Expanded(
|
|
||||||
child: Text(
|
|
||||||
addressListViewModel.address.address,
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
color: Colors.white),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.only(left: 12),
|
|
||||||
child: copyImage,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
))),
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ import 'package:cake_wallet/di.dart';
|
||||||
import 'package:cake_wallet/palette.dart';
|
import 'package:cake_wallet/palette.dart';
|
||||||
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
|
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
|
||||||
import 'package:cake_wallet/store/settings_store.dart';
|
import 'package:cake_wallet/store/settings_store.dart';
|
||||||
|
import 'package:cake_wallet/utils/show_bar.dart';
|
||||||
import 'package:cake_wallet/utils/show_pop_up.dart';
|
import 'package:cake_wallet/utils/show_pop_up.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
@ -28,16 +29,20 @@ class WalletSeedPage extends BasePage {
|
||||||
@override
|
@override
|
||||||
void onClose(BuildContext context) async {
|
void onClose(BuildContext context) async {
|
||||||
if (isNewWalletCreated) {
|
if (isNewWalletCreated) {
|
||||||
final confirmed = await showPopUp<bool>(context: context, builder: (BuildContext context) {
|
final confirmed = await showPopUp<bool>(
|
||||||
// FIXME: add translations
|
context: context,
|
||||||
return AlertWithTwoActions(
|
builder: (BuildContext context) {
|
||||||
alertTitle: 'Attention',
|
// FIXME: add translations
|
||||||
alertContent: 'The seed is the only way to recover your wallet. Have you written it down?',
|
return AlertWithTwoActions(
|
||||||
leftButtonText: 'Go back',
|
alertTitle: 'Attention',
|
||||||
rightButtonText: 'Yes, I have',
|
alertContent:
|
||||||
actionLeftButton: () => Navigator.of(context).pop(false),
|
'The seed is the only way to recover your wallet. Have you written it down?',
|
||||||
actionRightButton: () => Navigator.of(context).pop(true));
|
leftButtonText: 'Go back',
|
||||||
}) ?? false;
|
rightButtonText: 'Yes, I have',
|
||||||
|
actionLeftButton: () => Navigator.of(context).pop(false),
|
||||||
|
actionRightButton: () => Navigator.of(context).pop(true));
|
||||||
|
}) ??
|
||||||
|
false;
|
||||||
|
|
||||||
if (confirmed) {
|
if (confirmed) {
|
||||||
Navigator.of(context).popUntil((route) => route.isFirst);
|
Navigator.of(context).popUntil((route) => route.isFirst);
|
||||||
|
@ -57,39 +62,31 @@ class WalletSeedPage extends BasePage {
|
||||||
Widget trailing(BuildContext context) {
|
Widget trailing(BuildContext context) {
|
||||||
return isNewWalletCreated
|
return isNewWalletCreated
|
||||||
? GestureDetector(
|
? GestureDetector(
|
||||||
onTap: () => onClose(context),
|
onTap: () => onClose(context),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 100,
|
width: 100,
|
||||||
height: 32,
|
height: 32,
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
margin: EdgeInsets.only(left: 10),
|
margin: EdgeInsets.only(left: 10),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(16)),
|
borderRadius: BorderRadius.all(Radius.circular(16)),
|
||||||
color: Theme
|
color: Theme.of(context).accentTextTheme.caption.color),
|
||||||
.of(context)
|
child: Text(
|
||||||
.accentTextTheme
|
S.of(context).seed_language_next,
|
||||||
.caption
|
style: TextStyle(
|
||||||
.color),
|
fontSize: 14,
|
||||||
child: Text(
|
fontWeight: FontWeight.w600,
|
||||||
S
|
color: Palette.blueCraiola),
|
||||||
.of(context)
|
),
|
||||||
.seed_language_next,
|
),
|
||||||
style: TextStyle(
|
)
|
||||||
fontSize: 14,
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
color: Palette.blueCraiola),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: Offstage();
|
: Offstage();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget body(BuildContext context) {
|
Widget body(BuildContext context) {
|
||||||
final image =
|
final image =
|
||||||
getIt
|
getIt.get<SettingsStore>().isDarkTheme ? imageDark : imageLight;
|
||||||
.get<SettingsStore>()
|
|
||||||
.isDarkTheme ? imageDark : imageLight;
|
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
padding: EdgeInsets.all(24),
|
padding: EdgeInsets.all(24),
|
||||||
|
@ -116,23 +113,21 @@ class WalletSeedPage extends BasePage {
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: Theme
|
color: Theme.of(context)
|
||||||
.of(context)
|
|
||||||
.primaryTextTheme
|
.primaryTextTheme
|
||||||
.title
|
.title
|
||||||
.color),
|
.color),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding:
|
||||||
EdgeInsets.only(top: 20, left: 16, right: 16),
|
EdgeInsets.only(top: 20, left: 16, right: 16),
|
||||||
child: Text(
|
child: Text(
|
||||||
walletSeedViewModel.seed,
|
walletSeedViewModel.seed,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
fontWeight: FontWeight.normal,
|
fontWeight: FontWeight.normal,
|
||||||
color: Theme
|
color: Theme.of(context)
|
||||||
.of(context)
|
|
||||||
.primaryTextTheme
|
.primaryTextTheme
|
||||||
.caption
|
.caption
|
||||||
.color),
|
.color),
|
||||||
|
@ -146,78 +141,54 @@ class WalletSeedPage extends BasePage {
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
isNewWalletCreated
|
isNewWalletCreated
|
||||||
? Padding(
|
? Padding(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
bottom: 52, left: 43, right: 43),
|
bottom: 52, left: 43, right: 43),
|
||||||
child: Text(
|
child: Text(
|
||||||
S
|
S.of(context).seed_reminder,
|
||||||
.of(context)
|
textAlign: TextAlign.center,
|
||||||
.seed_reminder,
|
style: TextStyle(
|
||||||
textAlign: TextAlign.center,
|
fontSize: 12,
|
||||||
style: TextStyle(
|
fontWeight: FontWeight.normal,
|
||||||
fontSize: 12,
|
color: Theme.of(context)
|
||||||
fontWeight: FontWeight.normal,
|
.primaryTextTheme
|
||||||
color: Theme
|
.overline
|
||||||
.of(context)
|
.color),
|
||||||
.primaryTextTheme
|
),
|
||||||
.overline
|
)
|
||||||
.color),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: Offstage(),
|
: Offstage(),
|
||||||
Row(
|
Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Flexible(
|
Flexible(
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.only(right: 8.0),
|
padding: EdgeInsets.only(right: 8.0),
|
||||||
child: PrimaryButton(
|
child: PrimaryButton(
|
||||||
onPressed: () =>
|
onPressed: () => Share.text(
|
||||||
Share.text(
|
S.of(context).seed_share,
|
||||||
S
|
walletSeedViewModel.seed,
|
||||||
.of(context)
|
'text/plain'),
|
||||||
.seed_share,
|
text: S.of(context).save,
|
||||||
walletSeedViewModel.seed,
|
color: Colors.green,
|
||||||
'text/plain'),
|
textColor: Colors.white),
|
||||||
text: S
|
)),
|
||||||
.of(context)
|
|
||||||
.save,
|
|
||||||
color: Colors.green,
|
|
||||||
textColor: Colors.white),
|
|
||||||
)),
|
|
||||||
Flexible(
|
Flexible(
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.only(left: 8.0),
|
padding: EdgeInsets.only(left: 8.0),
|
||||||
child: Builder(
|
child: Builder(
|
||||||
builder: (context) =>
|
builder: (context) => PrimaryButton(
|
||||||
PrimaryButton(
|
onPressed: () {
|
||||||
onPressed: () {
|
Clipboard.setData(ClipboardData(
|
||||||
Clipboard.setData(ClipboardData(
|
text: walletSeedViewModel.seed));
|
||||||
text: walletSeedViewModel
|
showBar<void>(context,
|
||||||
.seed));
|
S.of(context).copied_to_clipboard);
|
||||||
Scaffold.of(context)
|
},
|
||||||
.showSnackBar(
|
text: S.of(context).copy,
|
||||||
SnackBar(
|
color: Theme.of(context)
|
||||||
content: Text(S
|
.accentTextTheme
|
||||||
.of(context)
|
.body2
|
||||||
.copied_to_clipboard),
|
.color,
|
||||||
backgroundColor: Colors
|
textColor: Colors.white)),
|
||||||
.green,
|
))
|
||||||
duration:
|
|
||||||
Duration(
|
|
||||||
milliseconds: 1500),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
text: S
|
|
||||||
.of(context)
|
|
||||||
.copy,
|
|
||||||
color: Theme
|
|
||||||
.of(context)
|
|
||||||
.accentTextTheme
|
|
||||||
.body2
|
|
||||||
.color,
|
|
||||||
textColor: Colors.white)),
|
|
||||||
))
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
import 'dart:ui';
|
import 'dart:ui';
|
||||||
|
import 'package:cake_wallet/entities/transaction_priority.dart';
|
||||||
import 'package:cake_wallet/src/widgets/keyboard_done_button.dart';
|
import 'package:cake_wallet/src/widgets/keyboard_done_button.dart';
|
||||||
|
import 'package:cake_wallet/src/widgets/picker.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
@ -691,19 +693,19 @@ class SendPage extends BasePage {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _setTransactionPriority(BuildContext context) async {
|
Future<void> _setTransactionPriority(BuildContext context) async {
|
||||||
// final items = TransactionPriority.all;
|
final items = TransactionPriority.all;
|
||||||
// final selectedItem = items.indexOf(sendViewModel.transactionPriority);
|
final selectedItem = items.indexOf(sendViewModel.transactionPriority);
|
||||||
//
|
|
||||||
// await showPopUp<void>(
|
await showPopUp<void>(
|
||||||
// builder: (_) => Picker(
|
builder: (_) => Picker(
|
||||||
// items: items,
|
items: items,
|
||||||
// selectedAtIndex: selectedItem,
|
selectedAtIndex: selectedItem,
|
||||||
// title: S.of(context).please_select,
|
title: S.of(context).please_select,
|
||||||
// mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
// onItemSelected: (TransactionPriority priority) => null,
|
onItemSelected: (TransactionPriority priority) =>
|
||||||
// // sendViewModel.setTransactionPriority(priority),
|
sendViewModel.setTransactionPriority(priority),
|
||||||
// isAlwaysShowScrollThumb: true,
|
isAlwaysShowScrollThumb: true,
|
||||||
// ),
|
),
|
||||||
// context: context);
|
context: context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import 'package:cake_wallet/utils/show_bar.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
@ -68,14 +69,7 @@ class TradeDetailsPage extends BasePage {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Clipboard.setData(ClipboardData(text: '${item.value}'));
|
Clipboard.setData(ClipboardData(text: '${item.value}'));
|
||||||
Scaffold.of(context).showSnackBar(
|
showBar<void>(context, S.of(context).copied_to_clipboard);
|
||||||
SnackBar(
|
|
||||||
content:
|
|
||||||
Text(S.of(context).trade_details_copied(item.title)),
|
|
||||||
backgroundColor: Colors.green,
|
|
||||||
duration: Duration(milliseconds: 1500),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
child: StandartListRow(
|
child: StandartListRow(
|
||||||
title: '${item.title}',
|
title: '${item.title}',
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import 'package:cake_wallet/utils/show_bar.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:cake_wallet/generated/i18n.dart';
|
import 'package:cake_wallet/generated/i18n.dart';
|
||||||
|
@ -92,14 +93,8 @@ class TransactionDetailsPage extends BasePage {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Clipboard.setData(ClipboardData(text: item.value));
|
Clipboard.setData(ClipboardData(text: item.value));
|
||||||
Scaffold.of(context).showSnackBar(
|
showBar<void>(context,
|
||||||
SnackBar(
|
S.of(context).transaction_details_copied(item.title));
|
||||||
content: Text(
|
|
||||||
S.of(context).transaction_details_copied(item.title)),
|
|
||||||
backgroundColor: Colors.green,
|
|
||||||
duration: Duration(milliseconds: 1500),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
child: StandartListRow(
|
child: StandartListRow(
|
||||||
title: '${item.title}:',
|
title: '${item.title}:',
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'package:cake_wallet/utils/show_bar.dart';
|
||||||
|
import 'package:flushbar/flushbar.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
@ -41,15 +43,8 @@ class WalletKeysPage extends BasePage {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Clipboard.setData(ClipboardData(text: item.value));
|
Clipboard.setData(ClipboardData(text: item.value));
|
||||||
Scaffold.of(context).showSnackBar(SnackBar(
|
showBar<void>(context,
|
||||||
content: Text(
|
S.of(context).copied_key_to_clipboard(item.title));
|
||||||
S.of(context).copied_key_to_clipboard(item.title),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(color: Colors.white),
|
|
||||||
),
|
|
||||||
backgroundColor: Colors.green,
|
|
||||||
duration: Duration(seconds: 1),
|
|
||||||
));
|
|
||||||
},
|
},
|
||||||
child: StandartListRow(
|
child: StandartListRow(
|
||||||
title: item.title + ':',
|
title: item.title + ':',
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
|
import 'package:cake_wallet/src/screens/auth/auth_page.dart';
|
||||||
import 'package:cake_wallet/src/screens/wallet_list/widgets/wallet_menu_alert.dart';
|
import 'package:cake_wallet/src/screens/wallet_list/widgets/wallet_menu_alert.dart';
|
||||||
|
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
|
||||||
import 'package:cake_wallet/utils/show_pop_up.dart';
|
import 'package:cake_wallet/utils/show_pop_up.dart';
|
||||||
|
import 'package:cake_wallet/view_model/wallet_list/wallet_list_item.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter_mobx/flutter_mobx.dart';
|
import 'package:flutter_mobx/flutter_mobx.dart';
|
||||||
|
@ -11,6 +14,7 @@ import 'package:cake_wallet/src/widgets/primary_button.dart';
|
||||||
import 'package:cake_wallet/src/screens/base_page.dart';
|
import 'package:cake_wallet/src/screens/base_page.dart';
|
||||||
import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
|
import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
|
||||||
import 'package:cake_wallet/src/screens/wallet_list/wallet_menu.dart';
|
import 'package:cake_wallet/src/screens/wallet_list/wallet_menu.dart';
|
||||||
|
import 'package:flutter_slidable/flutter_slidable.dart';
|
||||||
|
|
||||||
class WalletListPage extends BasePage {
|
class WalletListPage extends BasePage {
|
||||||
WalletListPage({this.walletListViewModel});
|
WalletListPage({this.walletListViewModel});
|
||||||
|
@ -65,48 +69,61 @@ class WalletListBodyState extends State<WalletListBody> {
|
||||||
itemCount: widget.walletListViewModel.wallets.length,
|
itemCount: widget.walletListViewModel.wallets.length,
|
||||||
itemBuilder: (__, index) {
|
itemBuilder: (__, index) {
|
||||||
final wallet = widget.walletListViewModel.wallets[index];
|
final wallet = widget.walletListViewModel.wallets[index];
|
||||||
final walletMenu = WalletMenu(context, widget.walletListViewModel);
|
|
||||||
final items =
|
|
||||||
walletMenu.generateItemsForWalletMenu(wallet.isCurrent);
|
|
||||||
final currentColor = wallet.isCurrent
|
final currentColor = wallet.isCurrent
|
||||||
? Theme.of(context).accentTextTheme.subtitle.decorationColor
|
? Theme.of(context)
|
||||||
|
.accentTextTheme
|
||||||
|
.subtitle
|
||||||
|
.decorationColor
|
||||||
: Theme.of(context).backgroundColor;
|
: Theme.of(context).backgroundColor;
|
||||||
|
final row = GestureDetector(
|
||||||
|
onTap: () async {
|
||||||
|
if (wallet.isCurrent) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
return GestureDetector(
|
final confirmed = await showPopUp<bool>(
|
||||||
onTap: () {
|
context: context,
|
||||||
showPopUp<void>(
|
builder: (dialogContext) {
|
||||||
context: context,
|
// FIXME:
|
||||||
builder: (dialogContext) {
|
return AlertWithTwoActions(
|
||||||
return WalletMenuAlert(
|
alertTitle: 'Change current wallet',
|
||||||
wallet: wallet,
|
alertContent:
|
||||||
walletMenu: walletMenu,
|
'Do you want to change current wallet to ${wallet.name} ?',
|
||||||
items: items);
|
leftButtonText: S.of(context).cancel,
|
||||||
}
|
rightButtonText: S.of(context).change,
|
||||||
);
|
actionLeftButton: () =>
|
||||||
},
|
Navigator.of(context).pop(false),
|
||||||
child: Container(
|
actionRightButton: () =>
|
||||||
height: tileHeight,
|
Navigator.of(context).pop(true));
|
||||||
width: double.infinity,
|
}) ?? false;
|
||||||
child: Row(
|
|
||||||
children: <Widget>[
|
if (confirmed) {
|
||||||
Container(
|
await _loadWallet(wallet);
|
||||||
height: tileHeight,
|
}
|
||||||
width: 4,
|
},
|
||||||
decoration: BoxDecoration(
|
child: Container(
|
||||||
borderRadius: BorderRadius.only(
|
height: tileHeight,
|
||||||
topRight: Radius.circular(4),
|
width: double.infinity,
|
||||||
bottomRight: Radius.circular(4)),
|
child: Row(
|
||||||
color: currentColor
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
height: tileHeight,
|
||||||
|
width: 4,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
topRight: Radius.circular(4),
|
||||||
|
bottomRight: Radius.circular(4)),
|
||||||
|
color: currentColor),
|
||||||
),
|
),
|
||||||
),
|
Expanded(
|
||||||
Expanded(
|
|
||||||
child: Container(
|
child: Container(
|
||||||
height: tileHeight,
|
height: tileHeight,
|
||||||
padding: EdgeInsets.only(left: 20, right: 20),
|
padding: EdgeInsets.only(left: 20, right: 20),
|
||||||
color: Theme.of(context).backgroundColor,
|
color: Theme.of(context).backgroundColor,
|
||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
child: Row(
|
child: Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.center,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
_imageFor(type: wallet.type),
|
_imageFor(type: wallet.type),
|
||||||
SizedBox(width: 10),
|
SizedBox(width: 10),
|
||||||
|
@ -115,17 +132,33 @@ class WalletListBodyState extends State<WalletListBody> {
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 22,
|
fontSize: 22,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: Theme.of(context).primaryTextTheme.title.color
|
color: Theme.of(context)
|
||||||
),
|
.primaryTextTheme
|
||||||
|
.title
|
||||||
|
.color),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)
|
));
|
||||||
);
|
|
||||||
|
return wallet.isCurrent
|
||||||
|
? row
|
||||||
|
: Slidable(
|
||||||
|
key: Key('${wallet.key}'),
|
||||||
|
actionPane: SlidableDrawerActionPane(),
|
||||||
|
child: row,
|
||||||
|
secondaryActions: <Widget>[
|
||||||
|
IconSlideAction(
|
||||||
|
caption: S.of(context).delete,
|
||||||
|
color: Colors.red,
|
||||||
|
icon: CupertinoIcons.delete,
|
||||||
|
onTap: () async => _removeWallet(wallet),
|
||||||
|
)
|
||||||
|
]);
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -136,12 +169,13 @@ class WalletListBodyState extends State<WalletListBody> {
|
||||||
image: newWalletImage,
|
image: newWalletImage,
|
||||||
text: S.of(context).wallet_list_create_new_wallet,
|
text: S.of(context).wallet_list_create_new_wallet,
|
||||||
color: Theme.of(context).accentTextTheme.subtitle.decorationColor,
|
color: Theme.of(context).accentTextTheme.subtitle.decorationColor,
|
||||||
textColor: Theme.of(context).accentTextTheme.headline.decorationColor,
|
textColor:
|
||||||
|
Theme.of(context).accentTextTheme.headline.decorationColor,
|
||||||
),
|
),
|
||||||
SizedBox(height: 10.0),
|
SizedBox(height: 10.0),
|
||||||
PrimaryImageButton(
|
PrimaryImageButton(
|
||||||
onPressed: () => Navigator.of(context)
|
onPressed: () =>
|
||||||
.pushNamed(Routes.restoreWalletType),
|
Navigator.of(context).pushNamed(Routes.restoreWalletType),
|
||||||
image: restoreWalletImage,
|
image: restoreWalletImage,
|
||||||
text: S.of(context).wallet_list_restore_wallet,
|
text: S.of(context).wallet_list_restore_wallet,
|
||||||
color: Theme.of(context).accentTextTheme.caption.color,
|
color: Theme.of(context).accentTextTheme.caption.color,
|
||||||
|
@ -160,4 +194,47 @@ class WalletListBodyState extends State<WalletListBody> {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> _loadWallet(WalletListItem wallet) async {
|
||||||
|
await Navigator.of(context).pushNamed(Routes.auth, arguments:
|
||||||
|
(bool isAuthenticatedSuccessfully, AuthPageState auth) async {
|
||||||
|
if (!isAuthenticatedSuccessfully) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
auth.changeProcessText(
|
||||||
|
S.of(context).wallet_list_loading_wallet(wallet.name));
|
||||||
|
await widget.walletListViewModel.loadWallet(wallet);
|
||||||
|
auth.hideProgressText();
|
||||||
|
auth.close();
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
} catch (e) {
|
||||||
|
auth.changeProcessText(S
|
||||||
|
.of(context)
|
||||||
|
.wallet_list_failed_to_load(wallet.name, e.toString()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _removeWallet(WalletListItem wallet) async {
|
||||||
|
await Navigator.of(context).pushNamed(Routes.auth, arguments:
|
||||||
|
(bool isAuthenticatedSuccessfully, AuthPageState auth) async {
|
||||||
|
if (!isAuthenticatedSuccessfully) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
auth.changeProcessText(
|
||||||
|
S.of(context).wallet_list_removing_wallet(wallet.name));
|
||||||
|
await widget.walletListViewModel.remove(wallet);
|
||||||
|
} catch (e) {
|
||||||
|
auth.changeProcessText(S
|
||||||
|
.of(context)
|
||||||
|
.wallet_list_failed_to_remove(wallet.name, e.toString()));
|
||||||
|
}
|
||||||
|
|
||||||
|
auth.close();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ import 'package:flutter/services.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:cake_wallet/routes.dart';
|
import 'package:cake_wallet/routes.dart';
|
||||||
import 'package:cake_wallet/generated/i18n.dart';
|
import 'package:cake_wallet/generated/i18n.dart';
|
||||||
import 'package:cake_wallet/entities/contact.dart';
|
import 'package:cake_wallet/entities/contact_record.dart';
|
||||||
import 'package:cake_wallet/entities/qr_scanner.dart';
|
import 'package:cake_wallet/entities/qr_scanner.dart';
|
||||||
|
|
||||||
enum AddressTextFieldOption { paste, qrCode, addressBook }
|
enum AddressTextFieldOption { paste, qrCode, addressBook }
|
||||||
|
@ -212,7 +212,7 @@ class AddressTextField extends StatelessWidget {
|
||||||
final contact = await Navigator.of(context, rootNavigator: true)
|
final contact = await Navigator.of(context, rootNavigator: true)
|
||||||
.pushNamed(Routes.pickerAddressBook);
|
.pushNamed(Routes.pickerAddressBook);
|
||||||
|
|
||||||
if (contact is Contact && contact.address != null) {
|
if (contact is ContactRecord && contact.address != null) {
|
||||||
controller.text = contact.address;
|
controller.text = contact.address;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,10 +124,16 @@ extension HiveBindable<T extends Keyable> on ObservableList<T> {
|
||||||
listen().listen((event) => dest.acceptEntityChange(event));
|
listen().listen((event) => dest.acceptEntityChange(event));
|
||||||
|
|
||||||
void acceptBoxChange(BoxEvent event, {T transformed}) {
|
void acceptBoxChange(BoxEvent event, {T transformed}) {
|
||||||
|
print('---------------------');
|
||||||
|
print('event.key: ${event.key}; event.deleted: ${event.deleted};');
|
||||||
if (event.deleted) {
|
if (event.deleted) {
|
||||||
removeWhere((el) => el.keyIndex == event.key);
|
removeWhere((el) {
|
||||||
|
print('el.keyIndex ${el.keyIndex}');
|
||||||
|
return el.keyIndex == event.key; });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print('---------------------');
|
||||||
|
|
||||||
final dynamic value = transformed ?? event.value;
|
final dynamic value = transformed ?? event.value;
|
||||||
|
|
||||||
if (value is T) {
|
if (value is T) {
|
||||||
|
|
47
lib/utils/show_bar.dart
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
import 'package:flushbar/flushbar.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
Future<T> showBar<T>(BuildContext context, String text,
|
||||||
|
{bool isDark = false, Duration duration = const Duration(seconds: 1), bool isDismissible = true}) {
|
||||||
|
final bar = Flushbar<T>(
|
||||||
|
boxShadows: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Colors.black.withOpacity(0.09),
|
||||||
|
blurRadius: 8,
|
||||||
|
offset: Offset(0, 2))
|
||||||
|
],
|
||||||
|
backgroundColor: isDark ? Colors.black : Colors.white,
|
||||||
|
borderRadius: 35,
|
||||||
|
margin: EdgeInsets.all(50),
|
||||||
|
messageText: Text(text,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(color: isDark ? Colors.white : Colors.black)),
|
||||||
|
duration: duration,
|
||||||
|
isDismissible: isDismissible,
|
||||||
|
flushbarPosition: FlushbarPosition.TOP,
|
||||||
|
flushbarStyle: FlushbarStyle.FLOATING);
|
||||||
|
|
||||||
|
return bar.show(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
Flushbar<T> createBar<T>(String text,
|
||||||
|
{bool isDark = false, Duration duration = const Duration(seconds: 1), bool isDismissible = true}) {
|
||||||
|
return Flushbar<T>(
|
||||||
|
boxShadows: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Colors.black.withOpacity(0.09),
|
||||||
|
blurRadius: 8,
|
||||||
|
offset: Offset(0, 2))
|
||||||
|
],
|
||||||
|
backgroundColor: isDark ? Colors.black : Colors.white,
|
||||||
|
borderRadius: 35,
|
||||||
|
margin: EdgeInsets.all(50),
|
||||||
|
messageText: Text(text,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(color: isDark ? Colors.white : Colors.black)),
|
||||||
|
duration: duration,
|
||||||
|
isDismissible: isDismissible,
|
||||||
|
flushbarPosition: FlushbarPosition.TOP,
|
||||||
|
flushbarStyle: FlushbarStyle.FLOATING);
|
||||||
|
}
|
|
@ -50,14 +50,15 @@ abstract class SendViewModelBase with Store {
|
||||||
@observable
|
@observable
|
||||||
bool sendAll;
|
bool sendAll;
|
||||||
|
|
||||||
|
@computed
|
||||||
|
double get estimatedFee =>
|
||||||
|
_wallet.calculateEstimatedFee(_settingsStore.transactionPriority);
|
||||||
|
|
||||||
FiatCurrency get fiat => _settingsStore.fiatCurrency;
|
FiatCurrency get fiat => _settingsStore.fiatCurrency;
|
||||||
|
|
||||||
TransactionPriority get transactionPriority =>
|
TransactionPriority get transactionPriority =>
|
||||||
_settingsStore.transactionPriority;
|
_settingsStore.transactionPriority;
|
||||||
|
|
||||||
double get estimatedFee =>
|
|
||||||
_wallet.calculateEstimatedFee(_settingsStore.transactionPriority);
|
|
||||||
|
|
||||||
CryptoCurrency get currency => _wallet.currency;
|
CryptoCurrency get currency => _wallet.currency;
|
||||||
|
|
||||||
Validator get amountValidator => AmountValidator(type: _wallet.type);
|
Validator get amountValidator => AmountValidator(type: _wallet.type);
|
||||||
|
@ -139,6 +140,10 @@ abstract class SendViewModelBase with Store {
|
||||||
_updateCryptoAmount();
|
_updateCryptoAmount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@action
|
||||||
|
void setTransactionPriority(TransactionPriority priority) =>
|
||||||
|
_settingsStore.transactionPriority = priority;
|
||||||
|
|
||||||
@action
|
@action
|
||||||
void _updateFiatAmount() {
|
void _updateFiatAmount() {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -109,9 +109,6 @@ abstract class WalletAddressListViewModelBase with Store {
|
||||||
return addressList;
|
return addressList;
|
||||||
}
|
}
|
||||||
|
|
||||||
set address(WalletAddressListItem address) => null;
|
|
||||||
// _wallet.address = address.address;
|
|
||||||
|
|
||||||
bool hasAccounts;
|
bool hasAccounts;
|
||||||
|
|
||||||
WalletBase _wallet;
|
WalletBase _wallet;
|
||||||
|
@ -129,6 +126,10 @@ abstract class WalletAddressListViewModelBase with Store {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@action
|
||||||
|
void setAddress(WalletAddressListItem address) =>
|
||||||
|
_wallet.address = address.address;
|
||||||
|
|
||||||
void _init() {
|
void _init() {
|
||||||
_baseItems = [];
|
_baseItems = [];
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@ abstract class WalletListViewModelBase with Store {
|
||||||
await _keyService.getWalletPassword(walletName: wallet.name);
|
await _keyService.getWalletPassword(walletName: wallet.name);
|
||||||
final walletService = getIt.get<WalletService>(param1: wallet.type);
|
final walletService = getIt.get<WalletService>(param1: wallet.type);
|
||||||
_appStore.wallet = await walletService.openWallet(wallet.name, password);
|
_appStore.wallet = await walletService.openWallet(wallet.name, password);
|
||||||
|
_updateList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
|
|
|
@ -358,6 +358,13 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.10.11"
|
version: "0.10.11"
|
||||||
|
flushbar:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flushbar
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.10.4"
|
||||||
flutter:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
|
|
|
@ -65,6 +65,7 @@ dependencies:
|
||||||
get_it: ^4.0.2
|
get_it: ^4.0.2
|
||||||
connectivity: ^0.4.9+2
|
connectivity: ^0.4.9+2
|
||||||
keyboard_actions: ^3.3.0
|
keyboard_actions: ^3.3.0
|
||||||
|
flushbar: ^1.10.4
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|