fix mobile keys switch

This commit is contained in:
julian 2024-07-04 15:27:38 -06:00
parent eebe1df050
commit 810981dd40

View file

@ -89,10 +89,10 @@ class WalletBackupView extends ConsumerWidget {
padding: const EdgeInsets.all(10), padding: const EdgeInsets.all(10),
child: CustomTextButton( child: CustomTextButton(
text: switch (keyData.runtimeType) { text: switch (keyData.runtimeType) {
XPrivData() => "xpriv(s)", const (XPrivData) => "xpriv(s)",
CWKeyData() => "keys", const (CWKeyData) => "keys",
Type() => throw UnimplementedError( _ => throw UnimplementedError(
"Don't forget to add your KeyDataInterface here!", "Don't forget to add your KeyDataInterface here! ${keyData.runtimeType}",
), ),
}, },
onTap: () { onTap: () {
@ -469,9 +469,9 @@ class MobileKeyDataView extends StatelessWidget {
), ),
title: Text( title: Text(
"Wallet ${switch (keyData.runtimeType) { "Wallet ${switch (keyData.runtimeType) {
XPrivData() => "xpriv(s)", const (XPrivData) => "xpriv(s)",
CWKeyData() => "keys", const (CWKeyData) => "keys",
Type() => throw UnimplementedError( _ => throw UnimplementedError(
"Don't forget to add your KeyDataInterface here!", "Don't forget to add your KeyDataInterface here!",
), ),
}}", }}",
@ -491,15 +491,15 @@ class MobileKeyDataView extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: switch (keyData.runtimeType) { child: switch (keyData.runtimeType) {
XPrivData() => WalletXPrivs( const (XPrivData) => WalletXPrivs(
walletId: walletId, walletId: walletId,
xprivData: keyData as XPrivData, xprivData: keyData as XPrivData,
), ),
CWKeyData() => CNWalletKeys( const (CWKeyData) => CNWalletKeys(
walletId: walletId, walletId: walletId,
cwKeyData: keyData as CWKeyData, cwKeyData: keyData as CWKeyData,
), ),
Type() => throw UnimplementedError( _ => throw UnimplementedError(
"Don't forget to add your KeyDataInterface here!", "Don't forget to add your KeyDataInterface here!",
), ),
}, },