-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix/task_picture_scaling
- Loading branch information
Showing
12 changed files
with
267 additions
and
4 deletions.
There are no files selected for viewing
62 changes: 62 additions & 0 deletions
62
catalyst_voices/lib/pages/registration/link_wallet/intro/link_wallet_intro_dialog.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import 'package:catalyst_voices/pages/account/creation/task_picture.dart'; | ||
import 'package:catalyst_voices/widgets/widgets.dart'; | ||
import 'package:catalyst_voices_assets/catalyst_voices_assets.dart'; | ||
import 'package:catalyst_voices_localization/catalyst_voices_localization.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
/// The initial screen for the link wallet flow during registration. | ||
class LinkWalletIntroDialog extends StatelessWidget { | ||
final VoidCallback onSelectWallet; | ||
|
||
const LinkWalletIntroDialog({ | ||
super.key, | ||
required this.onSelectWallet, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return VoicesDesktopPanelsDialog( | ||
left: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Text( | ||
context.l10n.walletLink_header, | ||
style: Theme.of(context).textTheme.titleLarge, | ||
), | ||
const SizedBox(height: 12), | ||
Text( | ||
context.l10n.walletLink_subheader, | ||
style: Theme.of(context).textTheme.titleMedium, | ||
), | ||
const SizedBox(height: 50), | ||
const TaskKeychainPicture(), | ||
const Spacer(), | ||
VoicesLearnMoreButton( | ||
onTap: () {}, | ||
), | ||
], | ||
), | ||
right: Column( | ||
crossAxisAlignment: CrossAxisAlignment.stretch, | ||
children: [ | ||
const SizedBox(height: 24), | ||
Text( | ||
context.l10n.walletLink_intro_title, | ||
style: Theme.of(context).textTheme.titleMedium, | ||
), | ||
const SizedBox(height: 24), | ||
Text( | ||
context.l10n.walletLink_intro_content, | ||
style: Theme.of(context).textTheme.bodyMedium, | ||
), | ||
const Spacer(), | ||
VoicesFilledButton( | ||
leading: VoicesAssets.icons.wallet.buildIcon(), | ||
onTap: onSelectWallet, | ||
child: Text(context.l10n.chooseCardanoWallet), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
catalyst_voices/lib/pages/registration/link_wallet/link_wallet_dialog.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import 'package:catalyst_cardano/catalyst_cardano.dart'; | ||
import 'package:catalyst_voices/pages/registration/link_wallet/intro/link_wallet_intro_dialog.dart'; | ||
import 'package:catalyst_voices/pages/registration/link_wallet/link_wallet_stage.dart'; | ||
import 'package:catalyst_voices/pages/registration/link_wallet/select_wallet/select_wallet_dialog.dart'; | ||
import 'package:catalyst_voices/widgets/modals/voices_dialog.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
/// The link wallet flow consisting | ||
/// of [LinkWalletStage]'s during the registration. | ||
class LinkWalletDialog extends StatefulWidget { | ||
const LinkWalletDialog._(); | ||
|
||
/// Shows the [LinkWalletDialog] flow. | ||
static Future<void> show({required BuildContext context}) { | ||
return VoicesDialog.show( | ||
context: context, | ||
routeSettings: const RouteSettings(name: '/register/link-wallet'), | ||
builder: (context) => const LinkWalletDialog._(), | ||
); | ||
} | ||
|
||
@override | ||
State<LinkWalletDialog> createState() => _LinkWalletDialogState(); | ||
} | ||
|
||
class _LinkWalletDialogState extends State<LinkWalletDialog> { | ||
LinkWalletStage _stage = LinkWalletStage.intro; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return switch (_stage) { | ||
LinkWalletStage.intro => LinkWalletIntroDialog( | ||
onSelectWallet: _onSelectWallet, | ||
), | ||
LinkWalletStage.selectWallet => SelectWalletDialog( | ||
onSelectedWallet: _onSelectedWallet, | ||
), | ||
}; | ||
} | ||
|
||
void _onSelectWallet() { | ||
setState(() { | ||
_stage = LinkWalletStage.selectWallet; | ||
}); | ||
} | ||
|
||
void _onSelectedWallet(CardanoWallet wallet) { | ||
// TODO(dtscalac): store selected wallet and proceed to next stage | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
catalyst_voices/lib/pages/registration/link_wallet/link_wallet_stage.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/// Describes the link wallet flow during registration. | ||
enum LinkWalletStage { | ||
/// The welcome screen for the link wallet flow. | ||
intro, | ||
|
||
/// A screen where the user is asked to connect the cardano wallet. | ||
selectWallet, | ||
} |
25 changes: 25 additions & 0 deletions
25
catalyst_voices/lib/pages/registration/link_wallet/select_wallet/select_wallet_dialog.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import 'package:catalyst_cardano/catalyst_cardano.dart'; | ||
import 'package:catalyst_voices/widgets/widgets.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
// TODO(dtscalac): add content for the screen | ||
class SelectWalletDialog extends StatelessWidget { | ||
final ValueChanged<CardanoWallet> onSelectedWallet; | ||
|
||
const SelectWalletDialog({ | ||
super.key, | ||
required this.onSelectedWallet, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return const VoicesDesktopPanelsDialog( | ||
left: Column( | ||
children: [], | ||
), | ||
right: Column( | ||
children: [], | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters