Skip to content

Commit

Permalink
refactor(cat-voices): cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dtscalac committed Sep 24, 2024
1 parent 4b3ce3f commit 89767a9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import 'package:catalyst_voices_assets/catalyst_voices_assets.dart';
import 'package:catalyst_voices_localization/catalyst_voices_localization.dart';
import 'package:flutter/material.dart';

// TODO(dtscalac): add content for the screen
/// The initial screen for the link wallet flow during registration.
class LinkWalletIntroDialog extends StatelessWidget {
final VoidCallback onChooseCardanoWallet;
final VoidCallback onSelectWallet;

const LinkWalletIntroDialog({
super.key,
required this.onChooseCardanoWallet,
required this.onSelectWallet,
});

@override
Expand Down Expand Up @@ -53,7 +53,7 @@ class LinkWalletIntroDialog extends StatelessWidget {
const Spacer(),
VoicesFilledButton(
leading: VoicesAssets.icons.wallet.buildIcon(),
onTap: onChooseCardanoWallet,
onTap: onSelectWallet,
child: Text(context.l10n.chooseCardanoWallet),
),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ class _LinkWalletDialogState extends State<LinkWalletDialog> {
Widget build(BuildContext context) {
return switch (_stage) {
LinkWalletStage.intro => LinkWalletIntroDialog(
onChooseCardanoWallet: _onChooseCardanoWallet,
onSelectWallet: _onSelectWallet,
),
LinkWalletStage.selectWallet => SelectWalletDialog(
onSelectedWallet: _onSelectedWallet,
),
};
}

void _onChooseCardanoWallet() {
void _onSelectWallet() {
setState(() {
_stage = LinkWalletStage.selectWallet;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:catalyst_voices_assets/catalyst_voices_assets.dart';
import 'package:catalyst_voices_localization/catalyst_voices_localization.dart';
import 'package:flutter/material.dart';

/// A "Learn More" button that redirects usually to an external content.
class VoicesLearnMoreButton extends StatelessWidget {
final VoidCallback onTap;

Expand Down

0 comments on commit 89767a9

Please sign in to comment.