mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-08 20:09:24 +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,
|
||||
BitcoinRestoreWalletFromSeedCredentials,
|
||||
BitcoinRestoreWalletFromWIFCredentials> {
|
||||
BitcoinWalletService(this.walletInfoSource, this.unspentCoinsInfoSource);
|
||||
BitcoinWalletService(this.walletInfoSource, this.unspentCoinsInfoSource, this.isDirect);
|
||||
|
||||
final Box<WalletInfo> walletInfoSource;
|
||||
final Box<UnspentCoinsInfo> unspentCoinsInfoSource;
|
||||
|
@ -74,7 +74,8 @@ class BitcoinWalletService extends WalletService<
|
|||
password: password,
|
||||
name: currentName,
|
||||
walletInfo: currentWalletInfo,
|
||||
unspentCoinsInfo: unspentCoinsInfoSource);
|
||||
unspentCoinsInfo: unspentCoinsInfoSource,
|
||||
encryptionFileUtils: encryptionFileUtilsFor(isDirect));
|
||||
|
||||
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_priority.dart';
|
||||
import 'package:cw_ethereum/ethereum_wallet_addresses.dart';
|
||||
import 'package:cw_ethereum/file.dart';
|
||||
import 'package:cw_core/erc20_token.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:hex/hex.dart';
|
||||
|
|
|
@ -7,26 +7,24 @@ import 'package:cw_core/wallet_type.dart';
|
|||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
class WalletLoadingService {
|
||||
WalletLoadingService(
|
||||
this.sharedPreferences, this.keyService, this.walletServiceFactory);
|
||||
WalletLoadingService(this.sharedPreferences, this.keyService, this.walletServiceFactory);
|
||||
|
||||
final SharedPreferences sharedPreferences;
|
||||
final KeyService keyService;
|
||||
final WalletService Function(WalletType type) walletServiceFactory;
|
||||
|
||||
Future<void> renameWallet(
|
||||
WalletType type, String name, String newName) async {
|
||||
Future<void> renameWallet(WalletType type, String name, String newName,
|
||||
{String? password}) async {
|
||||
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
|
||||
await keyService.saveWalletPassword(
|
||||
walletName: newName, password: password);
|
||||
await keyService.saveWalletPassword(walletName: newName, password: walletPassword);
|
||||
// Delete previous wallet name from keyService to keep only new wallet's name
|
||||
// otherwise keeps duplicate (old and new names)
|
||||
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
|
||||
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 password = await keyService.getWalletPassword(walletName: name);
|
||||
final wallet = await walletService.openWallet(name, password);
|
||||
final walletPassword = password ?? (await keyService.getWalletPassword(walletName: name));
|
||||
final wallet = await walletService.openWallet(name, walletPassword);
|
||||
|
||||
if (type == WalletType.monero) {
|
||||
await updateMoneroWalletPassword(wallet);
|
||||
|
@ -61,11 +59,9 @@ class WalletLoadingService {
|
|||
// Save new generated password with backup key for case where
|
||||
// wallet will change password, but it will fail to update in secure storage
|
||||
final bakWalletName = '#__${wallet.name}_bak__#';
|
||||
await keyService.saveWalletPassword(
|
||||
walletName: bakWalletName, password: password);
|
||||
await keyService.saveWalletPassword(walletName: bakWalletName, password: password);
|
||||
await wallet.changePassword(password);
|
||||
await keyService.saveWalletPassword(
|
||||
walletName: wallet.name, password: password);
|
||||
await keyService.saveWalletPassword(walletName: wallet.name, password: password);
|
||||
isPasswordUpdated = true;
|
||||
await sharedPreferences.setBool(key, isPasswordUpdated);
|
||||
}
|
||||
|
|
|
@ -195,8 +195,6 @@ import 'package:hive/hive.dart';
|
|||
import 'package:mobx/mobx.dart';
|
||||
import 'package:shared_preferences/shared_preferences.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:cake_wallet/core/wallet_creation_service.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/transaction_info.dart';
|
||||
import 'package:cw_core/sync_status.dart';
|
||||
import 'package:wakelock/wakelock.dart';
|
||||
import 'package:wakelock_plus/wakelock_plus.dart';
|
||||
|
||||
ReactionDisposer? _onWalletSyncStatusChangeReaction;
|
||||
|
||||
|
@ -27,10 +27,10 @@ void startWalletSyncStatusChangeReaction(
|
|||
}
|
||||
}
|
||||
if (status is SyncingSyncStatus) {
|
||||
await Wakelock.enable();
|
||||
await WakelockPlus.enable();
|
||||
}
|
||||
if (status is SyncedSyncStatus || status is FailedSyncStatus) {
|
||||
await Wakelock.disable();
|
||||
await WakelockPlus.disable();
|
||||
}
|
||||
} catch(e) {
|
||||
print(e.toString());
|
||||
|
|
|
@ -54,7 +54,8 @@ class _WalletNameFormState extends State<WalletNameForm> {
|
|||
_languageSelectorKey = GlobalKey<SeedLanguageSelectorState>(),
|
||||
_nameController = TextEditingController(),
|
||||
_passwordController = _walletNewVM.hasWalletPassword ? TextEditingController() : null,
|
||||
_repeatedPasswordController = _walletNewVM.hasWalletPassword ? TextEditingController() : null;
|
||||
_repeatedPasswordController =
|
||||
_walletNewVM.hasWalletPassword ? TextEditingController() : null;
|
||||
|
||||
static const aspectRatioImage = 1.22;
|
||||
|
||||
|
@ -128,15 +129,20 @@ class _WalletNameFormState extends State<WalletNameForm> {
|
|||
hintStyle: TextStyle(
|
||||
fontSize: 18.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).extension<NewWalletTheme>()!.hintTextColor),
|
||||
color:
|
||||
Theme.of(context).extension<NewWalletTheme>()!.hintTextColor),
|
||||
hintText: S.of(context).wallet_name,
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Theme.of(context).extension<NewWalletTheme>()!.underlineColor,
|
||||
color: Theme.of(context)
|
||||
.extension<NewWalletTheme>()!
|
||||
.underlineColor,
|
||||
width: 1.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Theme.of(context).extension<NewWalletTheme>()!.underlineColor,
|
||||
color: Theme.of(context)
|
||||
.extension<NewWalletTheme>()!
|
||||
.underlineColor,
|
||||
width: 1.0),
|
||||
),
|
||||
suffixIcon: Semantics(
|
||||
|
@ -163,7 +169,9 @@ class _WalletNameFormState extends State<WalletNameForm> {
|
|||
height: 34,
|
||||
child: Image.asset(
|
||||
'assets/images/refresh_icon.png',
|
||||
color: Theme.of(context).extension<SendPageTheme>()!.textFieldButtonIconColor,
|
||||
color: Theme.of(context)
|
||||
.extension<SendPageTheme>()!
|
||||
.textFieldButtonIconColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -171,38 +179,42 @@ class _WalletNameFormState extends State<WalletNameForm> {
|
|||
),
|
||||
validator: WalletNameValidator(),
|
||||
),
|
||||
if (_walletNewVM.hasWalletPassword)
|
||||
...[TextFormField(
|
||||
if (_walletNewVM.hasWalletPassword) ...[
|
||||
TextFormField(
|
||||
onChanged: (value) => _walletNewVM.walletPassword = value,
|
||||
controller: _passwordController,
|
||||
textAlign: TextAlign.center,
|
||||
obscureText: true,
|
||||
style: TextStyle(
|
||||
fontSize: 20.0,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Theme.of(context).primaryTextTheme!.headline6!.color!),
|
||||
fontSize: 20.0,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 18.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).accentTextTheme!.headline2!.color!),
|
||||
fontSize: 18.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
color:
|
||||
Theme.of(context).extension<NewWalletTheme>()!.hintTextColor,
|
||||
),
|
||||
hintText: S.of(context).password,
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Theme.of(context)
|
||||
.accentTextTheme!
|
||||
.headline2!
|
||||
.decorationColor!,
|
||||
width: 1.0)),
|
||||
borderSide: BorderSide(
|
||||
color: Theme.of(context)
|
||||
.extension<NewWalletTheme>()!
|
||||
.underlineColor,
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Theme.of(context)
|
||||
.accentTextTheme!
|
||||
.headline2!
|
||||
.decorationColor!,
|
||||
width: 1.0),
|
||||
)
|
||||
)
|
||||
color: Theme.of(context)
|
||||
.extension<NewWalletTheme>()!
|
||||
.underlineColor,
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
TextFormField(
|
||||
onChanged: (value) => _walletNewVM.repeatedWalletPassword = value,
|
||||
|
@ -210,32 +222,37 @@ class _WalletNameFormState extends State<WalletNameForm> {
|
|||
textAlign: TextAlign.center,
|
||||
obscureText: true,
|
||||
style: TextStyle(
|
||||
fontSize: 20.0,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Theme.of(context).primaryTextTheme!.headline6!.color!),
|
||||
fontSize: 20.0,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 18.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).accentTextTheme!.headline2!.color!),
|
||||
fontSize: 18.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
color:
|
||||
Theme.of(context).extension<NewWalletTheme>()!.hintTextColor,
|
||||
),
|
||||
hintText: S.of(context).repeate_wallet_password,
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Theme.of(context)
|
||||
.accentTextTheme!
|
||||
.headline2!
|
||||
.decorationColor!,
|
||||
width: 1.0)),
|
||||
borderSide: BorderSide(
|
||||
color: Theme.of(context)
|
||||
.extension<NewWalletTheme>()!
|
||||
.underlineColor,
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Theme.of(context)
|
||||
.accentTextTheme!
|
||||
.headline2!
|
||||
.decorationColor!,
|
||||
width: 1.0),
|
||||
)
|
||||
)
|
||||
)],
|
||||
color: Theme.of(context)
|
||||
.extension<NewWalletTheme>()!
|
||||
.underlineColor,
|
||||
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/wallet_unlock/wallet_unlock_arguments.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/show_bar.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
@ -12,13 +14,10 @@ import 'package:cake_wallet/view_model/wallet_unlock_view_model.dart';
|
|||
import 'package:flutter_mobx/flutter_mobx.dart';
|
||||
import 'package:mobx/mobx.dart';
|
||||
|
||||
|
||||
class WalletUnlockPage extends StatefulWidget {
|
||||
WalletUnlockPage(
|
||||
this.walletUnlockViewModel,
|
||||
this.onAuthenticationFinished,
|
||||
this.authPasswordHandler,
|
||||
{required this.closable});
|
||||
this.walletUnlockViewModel, this.onAuthenticationFinished, this.authPasswordHandler,
|
||||
{required this.closable});
|
||||
|
||||
final WalletUnlockViewModel walletUnlockViewModel;
|
||||
final OnAuthenticationFinished onAuthenticationFinished;
|
||||
|
@ -26,17 +25,15 @@ class WalletUnlockPage extends StatefulWidget {
|
|||
final bool closable;
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => WalletUnlockPageState();
|
||||
State<StatefulWidget> createState() => WalletUnlockPageState();
|
||||
}
|
||||
|
||||
class WalletUnlockPageState extends AuthPageState<WalletUnlockPage> {
|
||||
WalletUnlockPageState()
|
||||
: _passwordController = TextEditingController();
|
||||
WalletUnlockPageState() : _passwordController = TextEditingController();
|
||||
|
||||
final TextEditingController _passwordController;
|
||||
final _key = GlobalKey<ScaffoldState>();
|
||||
final _backArrowImageDarkTheme =
|
||||
Image.asset('assets/images/close_button.png');
|
||||
final _backArrowImageDarkTheme = Image.asset('assets/images/close_button.png');
|
||||
ReactionDisposer? _reaction;
|
||||
Flushbar<void>? _authBar;
|
||||
Flushbar<void>? _progressBar;
|
||||
|
@ -44,8 +41,7 @@ class WalletUnlockPageState extends AuthPageState<WalletUnlockPage> {
|
|||
|
||||
@override
|
||||
void initState() {
|
||||
_reaction ??=
|
||||
reaction((_) => widget.walletUnlockViewModel.state, (ExecutionState state) {
|
||||
_reaction ??= reaction((_) => widget.walletUnlockViewModel.state, (ExecutionState state) {
|
||||
if (state is ExecutedSuccessfullyState) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
widget.onAuthenticationFinished(true, this);
|
||||
|
@ -56,38 +52,36 @@ class WalletUnlockPageState extends AuthPageState<WalletUnlockPage> {
|
|||
if (state is IsExecutingState) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
// null duration to make it indefinite until its disposed
|
||||
_authBar =
|
||||
createBar<void>(S.of(context).authentication, duration: null)
|
||||
..show(context);
|
||||
_authBar = createBar<void>(S.of(context).authentication, duration: null)..show(context);
|
||||
});
|
||||
}
|
||||
|
||||
if (state is FailureState) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
dismissFlushBar(_authBar);
|
||||
showBar<void>(
|
||||
context, S.of(context).failed_authentication(state.error));
|
||||
showBar<void>(context, S.of(context).failed_authentication(state.error));
|
||||
|
||||
widget.onAuthenticationFinished(false, this);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
_passwordControllerListener = () => widget.walletUnlockViewModel.setPassword(_passwordController.text);
|
||||
|
||||
_passwordControllerListener =
|
||||
() => widget.walletUnlockViewModel.setPassword(_passwordController.text);
|
||||
|
||||
if (_passwordControllerListener != null) {
|
||||
_passwordController.addListener(_passwordControllerListener!);
|
||||
_passwordController.addListener(_passwordControllerListener!);
|
||||
}
|
||||
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_reaction?.reaction.dispose();
|
||||
|
||||
|
||||
if (_passwordControllerListener != null) {
|
||||
_passwordController.removeListener(_passwordControllerListener!);
|
||||
_passwordController.removeListener(_passwordControllerListener!);
|
||||
}
|
||||
|
||||
super.dispose();
|
||||
|
@ -96,8 +90,7 @@ class WalletUnlockPageState extends AuthPageState<WalletUnlockPage> {
|
|||
@override
|
||||
void changeProcessText(String text) {
|
||||
dismissFlushBar(_authBar);
|
||||
_progressBar = createBar<void>(text, duration: null)
|
||||
..show(_key.currentContext!);
|
||||
_progressBar = createBar<void>(text, duration: null)..show(_key.currentContext!);
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -134,83 +127,92 @@ class WalletUnlockPageState extends AuthPageState<WalletUnlockPage> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
key: _key,
|
||||
appBar: CupertinoNavigationBar(
|
||||
leading: widget.closable
|
||||
? Container(
|
||||
padding: EdgeInsets.only(top: 10),
|
||||
child: SizedBox(
|
||||
height: 37,
|
||||
width: 37,
|
||||
child: InkWell(
|
||||
onTap: () => Navigator.of(context).pop(),
|
||||
child: _backArrowImageDarkTheme,
|
||||
),
|
||||
))
|
||||
: Container(),
|
||||
backgroundColor: Theme.of(context).colorScheme.background,
|
||||
border: null),
|
||||
resizeToAvoidBottomInset: false,
|
||||
body: Center(
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(maxWidth: ResponsiveLayoutUtil.kDesktopMaxWidthConstraint),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(widget.walletUnlockViewModel.walletName,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).primaryTextTheme.titleLarge!.color!)),
|
||||
SizedBox(height: 24),
|
||||
Form(
|
||||
child: TextFormField(
|
||||
onChanged: (value) => null,
|
||||
controller: _passwordController,
|
||||
key: _key,
|
||||
appBar: CupertinoNavigationBar(
|
||||
leading: widget.closable
|
||||
? Container(
|
||||
padding: EdgeInsets.only(top: 10),
|
||||
child: SizedBox(
|
||||
height: 37,
|
||||
width: 37,
|
||||
child: InkWell(
|
||||
onTap: () => Navigator.of(context).pop(),
|
||||
child: _backArrowImageDarkTheme,
|
||||
),
|
||||
))
|
||||
: Container(),
|
||||
backgroundColor: Theme.of(context).colorScheme.background,
|
||||
border: null),
|
||||
resizeToAvoidBottomInset: false,
|
||||
body: Center(
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: ResponsiveLayoutUtil.kDesktopMaxWidthConstraint,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
widget.walletUnlockViewModel.walletName,
|
||||
textAlign: TextAlign.center,
|
||||
obscureText: true,
|
||||
style: TextStyle(
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 24),
|
||||
Form(
|
||||
child: TextFormField(
|
||||
onChanged: (value) => null,
|
||||
controller: _passwordController,
|
||||
textAlign: TextAlign.center,
|
||||
obscureText: true,
|
||||
style: TextStyle(
|
||||
fontSize: 20.0,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Theme.of(context).primaryTextTheme.titleLarge!.color!),
|
||||
decoration: InputDecoration(
|
||||
hintStyle: TextStyle(
|
||||
color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 18.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).accentTextTheme.displayMedium!.color!),
|
||||
hintText: S.of(context).enter_wallet_password,
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
color: Theme.of(context).extension<NewWalletTheme>()!.hintTextColor,
|
||||
),
|
||||
hintText: S.of(context).enter_wallet_password,
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Theme.of(context)
|
||||
.accentTextTheme
|
||||
.displayMedium!
|
||||
.decorationColor!,
|
||||
width: 1.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Theme.of(context)
|
||||
.accentTextTheme
|
||||
.displayMedium!
|
||||
.decorationColor!,
|
||||
width: 1.0),
|
||||
)
|
||||
)))])),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(bottom: 24),
|
||||
child: Observer(
|
||||
builder: (_) =>
|
||||
LoadingPrimaryButton(
|
||||
color: Theme.of(context).extension<NewWalletTheme>()!.underlineColor,
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Theme.of(context).extension<NewWalletTheme>()!.underlineColor,
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(bottom: 24),
|
||||
child: Observer(
|
||||
builder: (_) => LoadingPrimaryButton(
|
||||
onPressed: () async {
|
||||
if (widget.authPasswordHandler != null) {
|
||||
try {
|
||||
await widget.authPasswordHandler!(widget
|
||||
.walletUnlockViewModel.password);
|
||||
await widget
|
||||
.authPasswordHandler!(widget.walletUnlockViewModel.password);
|
||||
widget.walletUnlockViewModel.success();
|
||||
} catch (e) {
|
||||
widget.walletUnlockViewModel.failure(e);
|
||||
|
@ -224,8 +226,13 @@ class WalletUnlockPageState extends AuthPageState<WalletUnlockPage> {
|
|||
color: Colors.green,
|
||||
textColor: Colors.white,
|
||||
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 <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 <url_launcher_linux/url_launcher_plugin.h>
|
||||
|
||||
|
@ -18,6 +19,9 @@ void fl_register_plugins(FlPluginRegistry* registry) {
|
|||
g_autoptr(FlPluginRegistrar) devicelocale_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "DevicelocalePlugin");
|
||||
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 =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "PlatformDeviceIdLinuxPlugin");
|
||||
platform_device_id_linux_plugin_register_with_registrar(platform_device_id_linux_registrar);
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
list(APPEND FLUTTER_PLUGIN_LIST
|
||||
cw_monero
|
||||
devicelocale
|
||||
flutter_secure_storage_linux
|
||||
platform_device_id_linux
|
||||
url_launcher_linux
|
||||
)
|
||||
|
|
|
@ -9,6 +9,7 @@ import connectivity_plus_macos
|
|||
import cw_monero
|
||||
import device_info_plus
|
||||
import devicelocale
|
||||
import flutter_secure_storage_macos
|
||||
import in_app_review
|
||||
import package_info_plus
|
||||
import path_provider_foundation
|
||||
|
@ -17,13 +18,14 @@ import platform_device_id_macos
|
|||
import share_plus_macos
|
||||
import shared_preferences_foundation
|
||||
import url_launcher_macos
|
||||
import wakelock_macos
|
||||
import wakelock_plus
|
||||
|
||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||
ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin"))
|
||||
CwMoneroPlugin.register(with: registry.registrar(forPlugin: "CwMoneroPlugin"))
|
||||
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
|
||||
DevicelocalePlugin.register(with: registry.registrar(forPlugin: "DevicelocalePlugin"))
|
||||
FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin"))
|
||||
InAppReviewPlugin.register(with: registry.registrar(forPlugin: "InAppReviewPlugin"))
|
||||
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
|
||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||
|
@ -32,5 +34,5 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
|||
SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin"))
|
||||
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
||||
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
|
||||
local_auth: ^2.1.0
|
||||
local_auth_android: 1.0.21
|
||||
package_info_plus: ^3.1.0
|
||||
package_info_plus: ^4.1.0
|
||||
devicelocale:
|
||||
git:
|
||||
url: https://github.com/cake-tech/flutter-devicelocale
|
||||
|
@ -60,7 +60,7 @@ dependencies:
|
|||
device_display_brightness: ^0.0.6
|
||||
workmanager: ^0.5.1
|
||||
platform_device_id: ^1.0.1
|
||||
wakelock: ^0.6.2
|
||||
wakelock_plus: ^1.1.1
|
||||
flutter_mailer: ^2.0.2
|
||||
device_info_plus: 8.1.0
|
||||
base32: 2.1.3
|
||||
|
|
|
@ -20,8 +20,8 @@ Future<void> main(List<String> args) async {
|
|||
await generateMonero(hasMonero);
|
||||
await generateHaven(hasHaven);
|
||||
await generateEthereum(hasEthereum);
|
||||
await generatePubspec(hasMonero: hasMonero, hasBitcoin: hasBitcoin, hasHaven: hasHaven, hasFlutterSecureStorage: !excludeFlutterSecureStorage);
|
||||
await generateWalletTypes(hasMonero: hasMonero, hasBitcoin: hasBitcoin, hasHaven: hasHaven);
|
||||
await generatePubspec(hasMonero: hasMonero, hasBitcoin: hasBitcoin, hasHaven: hasHaven, hasEthereum: hasEthereum, hasFlutterSecureStorage: !excludeFlutterSecureStorage);
|
||||
await generateWalletTypes(hasMonero: hasMonero, hasBitcoin: hasBitcoin, hasHaven: hasHaven, hasEthereum: hasEthereum);
|
||||
await injectSecureStorage(!excludeFlutterSecureStorage);
|
||||
}
|
||||
|
||||
|
@ -579,8 +579,8 @@ Future<void> generatePubspec({
|
|||
git:
|
||||
url: https://github.com/cake-tech/flutter_secure_storage.git
|
||||
path: flutter_secure_storage
|
||||
ref: cake-6.0.0
|
||||
version: 6.0.0
|
||||
ref: cake-8.0.0
|
||||
version: 8.0.0
|
||||
""";
|
||||
const cwEthereum = """
|
||||
cw_ethereum:
|
||||
|
|
Loading…
Reference in a new issue