1-
1+ import 'package:bb_mobile/core/utils/build_context_x.dart' ;
2+ import 'package:flutter/material.dart' ;
23import 'package:freezed_annotation/freezed_annotation.dart' ;
34
45part 'bitbox_action.freezed.dart' ;
@@ -13,63 +14,64 @@ sealed class BitBoxAction with _$BitBoxAction {
1314
1415 const BitBoxAction ._();
1516
16- String get title {
17+ String toTitle ( BuildContext context) {
1718 return when (
18- unlockDevice: () => 'Unlock BitBox Device' ,
19- pairDevice: () => 'Pair BitBox Device' ,
20- importWallet: () => 'Import BitBox Wallet' ,
21- signTransaction: () => 'Sign Transaction' ,
22- verifyAddress: () => 'Verify Address on BitBox' ,
19+ unlockDevice: () => context.loc.bitboxActionUnlockDeviceTitle ,
20+ pairDevice: () => context.loc.bitboxActionPairDeviceTitle ,
21+ importWallet: () => context.loc.bitboxActionImportWalletTitle ,
22+ signTransaction: () => context.loc.bitboxActionSignTransactionTitle ,
23+ verifyAddress: () => context.loc.bitboxActionVerifyAddressTitle ,
2324 );
2425 }
2526
26- String get buttonText {
27+ String toButtonText ( BuildContext context) {
2728 return when (
28- unlockDevice: () => 'Unlock Device' ,
29- pairDevice: () => 'Start Pairing' ,
30- importWallet: () => 'Start Import' ,
31- signTransaction: () => 'Start Signing' ,
32- verifyAddress: () => 'Verify Address' ,
29+ unlockDevice: () => context.loc.bitboxActionUnlockDeviceButton ,
30+ pairDevice: () => context.loc.bitboxActionPairDeviceButton ,
31+ importWallet: () => context.loc.bitboxActionImportWalletButton ,
32+ signTransaction: () => context.loc.bitboxActionSignTransactionButton ,
33+ verifyAddress: () => context.loc.bitboxActionVerifyAddressButton ,
3334 );
3435 }
3536
36- String get processingText {
37+ String toProcessingText ( BuildContext context) {
3738 return when (
38- unlockDevice: () => 'Unlocking Device' ,
39- pairDevice: () => 'Pairing Device' ,
40- importWallet: () => 'Importing Wallet' ,
41- signTransaction: () => 'Signing Transaction' ,
42- verifyAddress: () => 'Showing address on BitBox...' ,
39+ unlockDevice: () => context.loc.bitboxActionUnlockDeviceProcessing ,
40+ pairDevice: () => context.loc.bitboxActionPairDeviceProcessing ,
41+ importWallet: () => context.loc.bitboxActionImportWalletProcessing ,
42+ signTransaction: () => context.loc.bitboxActionSignTransactionProcessing ,
43+ verifyAddress: () => context.loc.bitboxActionVerifyAddressProcessing ,
4344 );
4445 }
4546
46- String get successText {
47+ String toSuccessText ( BuildContext context) {
4748 return when (
48- unlockDevice: () => 'Device Unlocked Successfully' ,
49- pairDevice: () => 'Device Paired Successfully' ,
50- importWallet: () => 'Wallet Imported Successfully' ,
51- signTransaction: () => 'Transaction Signed Successfully' ,
52- verifyAddress: () => 'Address Verified Successfully' ,
49+ unlockDevice: () => context.loc.bitboxActionUnlockDeviceSuccess ,
50+ pairDevice: () => context.loc.bitboxActionPairDeviceSuccess ,
51+ importWallet: () => context.loc.bitboxActionImportWalletSuccess ,
52+ signTransaction: () => context.loc.bitboxActionSignTransactionSuccess ,
53+ verifyAddress: () => context.loc.bitboxActionVerifyAddressSuccess ,
5354 );
5455 }
5556
56- String get successSubText {
57+ String toSuccessSubText ( BuildContext context) {
5758 return when (
58- unlockDevice: () => 'Your BitBox device is now unlocked and ready to use.' ,
59- pairDevice: () => 'Your BitBox device is now paired and ready to use.' ,
60- importWallet: () => 'Your BitBox wallet has been imported successfully.' ,
61- signTransaction: () => 'Your transaction has been signed successfully.' ,
62- verifyAddress: () => 'The address has been verified on your BitBox device.' ,
59+ unlockDevice: () => context.loc.bitboxActionUnlockDeviceSuccessSubtext ,
60+ pairDevice: () => context.loc.bitboxActionPairDeviceSuccessSubtext ,
61+ importWallet: () => context.loc.bitboxActionImportWalletSuccessSubtext ,
62+ signTransaction: () => context.loc.bitboxActionSignTransactionSuccessSubtext ,
63+ verifyAddress: () => context.loc.bitboxActionVerifyAddressSuccessSubtext ,
6364 );
6465 }
6566
66- String get processingSubText {
67+ String toProcessingSubText ( BuildContext context) {
6768 return when (
68- unlockDevice: () => 'Please enter your password on the BitBox device...' ,
69- pairDevice: () => 'Please verify the pairing code on your BitBox device...' ,
70- importWallet: () => 'Setting up your watch-only wallet...' ,
71- signTransaction: () => 'Please confirm the transaction on your BitBox device...' ,
72- verifyAddress: () => 'Please confirm the address on your BitBox device.' ,
69+ unlockDevice: () => context.loc.bitboxActionUnlockDeviceProcessingSubtext,
70+ pairDevice: () => context.loc.bitboxActionPairDeviceProcessingSubtext,
71+ importWallet: () => context.loc.bitboxActionImportWalletProcessingSubtext,
72+ signTransaction: () =>
73+ context.loc.bitboxActionSignTransactionProcessingSubtext,
74+ verifyAddress: () => context.loc.bitboxActionVerifyAddressProcessingSubtext,
7375 );
7476 }
7577}
0 commit comments