mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-10 20:54:33 +00:00
Merge remote-tracking branch 'origin/staging' into arti
This commit is contained in:
commit
6cee28c5e5
5 changed files with 113 additions and 75 deletions
|
@ -16,7 +16,6 @@ import 'package:cw_core/node.dart';
|
||||||
import 'package:cw_core/unspent_coins_info.dart';
|
import 'package:cw_core/unspent_coins_info.dart';
|
||||||
import 'package:cw_core/wallet_info.dart';
|
import 'package:cw_core/wallet_info.dart';
|
||||||
import 'package:cw_core/wallet_type.dart';
|
import 'package:cw_core/wallet_type.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_libmonero/monero/monero.dart';
|
import 'package:flutter_libmonero/monero/monero.dart';
|
||||||
|
@ -98,7 +97,7 @@ void main() async {
|
||||||
setWindowMaxSize(Size.infinite);
|
setWindowMaxSize(Size.infinite);
|
||||||
|
|
||||||
final screenHeight = screen?.frame.height;
|
final screenHeight = screen?.frame.height;
|
||||||
if (screenHeight != null && !kDebugMode) {
|
if (screenHeight != null) {
|
||||||
// starting to height be 3/4 screen height or 900, whichever is smaller
|
// starting to height be 3/4 screen height or 900, whichever is smaller
|
||||||
final height = min<double>(screenHeight * 0.75, 900);
|
final height = min<double>(screenHeight * 0.75, 900);
|
||||||
setWindowFrame(
|
setWindowFrame(
|
||||||
|
|
|
@ -8,7 +8,10 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:isar/isar.dart';
|
import 'package:isar/isar.dart';
|
||||||
import 'package:stackwallet/models/isar/exchange_cache/currency.dart';
|
import 'package:stackwallet/models/isar/exchange_cache/currency.dart';
|
||||||
|
@ -16,6 +19,7 @@ import 'package:stackwallet/models/isar/models/ethereum/eth_contract.dart';
|
||||||
import 'package:stackwallet/services/exchange/change_now/change_now_exchange.dart';
|
import 'package:stackwallet/services/exchange/change_now/change_now_exchange.dart';
|
||||||
import 'package:stackwallet/services/exchange/exchange_data_loading_service.dart';
|
import 'package:stackwallet/services/exchange/exchange_data_loading_service.dart';
|
||||||
import 'package:stackwallet/themes/stack_colors.dart';
|
import 'package:stackwallet/themes/stack_colors.dart';
|
||||||
|
import 'package:stackwallet/themes/theme_providers.dart';
|
||||||
import 'package:stackwallet/utilities/assets.dart';
|
import 'package:stackwallet/utilities/assets.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/utilities/util.dart';
|
import 'package:stackwallet/utilities/util.dart';
|
||||||
|
@ -30,16 +34,17 @@ class AddTokenListElementData {
|
||||||
bool selected = false;
|
bool selected = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
class AddTokenListElement extends StatefulWidget {
|
class AddTokenListElement extends ConsumerStatefulWidget {
|
||||||
const AddTokenListElement({Key? key, required this.data}) : super(key: key);
|
const AddTokenListElement({Key? key, required this.data}) : super(key: key);
|
||||||
|
|
||||||
final AddTokenListElementData data;
|
final AddTokenListElementData data;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<AddTokenListElement> createState() => _AddTokenListElementState();
|
ConsumerState<AddTokenListElement> createState() =>
|
||||||
|
_AddTokenListElementState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _AddTokenListElementState extends State<AddTokenListElement> {
|
class _AddTokenListElementState extends ConsumerState<AddTokenListElement> {
|
||||||
final bool isDesktop = Util.isDesktop;
|
final bool isDesktop = Util.isDesktop;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -74,6 +79,17 @@ class _AddTokenListElementState extends State<AddTokenListElement> {
|
||||||
currency.image,
|
currency.image,
|
||||||
width: iconSize,
|
width: iconSize,
|
||||||
height: iconSize,
|
height: iconSize,
|
||||||
|
placeholderBuilder: (_) => SvgPicture.file(
|
||||||
|
File(
|
||||||
|
ref.watch(
|
||||||
|
themeAssetsProvider.select(
|
||||||
|
(value) => value.stackIcon,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
width: iconSize,
|
||||||
|
height: iconSize,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
: SvgPicture.asset(
|
: SvgPicture.asset(
|
||||||
widget.data.token.symbol == "BNB"
|
widget.data.token.symbol == "BNB"
|
||||||
|
|
|
@ -98,7 +98,7 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
|
||||||
|
|
||||||
final List<TextEditingController> _controllers = [];
|
final List<TextEditingController> _controllers = [];
|
||||||
final List<FormInputStatus> _inputStatuses = [];
|
final List<FormInputStatus> _inputStatuses = [];
|
||||||
final List<FocusNode> _focusNodes = [];
|
// final List<FocusNode> _focusNodes = [];
|
||||||
|
|
||||||
late final BarcodeScannerInterface scanner;
|
late final BarcodeScannerInterface scanner;
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
|
||||||
for (int i = 0; i < _seedWordCount; i++) {
|
for (int i = 0; i < _seedWordCount; i++) {
|
||||||
_controllers.add(TextEditingController());
|
_controllers.add(TextEditingController());
|
||||||
_inputStatuses.add(FormInputStatus.empty);
|
_inputStatuses.add(FormInputStatus.empty);
|
||||||
_focusNodes.add(FocusNode());
|
// _focusNodes.add(FocusNode());
|
||||||
}
|
}
|
||||||
|
|
||||||
super.initState();
|
super.initState();
|
||||||
|
@ -821,8 +821,8 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
|
||||||
i * 4 + j - 1 == 1
|
i * 4 + j - 1 == 1
|
||||||
? textSelectionControls
|
? textSelectionControls
|
||||||
: null,
|
: null,
|
||||||
focusNode:
|
// focusNode:
|
||||||
_focusNodes[i * 4 + j - 1],
|
// _focusNodes[i * 4 + j - 1],
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
final FormInputStatus
|
final FormInputStatus
|
||||||
formInputStatus;
|
formInputStatus;
|
||||||
|
@ -841,18 +841,18 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
|
||||||
FormInputStatus.invalid;
|
FormInputStatus.invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (formInputStatus ==
|
// if (formInputStatus ==
|
||||||
FormInputStatus.valid) {
|
// FormInputStatus.valid) {
|
||||||
if (i * 4 + j <
|
// if (i * 4 + j <
|
||||||
_focusNodes.length) {
|
// _focusNodes.length) {
|
||||||
_focusNodes[i * 4 + j]
|
// _focusNodes[i * 4 + j]
|
||||||
.requestFocus();
|
// .requestFocus();
|
||||||
} else if (i * 4 + j ==
|
// } else if (i * 4 + j ==
|
||||||
_focusNodes.length) {
|
// _focusNodes.length) {
|
||||||
_focusNodes[i * 4 + j - 1]
|
// _focusNodes[i * 4 + j - 1]
|
||||||
.unfocus();
|
// .unfocus();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
setState(() {
|
setState(() {
|
||||||
_inputStatuses[i * 4 +
|
_inputStatuses[i * 4 +
|
||||||
j -
|
j -
|
||||||
|
@ -929,7 +929,7 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
|
||||||
selectionControls: i == 1
|
selectionControls: i == 1
|
||||||
? textSelectionControls
|
? textSelectionControls
|
||||||
: null,
|
: null,
|
||||||
focusNode: _focusNodes[i],
|
// focusNode: _focusNodes[i],
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
final FormInputStatus
|
final FormInputStatus
|
||||||
formInputStatus;
|
formInputStatus;
|
||||||
|
@ -948,27 +948,27 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
|
||||||
FormInputStatus.invalid;
|
FormInputStatus.invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (formInputStatus ==
|
// if (formInputStatus ==
|
||||||
FormInputStatus
|
// FormInputStatus
|
||||||
.valid &&
|
// .valid &&
|
||||||
(i - 1) <
|
// (i - 1) <
|
||||||
_focusNodes.length) {
|
// _focusNodes.length) {
|
||||||
Focus.of(context)
|
// Focus.of(context)
|
||||||
.requestFocus(
|
// .requestFocus(
|
||||||
_focusNodes[i]);
|
// _focusNodes[i]);
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (formInputStatus ==
|
// if (formInputStatus ==
|
||||||
FormInputStatus.valid) {
|
// FormInputStatus.valid) {
|
||||||
if (i + 1 <
|
// if (i + 1 <
|
||||||
_focusNodes.length) {
|
// _focusNodes.length) {
|
||||||
_focusNodes[i + 1]
|
// _focusNodes[i + 1]
|
||||||
.requestFocus();
|
// .requestFocus();
|
||||||
} else if (i + 1 ==
|
// } else if (i + 1 ==
|
||||||
_focusNodes.length) {
|
// _focusNodes.length) {
|
||||||
_focusNodes[i].unfocus();
|
// _focusNodes[i].unfocus();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
},
|
},
|
||||||
controller: _controllers[i],
|
controller: _controllers[i],
|
||||||
style:
|
style:
|
||||||
|
@ -1068,7 +1068,7 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
|
||||||
AutovalidateMode.onUserInteraction,
|
AutovalidateMode.onUserInteraction,
|
||||||
selectionControls:
|
selectionControls:
|
||||||
i == 1 ? textSelectionControls : null,
|
i == 1 ? textSelectionControls : null,
|
||||||
focusNode: _focusNodes[i - 1],
|
// focusNode: _focusNodes[i - 1],
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
final FormInputStatus formInputStatus;
|
final FormInputStatus formInputStatus;
|
||||||
|
|
||||||
|
@ -1084,14 +1084,14 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
|
||||||
FormInputStatus.invalid;
|
FormInputStatus.invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (formInputStatus ==
|
// if (formInputStatus ==
|
||||||
FormInputStatus.valid) {
|
// FormInputStatus.valid) {
|
||||||
if (i < _focusNodes.length) {
|
// if (i < _focusNodes.length) {
|
||||||
_focusNodes[i].requestFocus();
|
// _focusNodes[i].requestFocus();
|
||||||
} else if (i == _focusNodes.length) {
|
// } else if (i == _focusNodes.length) {
|
||||||
_focusNodes[i - 1].unfocus();
|
// _focusNodes[i - 1].unfocus();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
setState(() {
|
setState(() {
|
||||||
_inputStatuses[i - 1] =
|
_inputStatuses[i - 1] =
|
||||||
formInputStatus;
|
formInputStatus;
|
||||||
|
|
59
pubspec.lock
59
pubspec.lock
|
@ -557,11 +557,12 @@ packages:
|
||||||
file_picker:
|
file_picker:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: file_picker
|
path: "."
|
||||||
sha256: b1729fc96627dd44012d0a901558177418818d6bd428df59dcfeb594e5f66432
|
ref: f0930d9fa79d347b2a0e25a7de4f5a4a88a9a907
|
||||||
url: "https://pub.dev"
|
resolved-ref: f0930d9fa79d347b2a0e25a7de4f5a4a88a9a907
|
||||||
source: hosted
|
url: "https://github.com/muttsu-623/flutter_file_picker.git"
|
||||||
version: "5.3.2"
|
source: git
|
||||||
|
version: "5.3.3"
|
||||||
fixnum:
|
fixnum:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -742,10 +743,10 @@ packages:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: flutter_svg
|
name: flutter_svg
|
||||||
sha256: "6ff9fa12892ae074092de2fa6a9938fb21dbabfdaa2ff57dc697ff912fc8d4b2"
|
sha256: "8c5d68a82add3ca76d792f058b186a0599414f279f00ece4830b9b231b570338"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.6"
|
version: "2.0.7"
|
||||||
flutter_test:
|
flutter_test:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description: flutter
|
description: flutter
|
||||||
|
@ -1141,14 +1142,6 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.8.3"
|
version: "1.8.3"
|
||||||
path_drawing:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: path_drawing
|
|
||||||
sha256: bbb1934c0cbb03091af082a6389ca2080345291ef07a5fa6d6e078ba8682f977
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.0.1"
|
|
||||||
path_parsing:
|
path_parsing:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -1209,18 +1202,18 @@ packages:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: permission_handler
|
name: permission_handler
|
||||||
sha256: "63e5216aae014a72fe9579ccd027323395ce7a98271d9defa9d57320d001af81"
|
sha256: ad65ba9af42a3d067203641de3fd9f547ded1410bad3b84400c2b4899faede70
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "10.4.3"
|
version: "11.0.0"
|
||||||
permission_handler_android:
|
permission_handler_android:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: permission_handler_android
|
name: permission_handler_android
|
||||||
sha256: "2ffaf52a21f64ac9b35fe7369bb9533edbd4f698e5604db8645b1064ff4cf221"
|
sha256: "6901d50f4d4b9a27e1749dbd4adbf06aa00d90a21a2db563405d5ce27ee120ac"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "10.3.3"
|
version: "11.0.0"
|
||||||
permission_handler_apple:
|
permission_handler_apple:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -1233,10 +1226,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: permission_handler_platform_interface
|
name: permission_handler_platform_interface
|
||||||
sha256: "7c6b1500385dd1d2ca61bb89e2488ca178e274a69144d26bbd65e33eae7c02a9"
|
sha256: f2343e9fa9c22ae4fd92d4732755bfe452214e7189afcc097380950cf567b4b2
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.11.3"
|
version: "3.11.5"
|
||||||
permission_handler_windows:
|
permission_handler_windows:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -1762,6 +1755,30 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.7"
|
version: "3.0.7"
|
||||||
|
vector_graphics:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: vector_graphics
|
||||||
|
sha256: "670f6e07aca990b4a2bcdc08a784193c4ccdd1932620244c3a86bb72a0eac67f"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.7"
|
||||||
|
vector_graphics_codec:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: vector_graphics_codec
|
||||||
|
sha256: "7451721781d967db9933b63f5733b1c4533022c0ba373a01bdd79d1a5457f69f"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.7"
|
||||||
|
vector_graphics_compiler:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: vector_graphics_compiler
|
||||||
|
sha256: "80a13c613c8bde758b1464a1755a7b3a8f2b6cec61fbf0f5a53c94c30f03ba2e"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.7"
|
||||||
vector_math:
|
vector_math:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
12
pubspec.yaml
12
pubspec.yaml
|
@ -63,7 +63,7 @@ dependencies:
|
||||||
# Utility plugins
|
# Utility plugins
|
||||||
http: ^0.13.0
|
http: ^0.13.0
|
||||||
local_auth: ^1.1.10
|
local_auth: ^1.1.10
|
||||||
permission_handler: ^10.0.0
|
permission_handler: ^11.0.0
|
||||||
flutter_local_notifications: ^9.4.0
|
flutter_local_notifications: ^9.4.0
|
||||||
rxdart: ^0.27.3
|
rxdart: ^0.27.3
|
||||||
zxcvbn: ^1.0.0
|
zxcvbn: ^1.0.0
|
||||||
|
@ -104,7 +104,7 @@ dependencies:
|
||||||
flutter_native_splash: ^2.2.4
|
flutter_native_splash: ^2.2.4
|
||||||
google_fonts: ^4.0.4
|
google_fonts: ^4.0.4
|
||||||
url_launcher: ^6.0.5
|
url_launcher: ^6.0.5
|
||||||
flutter_svg: ^1.0.1
|
flutter_svg: ^2.0.7
|
||||||
flutter_feather_icons: ^2.0.0+1
|
flutter_feather_icons: ^2.0.0+1
|
||||||
decimal: ^2.1.0
|
decimal: ^2.1.0
|
||||||
event_bus: ^2.0.0
|
event_bus: ^2.0.0
|
||||||
|
@ -126,7 +126,7 @@ dependencies:
|
||||||
pointycastle: ^3.6.0
|
pointycastle: ^3.6.0
|
||||||
package_info_plus: ^4.0.2
|
package_info_plus: ^4.0.2
|
||||||
lottie: ^2.3.2
|
lottie: ^2.3.2
|
||||||
file_picker: ^5.3.1
|
file_picker: ^5.5.0
|
||||||
connectivity_plus: ^4.0.1
|
connectivity_plus: ^4.0.1
|
||||||
isar: 3.0.5
|
isar: 3.0.5
|
||||||
isar_flutter_libs: 3.0.5 # contains the binaries
|
isar_flutter_libs: 3.0.5 # contains the binaries
|
||||||
|
@ -204,6 +204,12 @@ dependency_overrides:
|
||||||
url: https://github.com/cypherstack/stack-bip39.git
|
url: https://github.com/cypherstack/stack-bip39.git
|
||||||
ref: 0cd6d54e2860bea68fc50c801cb9db2a760192fb
|
ref: 0cd6d54e2860bea68fc50c801cb9db2a760192fb
|
||||||
|
|
||||||
|
|
||||||
|
file_picker:
|
||||||
|
git:
|
||||||
|
url: https://github.com/muttsu-623/flutter_file_picker.git
|
||||||
|
ref: f0930d9fa79d347b2a0e25a7de4f5a4a88a9a907
|
||||||
|
|
||||||
crypto: 3.0.2
|
crypto: 3.0.2
|
||||||
analyzer: ^5.2.0
|
analyzer: ^5.2.0
|
||||||
pinenacl: ^0.3.3
|
pinenacl: ^0.3.3
|
||||||
|
|
Loading…
Reference in a new issue