mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-09 20:39:35 +00:00
Fix conflicts with main
This commit is contained in:
parent
bdb3ec2048
commit
665770c733
12 changed files with 197 additions and 172 deletions
|
@ -17,7 +17,7 @@ class BitcoinWalletService extends WalletService<
|
||||||
BitcoinNewWalletCredentials,
|
BitcoinNewWalletCredentials,
|
||||||
BitcoinRestoreWalletFromSeedCredentials,
|
BitcoinRestoreWalletFromSeedCredentials,
|
||||||
BitcoinRestoreWalletFromWIFCredentials> {
|
BitcoinRestoreWalletFromWIFCredentials> {
|
||||||
BitcoinWalletService(this.walletInfoSource, this.unspentCoinsInfoSource);
|
BitcoinWalletService(this.walletInfoSource, this.unspentCoinsInfoSource, this.isDirect);
|
||||||
|
|
||||||
final Box<WalletInfo> walletInfoSource;
|
final Box<WalletInfo> walletInfoSource;
|
||||||
final Box<UnspentCoinsInfo> unspentCoinsInfoSource;
|
final Box<UnspentCoinsInfo> unspentCoinsInfoSource;
|
||||||
|
@ -74,7 +74,8 @@ class BitcoinWalletService extends WalletService<
|
||||||
password: password,
|
password: password,
|
||||||
name: currentName,
|
name: currentName,
|
||||||
walletInfo: currentWalletInfo,
|
walletInfo: currentWalletInfo,
|
||||||
unspentCoinsInfo: unspentCoinsInfoSource);
|
unspentCoinsInfo: unspentCoinsInfoSource,
|
||||||
|
encryptionFileUtils: encryptionFileUtilsFor(isDirect));
|
||||||
|
|
||||||
await currentWallet.renameWalletFiles(newName);
|
await currentWallet.renameWalletFiles(newName);
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,6 @@ import 'package:cw_ethereum/ethereum_transaction_info.dart';
|
||||||
import 'package:cw_ethereum/ethereum_transaction_model.dart';
|
import 'package:cw_ethereum/ethereum_transaction_model.dart';
|
||||||
import 'package:cw_ethereum/ethereum_transaction_priority.dart';
|
import 'package:cw_ethereum/ethereum_transaction_priority.dart';
|
||||||
import 'package:cw_ethereum/ethereum_wallet_addresses.dart';
|
import 'package:cw_ethereum/ethereum_wallet_addresses.dart';
|
||||||
import 'package:cw_ethereum/file.dart';
|
|
||||||
import 'package:cw_core/erc20_token.dart';
|
import 'package:cw_core/erc20_token.dart';
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
import 'package:hex/hex.dart';
|
import 'package:hex/hex.dart';
|
||||||
|
|
|
@ -7,26 +7,24 @@ import 'package:cw_core/wallet_type.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
class WalletLoadingService {
|
class WalletLoadingService {
|
||||||
WalletLoadingService(
|
WalletLoadingService(this.sharedPreferences, this.keyService, this.walletServiceFactory);
|
||||||
this.sharedPreferences, this.keyService, this.walletServiceFactory);
|
|
||||||
|
|
||||||
final SharedPreferences sharedPreferences;
|
final SharedPreferences sharedPreferences;
|
||||||
final KeyService keyService;
|
final KeyService keyService;
|
||||||
final WalletService Function(WalletType type) walletServiceFactory;
|
final WalletService Function(WalletType type) walletServiceFactory;
|
||||||
|
|
||||||
Future<void> renameWallet(
|
Future<void> renameWallet(WalletType type, String name, String newName,
|
||||||
WalletType type, String name, String newName) async {
|
{String? password}) async {
|
||||||
final walletService = walletServiceFactory.call(type);
|
final walletService = walletServiceFactory.call(type);
|
||||||
final password = await keyService.getWalletPassword(walletName: name);
|
final walletPassword = password ?? (await keyService.getWalletPassword(walletName: name));
|
||||||
|
|
||||||
// Save the current wallet's password to the new wallet name's key
|
// Save the current wallet's password to the new wallet name's key
|
||||||
await keyService.saveWalletPassword(
|
await keyService.saveWalletPassword(walletName: newName, password: walletPassword);
|
||||||
walletName: newName, password: password);
|
|
||||||
// Delete previous wallet name from keyService to keep only new wallet's name
|
// Delete previous wallet name from keyService to keep only new wallet's name
|
||||||
// otherwise keeps duplicate (old and new names)
|
// otherwise keeps duplicate (old and new names)
|
||||||
await keyService.deleteWalletPassword(walletName: name);
|
await keyService.deleteWalletPassword(walletName: name);
|
||||||
|
|
||||||
await walletService.rename(name, password, newName);
|
await walletService.rename(name, walletPassword, newName);
|
||||||
|
|
||||||
// set shared preferences flag based on previous wallet name
|
// set shared preferences flag based on previous wallet name
|
||||||
if (type == WalletType.monero) {
|
if (type == WalletType.monero) {
|
||||||
|
@ -37,10 +35,10 @@ class WalletLoadingService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<WalletBase> load(WalletType type, String name) async {
|
Future<WalletBase> load(WalletType type, String name, {String? password}) async {
|
||||||
final walletService = walletServiceFactory.call(type);
|
final walletService = walletServiceFactory.call(type);
|
||||||
final password = await keyService.getWalletPassword(walletName: name);
|
final walletPassword = password ?? (await keyService.getWalletPassword(walletName: name));
|
||||||
final wallet = await walletService.openWallet(name, password);
|
final wallet = await walletService.openWallet(name, walletPassword);
|
||||||
|
|
||||||
if (type == WalletType.monero) {
|
if (type == WalletType.monero) {
|
||||||
await updateMoneroWalletPassword(wallet);
|
await updateMoneroWalletPassword(wallet);
|
||||||
|
@ -61,11 +59,9 @@ class WalletLoadingService {
|
||||||
// Save new generated password with backup key for case where
|
// Save new generated password with backup key for case where
|
||||||
// wallet will change password, but it will fail to update in secure storage
|
// wallet will change password, but it will fail to update in secure storage
|
||||||
final bakWalletName = '#__${wallet.name}_bak__#';
|
final bakWalletName = '#__${wallet.name}_bak__#';
|
||||||
await keyService.saveWalletPassword(
|
await keyService.saveWalletPassword(walletName: bakWalletName, password: password);
|
||||||
walletName: bakWalletName, password: password);
|
|
||||||
await wallet.changePassword(password);
|
await wallet.changePassword(password);
|
||||||
await keyService.saveWalletPassword(
|
await keyService.saveWalletPassword(walletName: wallet.name, password: password);
|
||||||
walletName: wallet.name, password: password);
|
|
||||||
isPasswordUpdated = true;
|
isPasswordUpdated = true;
|
||||||
await sharedPreferences.setBool(key, isPasswordUpdated);
|
await sharedPreferences.setBool(key, isPasswordUpdated);
|
||||||
}
|
}
|
||||||
|
|
|
@ -195,8 +195,6 @@ import 'package:hive/hive.dart';
|
||||||
import 'package:mobx/mobx.dart';
|
import 'package:mobx/mobx.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
import 'package:cake_wallet/core/secure_storage.dart';
|
import 'package:cake_wallet/core/secure_storage.dart';
|
||||||
import 'package:cake_wallet/view_model/wallet_restoration_from_seed_vm.dart';
|
|
||||||
import 'package:cake_wallet/view_model/wallet_restoration_from_keys_vm.dart';
|
|
||||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||||
import 'package:cake_wallet/core/wallet_creation_service.dart';
|
import 'package:cake_wallet/core/wallet_creation_service.dart';
|
||||||
import 'package:cake_wallet/store/app_store.dart';
|
import 'package:cake_wallet/store/app_store.dart';
|
||||||
|
|
|
@ -7,7 +7,7 @@ import 'package:cw_core/wallet_base.dart';
|
||||||
import 'package:cw_core/balance.dart';
|
import 'package:cw_core/balance.dart';
|
||||||
import 'package:cw_core/transaction_info.dart';
|
import 'package:cw_core/transaction_info.dart';
|
||||||
import 'package:cw_core/sync_status.dart';
|
import 'package:cw_core/sync_status.dart';
|
||||||
import 'package:wakelock/wakelock.dart';
|
import 'package:wakelock_plus/wakelock_plus.dart';
|
||||||
|
|
||||||
ReactionDisposer? _onWalletSyncStatusChangeReaction;
|
ReactionDisposer? _onWalletSyncStatusChangeReaction;
|
||||||
|
|
||||||
|
@ -27,10 +27,10 @@ void startWalletSyncStatusChangeReaction(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (status is SyncingSyncStatus) {
|
if (status is SyncingSyncStatus) {
|
||||||
await Wakelock.enable();
|
await WakelockPlus.enable();
|
||||||
}
|
}
|
||||||
if (status is SyncedSyncStatus || status is FailedSyncStatus) {
|
if (status is SyncedSyncStatus || status is FailedSyncStatus) {
|
||||||
await Wakelock.disable();
|
await WakelockPlus.disable();
|
||||||
}
|
}
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
print(e.toString());
|
print(e.toString());
|
||||||
|
|
|
@ -54,7 +54,8 @@ class _WalletNameFormState extends State<WalletNameForm> {
|
||||||
_languageSelectorKey = GlobalKey<SeedLanguageSelectorState>(),
|
_languageSelectorKey = GlobalKey<SeedLanguageSelectorState>(),
|
||||||
_nameController = TextEditingController(),
|
_nameController = TextEditingController(),
|
||||||
_passwordController = _walletNewVM.hasWalletPassword ? TextEditingController() : null,
|
_passwordController = _walletNewVM.hasWalletPassword ? TextEditingController() : null,
|
||||||
_repeatedPasswordController = _walletNewVM.hasWalletPassword ? TextEditingController() : null;
|
_repeatedPasswordController =
|
||||||
|
_walletNewVM.hasWalletPassword ? TextEditingController() : null;
|
||||||
|
|
||||||
static const aspectRatioImage = 1.22;
|
static const aspectRatioImage = 1.22;
|
||||||
|
|
||||||
|
@ -128,15 +129,20 @@ class _WalletNameFormState extends State<WalletNameForm> {
|
||||||
hintStyle: TextStyle(
|
hintStyle: TextStyle(
|
||||||
fontSize: 18.0,
|
fontSize: 18.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
color: Theme.of(context).extension<NewWalletTheme>()!.hintTextColor),
|
color:
|
||||||
|
Theme.of(context).extension<NewWalletTheme>()!.hintTextColor),
|
||||||
hintText: S.of(context).wallet_name,
|
hintText: S.of(context).wallet_name,
|
||||||
focusedBorder: UnderlineInputBorder(
|
focusedBorder: UnderlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: Theme.of(context).extension<NewWalletTheme>()!.underlineColor,
|
color: Theme.of(context)
|
||||||
|
.extension<NewWalletTheme>()!
|
||||||
|
.underlineColor,
|
||||||
width: 1.0)),
|
width: 1.0)),
|
||||||
enabledBorder: UnderlineInputBorder(
|
enabledBorder: UnderlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: Theme.of(context).extension<NewWalletTheme>()!.underlineColor,
|
color: Theme.of(context)
|
||||||
|
.extension<NewWalletTheme>()!
|
||||||
|
.underlineColor,
|
||||||
width: 1.0),
|
width: 1.0),
|
||||||
),
|
),
|
||||||
suffixIcon: Semantics(
|
suffixIcon: Semantics(
|
||||||
|
@ -163,7 +169,9 @@ class _WalletNameFormState extends State<WalletNameForm> {
|
||||||
height: 34,
|
height: 34,
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
'assets/images/refresh_icon.png',
|
'assets/images/refresh_icon.png',
|
||||||
color: Theme.of(context).extension<SendPageTheme>()!.textFieldButtonIconColor,
|
color: Theme.of(context)
|
||||||
|
.extension<SendPageTheme>()!
|
||||||
|
.textFieldButtonIconColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -171,8 +179,8 @@ class _WalletNameFormState extends State<WalletNameForm> {
|
||||||
),
|
),
|
||||||
validator: WalletNameValidator(),
|
validator: WalletNameValidator(),
|
||||||
),
|
),
|
||||||
if (_walletNewVM.hasWalletPassword)
|
if (_walletNewVM.hasWalletPassword) ...[
|
||||||
...[TextFormField(
|
TextFormField(
|
||||||
onChanged: (value) => _walletNewVM.walletPassword = value,
|
onChanged: (value) => _walletNewVM.walletPassword = value,
|
||||||
controller: _passwordController,
|
controller: _passwordController,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
|
@ -180,29 +188,33 @@ class _WalletNameFormState extends State<WalletNameForm> {
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 20.0,
|
fontSize: 20.0,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: Theme.of(context).primaryTextTheme!.headline6!.color!),
|
color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
|
||||||
|
),
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintStyle: TextStyle(
|
hintStyle: TextStyle(
|
||||||
fontSize: 18.0,
|
fontSize: 18.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
color: Theme.of(context).accentTextTheme!.headline2!.color!),
|
color:
|
||||||
|
Theme.of(context).extension<NewWalletTheme>()!.hintTextColor,
|
||||||
|
),
|
||||||
hintText: S.of(context).password,
|
hintText: S.of(context).password,
|
||||||
focusedBorder: UnderlineInputBorder(
|
focusedBorder: UnderlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: Theme.of(context)
|
color: Theme.of(context)
|
||||||
.accentTextTheme!
|
.extension<NewWalletTheme>()!
|
||||||
.headline2!
|
.underlineColor,
|
||||||
.decorationColor!,
|
width: 1.0,
|
||||||
width: 1.0)),
|
),
|
||||||
|
),
|
||||||
enabledBorder: UnderlineInputBorder(
|
enabledBorder: UnderlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: Theme.of(context)
|
color: Theme.of(context)
|
||||||
.accentTextTheme!
|
.extension<NewWalletTheme>()!
|
||||||
.headline2!
|
.underlineColor,
|
||||||
.decorationColor!,
|
width: 1.0,
|
||||||
width: 1.0),
|
),
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
TextFormField(
|
TextFormField(
|
||||||
onChanged: (value) => _walletNewVM.repeatedWalletPassword = value,
|
onChanged: (value) => _walletNewVM.repeatedWalletPassword = value,
|
||||||
|
@ -212,30 +224,35 @@ class _WalletNameFormState extends State<WalletNameForm> {
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 20.0,
|
fontSize: 20.0,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: Theme.of(context).primaryTextTheme!.headline6!.color!),
|
color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
|
||||||
|
),
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintStyle: TextStyle(
|
hintStyle: TextStyle(
|
||||||
fontSize: 18.0,
|
fontSize: 18.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
color: Theme.of(context).accentTextTheme!.headline2!.color!),
|
color:
|
||||||
|
Theme.of(context).extension<NewWalletTheme>()!.hintTextColor,
|
||||||
|
),
|
||||||
hintText: S.of(context).repeate_wallet_password,
|
hintText: S.of(context).repeate_wallet_password,
|
||||||
focusedBorder: UnderlineInputBorder(
|
focusedBorder: UnderlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: Theme.of(context)
|
color: Theme.of(context)
|
||||||
.accentTextTheme!
|
.extension<NewWalletTheme>()!
|
||||||
.headline2!
|
.underlineColor,
|
||||||
.decorationColor!,
|
width: 1.0,
|
||||||
width: 1.0)),
|
),
|
||||||
|
),
|
||||||
enabledBorder: UnderlineInputBorder(
|
enabledBorder: UnderlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: Theme.of(context)
|
color: Theme.of(context)
|
||||||
.accentTextTheme!
|
.extension<NewWalletTheme>()!
|
||||||
.headline2!
|
.underlineColor,
|
||||||
.decorationColor!,
|
width: 1.0,
|
||||||
width: 1.0),
|
),
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
)],
|
),
|
||||||
|
],
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -4,6 +4,8 @@ import 'package:cake_wallet/generated/i18n.dart';
|
||||||
import 'package:cake_wallet/src/screens/auth/auth_page.dart';
|
import 'package:cake_wallet/src/screens/auth/auth_page.dart';
|
||||||
import 'package:cake_wallet/src/screens/wallet_unlock/wallet_unlock_arguments.dart';
|
import 'package:cake_wallet/src/screens/wallet_unlock/wallet_unlock_arguments.dart';
|
||||||
import 'package:cake_wallet/src/widgets/primary_button.dart';
|
import 'package:cake_wallet/src/widgets/primary_button.dart';
|
||||||
|
import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
|
||||||
|
import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart';
|
||||||
import 'package:cake_wallet/utils/responsive_layout_util.dart';
|
import 'package:cake_wallet/utils/responsive_layout_util.dart';
|
||||||
import 'package:cake_wallet/utils/show_bar.dart';
|
import 'package:cake_wallet/utils/show_bar.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
|
@ -12,12 +14,9 @@ import 'package:cake_wallet/view_model/wallet_unlock_view_model.dart';
|
||||||
import 'package:flutter_mobx/flutter_mobx.dart';
|
import 'package:flutter_mobx/flutter_mobx.dart';
|
||||||
import 'package:mobx/mobx.dart';
|
import 'package:mobx/mobx.dart';
|
||||||
|
|
||||||
|
|
||||||
class WalletUnlockPage extends StatefulWidget {
|
class WalletUnlockPage extends StatefulWidget {
|
||||||
WalletUnlockPage(
|
WalletUnlockPage(
|
||||||
this.walletUnlockViewModel,
|
this.walletUnlockViewModel, this.onAuthenticationFinished, this.authPasswordHandler,
|
||||||
this.onAuthenticationFinished,
|
|
||||||
this.authPasswordHandler,
|
|
||||||
{required this.closable});
|
{required this.closable});
|
||||||
|
|
||||||
final WalletUnlockViewModel walletUnlockViewModel;
|
final WalletUnlockViewModel walletUnlockViewModel;
|
||||||
|
@ -30,13 +29,11 @@ class WalletUnlockPage extends StatefulWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class WalletUnlockPageState extends AuthPageState<WalletUnlockPage> {
|
class WalletUnlockPageState extends AuthPageState<WalletUnlockPage> {
|
||||||
WalletUnlockPageState()
|
WalletUnlockPageState() : _passwordController = TextEditingController();
|
||||||
: _passwordController = TextEditingController();
|
|
||||||
|
|
||||||
final TextEditingController _passwordController;
|
final TextEditingController _passwordController;
|
||||||
final _key = GlobalKey<ScaffoldState>();
|
final _key = GlobalKey<ScaffoldState>();
|
||||||
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>? _authBar;
|
||||||
Flushbar<void>? _progressBar;
|
Flushbar<void>? _progressBar;
|
||||||
|
@ -44,8 +41,7 @@ class WalletUnlockPageState extends AuthPageState<WalletUnlockPage> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
_reaction ??=
|
_reaction ??= reaction((_) => widget.walletUnlockViewModel.state, (ExecutionState state) {
|
||||||
reaction((_) => widget.walletUnlockViewModel.state, (ExecutionState state) {
|
|
||||||
if (state is ExecutedSuccessfullyState) {
|
if (state is ExecutedSuccessfullyState) {
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
widget.onAuthenticationFinished(true, this);
|
widget.onAuthenticationFinished(true, this);
|
||||||
|
@ -56,24 +52,22 @@ class WalletUnlockPageState extends AuthPageState<WalletUnlockPage> {
|
||||||
if (state is IsExecutingState) {
|
if (state is IsExecutingState) {
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
// null duration to make it indefinite until its disposed
|
// null duration to make it indefinite until its disposed
|
||||||
_authBar =
|
_authBar = createBar<void>(S.of(context).authentication, duration: null)..show(context);
|
||||||
createBar<void>(S.of(context).authentication, duration: null)
|
|
||||||
..show(context);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state is FailureState) {
|
if (state is FailureState) {
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||||
dismissFlushBar(_authBar);
|
dismissFlushBar(_authBar);
|
||||||
showBar<void>(
|
showBar<void>(context, S.of(context).failed_authentication(state.error));
|
||||||
context, S.of(context).failed_authentication(state.error));
|
|
||||||
|
|
||||||
widget.onAuthenticationFinished(false, this);
|
widget.onAuthenticationFinished(false, this);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
_passwordControllerListener = () => widget.walletUnlockViewModel.setPassword(_passwordController.text);
|
_passwordControllerListener =
|
||||||
|
() => widget.walletUnlockViewModel.setPassword(_passwordController.text);
|
||||||
|
|
||||||
if (_passwordControllerListener != null) {
|
if (_passwordControllerListener != null) {
|
||||||
_passwordController.addListener(_passwordControllerListener!);
|
_passwordController.addListener(_passwordControllerListener!);
|
||||||
|
@ -96,8 +90,7 @@ class WalletUnlockPageState extends AuthPageState<WalletUnlockPage> {
|
||||||
@override
|
@override
|
||||||
void changeProcessText(String text) {
|
void changeProcessText(String text) {
|
||||||
dismissFlushBar(_authBar);
|
dismissFlushBar(_authBar);
|
||||||
_progressBar = createBar<void>(text, duration: null)
|
_progressBar = createBar<void>(text, duration: null)..show(_key.currentContext!);
|
||||||
..show(_key.currentContext!);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -153,21 +146,27 @@ class WalletUnlockPageState extends AuthPageState<WalletUnlockPage> {
|
||||||
resizeToAvoidBottomInset: false,
|
resizeToAvoidBottomInset: false,
|
||||||
body: Center(
|
body: Center(
|
||||||
child: ConstrainedBox(
|
child: ConstrainedBox(
|
||||||
constraints: BoxConstraints(maxWidth: ResponsiveLayoutUtil.kDesktopMaxWidthConstraint),
|
constraints: BoxConstraints(
|
||||||
|
maxWidth: ResponsiveLayoutUtil.kDesktopMaxWidthConstraint,
|
||||||
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Expanded(child: Column(
|
Expanded(
|
||||||
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(widget.walletUnlockViewModel.walletName,
|
Text(
|
||||||
|
widget.walletUnlockViewModel.walletName,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 24,
|
fontSize: 24,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
color: Theme.of(context).primaryTextTheme.titleLarge!.color!)),
|
color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
SizedBox(height: 24),
|
SizedBox(height: 24),
|
||||||
Form(
|
Form(
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
|
@ -178,39 +177,42 @@ class WalletUnlockPageState extends AuthPageState<WalletUnlockPage> {
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 20.0,
|
fontSize: 20.0,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: Theme.of(context).primaryTextTheme.titleLarge!.color!),
|
color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
|
||||||
|
),
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintStyle: TextStyle(
|
hintStyle: TextStyle(
|
||||||
fontSize: 18.0,
|
fontSize: 18.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
color: Theme.of(context).accentTextTheme.displayMedium!.color!),
|
color: Theme.of(context).extension<NewWalletTheme>()!.hintTextColor,
|
||||||
|
),
|
||||||
hintText: S.of(context).enter_wallet_password,
|
hintText: S.of(context).enter_wallet_password,
|
||||||
focusedBorder: UnderlineInputBorder(
|
focusedBorder: UnderlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: Theme.of(context)
|
color: Theme.of(context).extension<NewWalletTheme>()!.underlineColor,
|
||||||
.accentTextTheme
|
width: 1.0,
|
||||||
.displayMedium!
|
),
|
||||||
.decorationColor!,
|
),
|
||||||
width: 1.0)),
|
|
||||||
enabledBorder: UnderlineInputBorder(
|
enabledBorder: UnderlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: Theme.of(context)
|
color: Theme.of(context).extension<NewWalletTheme>()!.underlineColor,
|
||||||
.accentTextTheme
|
width: 1.0,
|
||||||
.displayMedium!
|
),
|
||||||
.decorationColor!,
|
),
|
||||||
width: 1.0),
|
),
|
||||||
)
|
),
|
||||||
)))])),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(bottom: 24),
|
padding: EdgeInsets.only(bottom: 24),
|
||||||
child: Observer(
|
child: Observer(
|
||||||
builder: (_) =>
|
builder: (_) => LoadingPrimaryButton(
|
||||||
LoadingPrimaryButton(
|
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
if (widget.authPasswordHandler != null) {
|
if (widget.authPasswordHandler != null) {
|
||||||
try {
|
try {
|
||||||
await widget.authPasswordHandler!(widget
|
await widget
|
||||||
.walletUnlockViewModel.password);
|
.authPasswordHandler!(widget.walletUnlockViewModel.password);
|
||||||
widget.walletUnlockViewModel.success();
|
widget.walletUnlockViewModel.success();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
widget.walletUnlockViewModel.failure(e);
|
widget.walletUnlockViewModel.failure(e);
|
||||||
|
@ -224,8 +226,13 @@ class WalletUnlockPageState extends AuthPageState<WalletUnlockPage> {
|
||||||
color: Colors.green,
|
color: Colors.green,
|
||||||
textColor: Colors.white,
|
textColor: Colors.white,
|
||||||
isLoading: widget.walletUnlockViewModel.state is IsExecutingState,
|
isLoading: widget.walletUnlockViewModel.state is IsExecutingState,
|
||||||
isDisabled: widget.walletUnlockViewModel.state is IsExecutingState)))
|
isDisabled: widget.walletUnlockViewModel.state is IsExecutingState),
|
||||||
]))
|
),
|
||||||
));
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
#include <cw_monero/cw_monero_plugin.h>
|
#include <cw_monero/cw_monero_plugin.h>
|
||||||
#include <devicelocale/devicelocale_plugin.h>
|
#include <devicelocale/devicelocale_plugin.h>
|
||||||
|
#include <flutter_secure_storage_linux/flutter_secure_storage_linux_plugin.h>
|
||||||
#include <platform_device_id_linux/platform_device_id_linux_plugin.h>
|
#include <platform_device_id_linux/platform_device_id_linux_plugin.h>
|
||||||
#include <url_launcher_linux/url_launcher_plugin.h>
|
#include <url_launcher_linux/url_launcher_plugin.h>
|
||||||
|
|
||||||
|
@ -18,6 +19,9 @@ void fl_register_plugins(FlPluginRegistry* registry) {
|
||||||
g_autoptr(FlPluginRegistrar) devicelocale_registrar =
|
g_autoptr(FlPluginRegistrar) devicelocale_registrar =
|
||||||
fl_plugin_registry_get_registrar_for_plugin(registry, "DevicelocalePlugin");
|
fl_plugin_registry_get_registrar_for_plugin(registry, "DevicelocalePlugin");
|
||||||
devicelocale_plugin_register_with_registrar(devicelocale_registrar);
|
devicelocale_plugin_register_with_registrar(devicelocale_registrar);
|
||||||
|
g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar =
|
||||||
|
fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin");
|
||||||
|
flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar);
|
||||||
g_autoptr(FlPluginRegistrar) platform_device_id_linux_registrar =
|
g_autoptr(FlPluginRegistrar) platform_device_id_linux_registrar =
|
||||||
fl_plugin_registry_get_registrar_for_plugin(registry, "PlatformDeviceIdLinuxPlugin");
|
fl_plugin_registry_get_registrar_for_plugin(registry, "PlatformDeviceIdLinuxPlugin");
|
||||||
platform_device_id_linux_plugin_register_with_registrar(platform_device_id_linux_registrar);
|
platform_device_id_linux_plugin_register_with_registrar(platform_device_id_linux_registrar);
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
list(APPEND FLUTTER_PLUGIN_LIST
|
list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
cw_monero
|
cw_monero
|
||||||
devicelocale
|
devicelocale
|
||||||
|
flutter_secure_storage_linux
|
||||||
platform_device_id_linux
|
platform_device_id_linux
|
||||||
url_launcher_linux
|
url_launcher_linux
|
||||||
)
|
)
|
||||||
|
|
|
@ -9,6 +9,7 @@ import connectivity_plus_macos
|
||||||
import cw_monero
|
import cw_monero
|
||||||
import device_info_plus
|
import device_info_plus
|
||||||
import devicelocale
|
import devicelocale
|
||||||
|
import flutter_secure_storage_macos
|
||||||
import in_app_review
|
import in_app_review
|
||||||
import package_info_plus
|
import package_info_plus
|
||||||
import path_provider_foundation
|
import path_provider_foundation
|
||||||
|
@ -17,13 +18,14 @@ import platform_device_id_macos
|
||||||
import share_plus_macos
|
import share_plus_macos
|
||||||
import shared_preferences_foundation
|
import shared_preferences_foundation
|
||||||
import url_launcher_macos
|
import url_launcher_macos
|
||||||
import wakelock_macos
|
import wakelock_plus
|
||||||
|
|
||||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||||
ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin"))
|
ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin"))
|
||||||
CwMoneroPlugin.register(with: registry.registrar(forPlugin: "CwMoneroPlugin"))
|
CwMoneroPlugin.register(with: registry.registrar(forPlugin: "CwMoneroPlugin"))
|
||||||
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
|
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
|
||||||
DevicelocalePlugin.register(with: registry.registrar(forPlugin: "DevicelocalePlugin"))
|
DevicelocalePlugin.register(with: registry.registrar(forPlugin: "DevicelocalePlugin"))
|
||||||
|
FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin"))
|
||||||
InAppReviewPlugin.register(with: registry.registrar(forPlugin: "InAppReviewPlugin"))
|
InAppReviewPlugin.register(with: registry.registrar(forPlugin: "InAppReviewPlugin"))
|
||||||
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
|
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
|
||||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||||
|
@ -32,5 +34,5 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||||
SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin"))
|
SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin"))
|
||||||
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
||||||
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
|
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
|
||||||
WakelockMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockMacosPlugin"))
|
WakelockPlusMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockPlusMacosPlugin"))
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ dependencies:
|
||||||
hive_flutter: ^1.1.0
|
hive_flutter: ^1.1.0
|
||||||
local_auth: ^2.1.0
|
local_auth: ^2.1.0
|
||||||
local_auth_android: 1.0.21
|
local_auth_android: 1.0.21
|
||||||
package_info_plus: ^3.1.0
|
package_info_plus: ^4.1.0
|
||||||
devicelocale:
|
devicelocale:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/cake-tech/flutter-devicelocale
|
url: https://github.com/cake-tech/flutter-devicelocale
|
||||||
|
@ -60,7 +60,7 @@ dependencies:
|
||||||
device_display_brightness: ^0.0.6
|
device_display_brightness: ^0.0.6
|
||||||
workmanager: ^0.5.1
|
workmanager: ^0.5.1
|
||||||
platform_device_id: ^1.0.1
|
platform_device_id: ^1.0.1
|
||||||
wakelock: ^0.6.2
|
wakelock_plus: ^1.1.1
|
||||||
flutter_mailer: ^2.0.2
|
flutter_mailer: ^2.0.2
|
||||||
device_info_plus: 8.1.0
|
device_info_plus: 8.1.0
|
||||||
base32: 2.1.3
|
base32: 2.1.3
|
||||||
|
|
|
@ -20,8 +20,8 @@ Future<void> main(List<String> args) async {
|
||||||
await generateMonero(hasMonero);
|
await generateMonero(hasMonero);
|
||||||
await generateHaven(hasHaven);
|
await generateHaven(hasHaven);
|
||||||
await generateEthereum(hasEthereum);
|
await generateEthereum(hasEthereum);
|
||||||
await generatePubspec(hasMonero: hasMonero, hasBitcoin: hasBitcoin, hasHaven: hasHaven, hasFlutterSecureStorage: !excludeFlutterSecureStorage);
|
await generatePubspec(hasMonero: hasMonero, hasBitcoin: hasBitcoin, hasHaven: hasHaven, hasEthereum: hasEthereum, hasFlutterSecureStorage: !excludeFlutterSecureStorage);
|
||||||
await generateWalletTypes(hasMonero: hasMonero, hasBitcoin: hasBitcoin, hasHaven: hasHaven);
|
await generateWalletTypes(hasMonero: hasMonero, hasBitcoin: hasBitcoin, hasHaven: hasHaven, hasEthereum: hasEthereum);
|
||||||
await injectSecureStorage(!excludeFlutterSecureStorage);
|
await injectSecureStorage(!excludeFlutterSecureStorage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -579,8 +579,8 @@ Future<void> generatePubspec({
|
||||||
git:
|
git:
|
||||||
url: https://github.com/cake-tech/flutter_secure_storage.git
|
url: https://github.com/cake-tech/flutter_secure_storage.git
|
||||||
path: flutter_secure_storage
|
path: flutter_secure_storage
|
||||||
ref: cake-6.0.0
|
ref: cake-8.0.0
|
||||||
version: 6.0.0
|
version: 8.0.0
|
||||||
""";
|
""";
|
||||||
const cwEthereum = """
|
const cwEthereum = """
|
||||||
cw_ethereum:
|
cw_ethereum:
|
||||||
|
|
Loading…
Reference in a new issue