mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 17:57:40 +00:00
commit
610c267a25
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/wallet_info.dart';
|
||||
import 'package:cw_core/wallet_type.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_libmonero/monero/monero.dart';
|
||||
|
@ -97,7 +96,7 @@ void main() async {
|
|||
setWindowMaxSize(Size.infinite);
|
||||
|
||||
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
|
||||
final height = min<double>(screenHeight * 0.75, 900);
|
||||
setWindowFrame(
|
||||
|
|
|
@ -8,7 +8,10 @@
|
|||
*
|
||||
*/
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:isar/isar.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/exchange_data_loading_service.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/text_styles.dart';
|
||||
import 'package:stackwallet/utilities/util.dart';
|
||||
|
@ -30,16 +34,17 @@ class AddTokenListElementData {
|
|||
bool selected = false;
|
||||
}
|
||||
|
||||
class AddTokenListElement extends StatefulWidget {
|
||||
class AddTokenListElement extends ConsumerStatefulWidget {
|
||||
const AddTokenListElement({Key? key, required this.data}) : super(key: key);
|
||||
|
||||
final AddTokenListElementData data;
|
||||
|
||||
@override
|
||||
State<AddTokenListElement> createState() => _AddTokenListElementState();
|
||||
ConsumerState<AddTokenListElement> createState() =>
|
||||
_AddTokenListElementState();
|
||||
}
|
||||
|
||||
class _AddTokenListElementState extends State<AddTokenListElement> {
|
||||
class _AddTokenListElementState extends ConsumerState<AddTokenListElement> {
|
||||
final bool isDesktop = Util.isDesktop;
|
||||
|
||||
@override
|
||||
|
@ -74,6 +79,17 @@ class _AddTokenListElementState extends State<AddTokenListElement> {
|
|||
currency.image,
|
||||
width: iconSize,
|
||||
height: iconSize,
|
||||
placeholderBuilder: (_) => SvgPicture.file(
|
||||
File(
|
||||
ref.watch(
|
||||
themeAssetsProvider.select(
|
||||
(value) => value.stackIcon,
|
||||
),
|
||||
),
|
||||
),
|
||||
width: iconSize,
|
||||
height: iconSize,
|
||||
),
|
||||
)
|
||||
: SvgPicture.asset(
|
||||
widget.data.token.symbol == "BNB"
|
||||
|
|
|
@ -98,7 +98,7 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
|
|||
|
||||
final List<TextEditingController> _controllers = [];
|
||||
final List<FormInputStatus> _inputStatuses = [];
|
||||
final List<FocusNode> _focusNodes = [];
|
||||
// final List<FocusNode> _focusNodes = [];
|
||||
|
||||
late final BarcodeScannerInterface scanner;
|
||||
|
||||
|
@ -152,7 +152,7 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
|
|||
for (int i = 0; i < _seedWordCount; i++) {
|
||||
_controllers.add(TextEditingController());
|
||||
_inputStatuses.add(FormInputStatus.empty);
|
||||
_focusNodes.add(FocusNode());
|
||||
// _focusNodes.add(FocusNode());
|
||||
}
|
||||
|
||||
super.initState();
|
||||
|
@ -821,8 +821,8 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
|
|||
i * 4 + j - 1 == 1
|
||||
? textSelectionControls
|
||||
: null,
|
||||
focusNode:
|
||||
_focusNodes[i * 4 + j - 1],
|
||||
// focusNode:
|
||||
// _focusNodes[i * 4 + j - 1],
|
||||
onChanged: (value) {
|
||||
final FormInputStatus
|
||||
formInputStatus;
|
||||
|
@ -841,18 +841,18 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
|
|||
FormInputStatus.invalid;
|
||||
}
|
||||
|
||||
if (formInputStatus ==
|
||||
FormInputStatus.valid) {
|
||||
if (i * 4 + j <
|
||||
_focusNodes.length) {
|
||||
_focusNodes[i * 4 + j]
|
||||
.requestFocus();
|
||||
} else if (i * 4 + j ==
|
||||
_focusNodes.length) {
|
||||
_focusNodes[i * 4 + j - 1]
|
||||
.unfocus();
|
||||
}
|
||||
}
|
||||
// if (formInputStatus ==
|
||||
// FormInputStatus.valid) {
|
||||
// if (i * 4 + j <
|
||||
// _focusNodes.length) {
|
||||
// _focusNodes[i * 4 + j]
|
||||
// .requestFocus();
|
||||
// } else if (i * 4 + j ==
|
||||
// _focusNodes.length) {
|
||||
// _focusNodes[i * 4 + j - 1]
|
||||
// .unfocus();
|
||||
// }
|
||||
// }
|
||||
setState(() {
|
||||
_inputStatuses[i * 4 +
|
||||
j -
|
||||
|
@ -929,7 +929,7 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
|
|||
selectionControls: i == 1
|
||||
? textSelectionControls
|
||||
: null,
|
||||
focusNode: _focusNodes[i],
|
||||
// focusNode: _focusNodes[i],
|
||||
onChanged: (value) {
|
||||
final FormInputStatus
|
||||
formInputStatus;
|
||||
|
@ -948,27 +948,27 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
|
|||
FormInputStatus.invalid;
|
||||
}
|
||||
|
||||
if (formInputStatus ==
|
||||
FormInputStatus
|
||||
.valid &&
|
||||
(i - 1) <
|
||||
_focusNodes.length) {
|
||||
Focus.of(context)
|
||||
.requestFocus(
|
||||
_focusNodes[i]);
|
||||
}
|
||||
// if (formInputStatus ==
|
||||
// FormInputStatus
|
||||
// .valid &&
|
||||
// (i - 1) <
|
||||
// _focusNodes.length) {
|
||||
// Focus.of(context)
|
||||
// .requestFocus(
|
||||
// _focusNodes[i]);
|
||||
// }
|
||||
|
||||
if (formInputStatus ==
|
||||
FormInputStatus.valid) {
|
||||
if (i + 1 <
|
||||
_focusNodes.length) {
|
||||
_focusNodes[i + 1]
|
||||
.requestFocus();
|
||||
} else if (i + 1 ==
|
||||
_focusNodes.length) {
|
||||
_focusNodes[i].unfocus();
|
||||
}
|
||||
}
|
||||
// if (formInputStatus ==
|
||||
// FormInputStatus.valid) {
|
||||
// if (i + 1 <
|
||||
// _focusNodes.length) {
|
||||
// _focusNodes[i + 1]
|
||||
// .requestFocus();
|
||||
// } else if (i + 1 ==
|
||||
// _focusNodes.length) {
|
||||
// _focusNodes[i].unfocus();
|
||||
// }
|
||||
// }
|
||||
},
|
||||
controller: _controllers[i],
|
||||
style:
|
||||
|
@ -1068,7 +1068,7 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
|
|||
AutovalidateMode.onUserInteraction,
|
||||
selectionControls:
|
||||
i == 1 ? textSelectionControls : null,
|
||||
focusNode: _focusNodes[i - 1],
|
||||
// focusNode: _focusNodes[i - 1],
|
||||
onChanged: (value) {
|
||||
final FormInputStatus formInputStatus;
|
||||
|
||||
|
@ -1084,14 +1084,14 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
|
|||
FormInputStatus.invalid;
|
||||
}
|
||||
|
||||
if (formInputStatus ==
|
||||
FormInputStatus.valid) {
|
||||
if (i < _focusNodes.length) {
|
||||
_focusNodes[i].requestFocus();
|
||||
} else if (i == _focusNodes.length) {
|
||||
_focusNodes[i - 1].unfocus();
|
||||
}
|
||||
}
|
||||
// if (formInputStatus ==
|
||||
// FormInputStatus.valid) {
|
||||
// if (i < _focusNodes.length) {
|
||||
// _focusNodes[i].requestFocus();
|
||||
// } else if (i == _focusNodes.length) {
|
||||
// _focusNodes[i - 1].unfocus();
|
||||
// }
|
||||
// }
|
||||
setState(() {
|
||||
_inputStatuses[i - 1] =
|
||||
formInputStatus;
|
||||
|
|
59
pubspec.lock
59
pubspec.lock
|
@ -557,11 +557,12 @@ packages:
|
|||
file_picker:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: file_picker
|
||||
sha256: b1729fc96627dd44012d0a901558177418818d6bd428df59dcfeb594e5f66432
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.3.2"
|
||||
path: "."
|
||||
ref: f0930d9fa79d347b2a0e25a7de4f5a4a88a9a907
|
||||
resolved-ref: f0930d9fa79d347b2a0e25a7de4f5a4a88a9a907
|
||||
url: "https://github.com/muttsu-623/flutter_file_picker.git"
|
||||
source: git
|
||||
version: "5.3.3"
|
||||
fixnum:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -742,10 +743,10 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_svg
|
||||
sha256: "6ff9fa12892ae074092de2fa6a9938fb21dbabfdaa2ff57dc697ff912fc8d4b2"
|
||||
sha256: "8c5d68a82add3ca76d792f058b186a0599414f279f00ece4830b9b231b570338"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.6"
|
||||
version: "2.0.7"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
|
@ -1141,14 +1142,6 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
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:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -1209,18 +1202,18 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
name: permission_handler
|
||||
sha256: "63e5216aae014a72fe9579ccd027323395ce7a98271d9defa9d57320d001af81"
|
||||
sha256: ad65ba9af42a3d067203641de3fd9f547ded1410bad3b84400c2b4899faede70
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "10.4.3"
|
||||
version: "11.0.0"
|
||||
permission_handler_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_android
|
||||
sha256: "2ffaf52a21f64ac9b35fe7369bb9533edbd4f698e5604db8645b1064ff4cf221"
|
||||
sha256: "6901d50f4d4b9a27e1749dbd4adbf06aa00d90a21a2db563405d5ce27ee120ac"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "10.3.3"
|
||||
version: "11.0.0"
|
||||
permission_handler_apple:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -1233,10 +1226,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_platform_interface
|
||||
sha256: "7c6b1500385dd1d2ca61bb89e2488ca178e274a69144d26bbd65e33eae7c02a9"
|
||||
sha256: f2343e9fa9c22ae4fd92d4732755bfe452214e7189afcc097380950cf567b4b2
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.11.3"
|
||||
version: "3.11.5"
|
||||
permission_handler_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -1747,6 +1740,30 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
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:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
12
pubspec.yaml
12
pubspec.yaml
|
@ -60,7 +60,7 @@ dependencies:
|
|||
# Utility plugins
|
||||
http: ^0.13.0
|
||||
local_auth: ^1.1.10
|
||||
permission_handler: ^10.0.0
|
||||
permission_handler: ^11.0.0
|
||||
flutter_local_notifications: ^9.4.0
|
||||
rxdart: ^0.27.3
|
||||
zxcvbn: ^1.0.0
|
||||
|
@ -101,7 +101,7 @@ dependencies:
|
|||
flutter_native_splash: ^2.2.4
|
||||
google_fonts: ^4.0.4
|
||||
url_launcher: ^6.0.5
|
||||
flutter_svg: ^1.0.1
|
||||
flutter_svg: ^2.0.7
|
||||
flutter_feather_icons: ^2.0.0+1
|
||||
decimal: ^2.1.0
|
||||
event_bus: ^2.0.0
|
||||
|
@ -123,7 +123,7 @@ dependencies:
|
|||
pointycastle: ^3.6.0
|
||||
package_info_plus: ^4.0.2
|
||||
lottie: ^2.3.2
|
||||
file_picker: ^5.3.1
|
||||
file_picker: ^5.5.0
|
||||
connectivity_plus: ^4.0.1
|
||||
isar: 3.0.5
|
||||
isar_flutter_libs: 3.0.5 # contains the binaries
|
||||
|
@ -200,6 +200,12 @@ dependency_overrides:
|
|||
url: https://github.com/cypherstack/stack-bip39.git
|
||||
ref: 0cd6d54e2860bea68fc50c801cb9db2a760192fb
|
||||
|
||||
|
||||
file_picker:
|
||||
git:
|
||||
url: https://github.com/muttsu-623/flutter_file_picker.git
|
||||
ref: f0930d9fa79d347b2a0e25a7de4f5a4a88a9a907
|
||||
|
||||
crypto: 3.0.2
|
||||
analyzer: ^5.2.0
|
||||
pinenacl: ^0.3.3
|
||||
|
|
Loading…
Reference in a new issue