diff --git a/catalyst_voices/lib/pages/account/creation/get_started/account_create_dialog.dart b/catalyst_voices/lib/pages/account/creation/get_started/account_create_dialog.dart index 93aa2a90ea..ea69f13db6 100644 --- a/catalyst_voices/lib/pages/account/creation/get_started/account_create_dialog.dart +++ b/catalyst_voices/lib/pages/account/creation/get_started/account_create_dialog.dart @@ -66,7 +66,7 @@ class _LeftPanel extends StatelessWidget { const Expanded(child: Center(child: TaskKeychainPicture())), const SizedBox(height: 32), // TODO(damian-molinski): External url redirect - LearnMoreButton(onTap: () {}), + VoicesLearnMoreButton(onTap: () {}), ], ); } diff --git a/catalyst_voices/lib/pages/registration/link_wallet/intro/link_wallet_intro_dialog.dart b/catalyst_voices/lib/pages/registration/link_wallet/intro/link_wallet_intro_dialog.dart new file mode 100644 index 0000000000..066cc83863 --- /dev/null +++ b/catalyst_voices/lib/pages/registration/link_wallet/intro/link_wallet_intro_dialog.dart @@ -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), + ), + ], + ), + ); + } +} diff --git a/catalyst_voices/lib/pages/registration/link_wallet/link_wallet_dialog.dart b/catalyst_voices/lib/pages/registration/link_wallet/link_wallet_dialog.dart new file mode 100644 index 0000000000..edfd4312ec --- /dev/null +++ b/catalyst_voices/lib/pages/registration/link_wallet/link_wallet_dialog.dart @@ -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 show({required BuildContext context}) { + return VoicesDialog.show( + context: context, + routeSettings: const RouteSettings(name: '/register/link-wallet'), + builder: (context) => const LinkWalletDialog._(), + ); + } + + @override + State createState() => _LinkWalletDialogState(); +} + +class _LinkWalletDialogState extends State { + 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 + } +} diff --git a/catalyst_voices/lib/pages/registration/link_wallet/link_wallet_stage.dart b/catalyst_voices/lib/pages/registration/link_wallet/link_wallet_stage.dart new file mode 100644 index 0000000000..4ca59a842e --- /dev/null +++ b/catalyst_voices/lib/pages/registration/link_wallet/link_wallet_stage.dart @@ -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, +} diff --git a/catalyst_voices/lib/pages/registration/link_wallet/select_wallet/select_wallet_dialog.dart b/catalyst_voices/lib/pages/registration/link_wallet/select_wallet/select_wallet_dialog.dart new file mode 100644 index 0000000000..6799dafcff --- /dev/null +++ b/catalyst_voices/lib/pages/registration/link_wallet/select_wallet/select_wallet_dialog.dart @@ -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 onSelectedWallet; + + const SelectWalletDialog({ + super.key, + required this.onSelectedWallet, + }); + + @override + Widget build(BuildContext context) { + return const VoicesDesktopPanelsDialog( + left: Column( + children: [], + ), + right: Column( + children: [], + ), + ); + } +} diff --git a/catalyst_voices/lib/widgets/buttons/voices_buttons.dart b/catalyst_voices/lib/widgets/buttons/voices_buttons.dart index 9de9cf6589..a12419eb16 100644 --- a/catalyst_voices/lib/widgets/buttons/voices_buttons.dart +++ b/catalyst_voices/lib/widgets/buttons/voices_buttons.dart @@ -149,19 +149,20 @@ class MoreOptionsButton extends StatelessWidget { } } -class LearnMoreButton extends StatelessWidget { - final VoidCallback? onTap; +/// A "Learn More" button that redirects usually to an external content. +class VoicesLearnMoreButton extends StatelessWidget { + final VoidCallback onTap; - const LearnMoreButton({ + const VoicesLearnMoreButton({ super.key, - this.onTap, + required this.onTap, }); @override Widget build(BuildContext context) { return VoicesTextButton( - onTap: onTap, trailing: VoicesAssets.icons.externalLink.buildIcon(), + onTap: onTap, child: Text(context.l10n.learnMore), ); } diff --git a/catalyst_voices/packages/catalyst_voices_brands/lib/src/themes/catalyst.dart b/catalyst_voices/packages/catalyst_voices_brands/lib/src/themes/catalyst.dart index 1e76d0c85a..4c4c7efd64 100644 --- a/catalyst_voices/packages/catalyst_voices_brands/lib/src/themes/catalyst.dart +++ b/catalyst_voices/packages/catalyst_voices_brands/lib/src/themes/catalyst.dart @@ -302,6 +302,7 @@ ThemeData _buildThemeData( final textTheme = _buildTextTheme(voicesColorScheme); return ThemeData( + visualDensity: VisualDensity.standard, appBarTheme: AppBarTheme( backgroundColor: voicesColorScheme.onSurfaceNeutralOpaqueLv1, scrolledUnderElevation: 0, diff --git a/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations.dart b/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations.dart index 068867fa49..a35785803a 100644 --- a/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations.dart +++ b/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations.dart @@ -664,6 +664,42 @@ abstract class VoicesLocalizations { /// **'Good password strength'** String get goodPasswordStrength; + /// A button label to select a cardano wallet. + /// + /// In en, this message translates to: + /// **'Choose Cardano Wallet'** + String get chooseCardanoWallet; + + /// A label on a clickable element that can show more content. + /// + /// In en, this message translates to: + /// **'Learn More'** + String get learnMore; + + /// A header in link wallet flow in registration. + /// + /// In en, this message translates to: + /// **'Link keys to your Catalyst Keychain'** + String get walletLink_header; + + /// A subheader in link wallet flow in registration. + /// + /// In en, this message translates to: + /// **'Link your Cardano wallet'** + String get walletLink_subheader; + + /// A title in link wallet flow on intro screen. + /// + /// In en, this message translates to: + /// **'Link Cardano Wallet & Catalyst Roles to you Catalyst Keychain.'** + String get walletLink_intro_title; + + /// A message (content) in link wallet flow on intro screen. + /// + /// In en, this message translates to: + /// **'You\'re almost there! This is the final and most important step in your account setup.\n\nWe\'re going to link a Cardano Wallet to your Catalyst Keychain, so you can start collecting Role Keys.\n\nRole Keys allow you to enter new spaces, discover new ways to participate, and unlock new ways to earn rewards.\n\nWe\'ll start with your Voter Key by default. You can decide to add a Proposer Key and Drep key if you want, or you can always add them later.'** + String get walletLink_intro_content; + /// No description provided for @accountCreationCreate. /// /// In en, this message translates to: @@ -682,12 +718,6 @@ abstract class VoicesLocalizations { /// **'On this device'** String get accountCreationOnThisDevice; - /// General string used as external link text buttons - /// - /// In en, this message translates to: - /// **'Learn more'** - String get learnMore; - /// No description provided for @accountCreationGetStartedTitle. /// /// In en, this message translates to: diff --git a/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_en.dart b/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_en.dart index 95373db3a9..e8a6c7e7fd 100644 --- a/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_en.dart +++ b/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_en.dart @@ -346,6 +346,24 @@ class VoicesLocalizationsEn extends VoicesLocalizations { @override String get goodPasswordStrength => 'Good password strength'; + @override + String get chooseCardanoWallet => 'Choose Cardano Wallet'; + + @override + String get learnMore => 'Learn More'; + + @override + String get walletLink_header => 'Link keys to your Catalyst Keychain'; + + @override + String get walletLink_subheader => 'Link your Cardano wallet'; + + @override + String get walletLink_intro_title => 'Link Cardano Wallet & Catalyst Roles to you Catalyst Keychain.'; + + @override + String get walletLink_intro_content => 'You\'re almost there! This is the final and most important step in your account setup.\n\nWe\'re going to link a Cardano Wallet to your Catalyst Keychain, so you can start collecting Role Keys.\n\nRole Keys allow you to enter new spaces, discover new ways to participate, and unlock new ways to earn rewards.\n\nWe\'ll start with your Voter Key by default. You can decide to add a Proposer Key and Drep key if you want, or you can always add them later.'; + @override String get accountCreationCreate => 'Create a new 
Catalyst Keychain'; @@ -355,9 +373,6 @@ class VoicesLocalizationsEn extends VoicesLocalizations { @override String get accountCreationOnThisDevice => 'On this device'; - @override - String get learnMore => 'Learn more'; - @override String get accountCreationGetStartedTitle => 'Welcome to Catalyst'; diff --git a/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_es.dart b/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_es.dart index b5ed461ce8..2b10c965db 100644 --- a/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_es.dart +++ b/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_es.dart @@ -346,6 +346,24 @@ class VoicesLocalizationsEs extends VoicesLocalizations { @override String get goodPasswordStrength => 'Good password strength'; + @override + String get chooseCardanoWallet => 'Choose Cardano Wallet'; + + @override + String get learnMore => 'Learn More'; + + @override + String get walletLink_header => 'Link keys to your Catalyst Keychain'; + + @override + String get walletLink_subheader => 'Link your Cardano wallet'; + + @override + String get walletLink_intro_title => 'Link Cardano Wallet & Catalyst Roles to you Catalyst Keychain.'; + + @override + String get walletLink_intro_content => 'You\'re almost there! This is the final and most important step in your account setup.\n\nWe\'re going to link a Cardano Wallet to your Catalyst Keychain, so you can start collecting Role Keys.\n\nRole Keys allow you to enter new spaces, discover new ways to participate, and unlock new ways to earn rewards.\n\nWe\'ll start with your Voter Key by default. You can decide to add a Proposer Key and Drep key if you want, or you can always add them later.'; + @override String get accountCreationCreate => 'Create a new 
Catalyst Keychain'; @@ -355,9 +373,6 @@ class VoicesLocalizationsEs extends VoicesLocalizations { @override String get accountCreationOnThisDevice => 'On this device'; - @override - String get learnMore => 'Learn more'; - @override String get accountCreationGetStartedTitle => 'Welcome to Catalyst'; diff --git a/catalyst_voices/packages/catalyst_voices_localization/lib/l10n/intl_en.arb b/catalyst_voices/packages/catalyst_voices_localization/lib/l10n/intl_en.arb index cf5e05d6c1..e15b1f68e2 100644 --- a/catalyst_voices/packages/catalyst_voices_localization/lib/l10n/intl_en.arb +++ b/catalyst_voices/packages/catalyst_voices_localization/lib/l10n/intl_en.arb @@ -426,16 +426,36 @@ "@goodPasswordStrength": { "description": "Describes a password that is strong." }, + "chooseCardanoWallet": "Choose Cardano Wallet", + "@chooseCardanoWallet": { + "description": "A button label to select a cardano wallet." + }, + "learnMore": "Learn More", + "@learnMore": { + "description": "A label on a clickable element that can show more content." + }, + "walletLink_header": "Link keys to your Catalyst Keychain", + "@walletLink_header": { + "description": "A header in link wallet flow in registration." + }, + "walletLink_subheader": "Link your Cardano wallet", + "@walletLink_subheader": { + "description": "A subheader in link wallet flow in registration." + }, + "walletLink_intro_title": "Link Cardano Wallet & Catalyst Roles to you Catalyst Keychain.", + "@walletLink_intro_title": { + "description": "A title in link wallet flow on intro screen." + }, + "walletLink_intro_content": "You're almost there! This is the final and most important step in your account setup.\n\nWe're going to link a Cardano Wallet to your Catalyst Keychain, so you can start collecting Role Keys.\n\nRole Keys allow you to enter new spaces, discover new ways to participate, and unlock new ways to earn rewards.\n\nWe'll start with your Voter Key by default. You can decide to add a Proposer Key and Drep key if you want, or you can always add them later.", + "@walletLink_intro_content": { + "description": "A message (content) in link wallet flow on intro screen." + }, "accountCreationCreate": "Create a new \u2028Catalyst Keychain", "accountCreationRecover": "Recover your\u2028Catalyst Keychain", "accountCreationOnThisDevice": "On this device", "@accountCreationOnThisDevice": { "description": "Indicates that created keychain will be stored in this device only" }, - "learnMore": "Learn more", - "@learnMore": { - "description": "General string used as external link text buttons" - }, "accountCreationGetStartedTitle": "Welcome to Catalyst", "accountCreationGetStatedDesc": "If you already have a Catalyst keychain you can restore it on this device, or you can create a new Catalyst Keychain.", "accountCreationGetStatedWhatNext": "What do you want to do?" diff --git a/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/README.md b/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/README.md index af110d7dab..3a1ec3c2ff 100644 --- a/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/README.md +++ b/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/README.md @@ -123,7 +123,7 @@ Transaction _buildUnsignedTx({ final txOutput = TransactionOutput( address: preprodFaucetAddress, - amount: const Value(coin: Coin(1000000)), + amount: const Balance(coin: Coin(1000000)), ); final txBuilder = TransactionBuilder( diff --git a/catalyst_voices_packages/catalyst_cardano_serialization/README.md b/catalyst_voices_packages/catalyst_cardano_serialization/README.md index 8188f53185..e9c6c10e71 100644 --- a/catalyst_voices_packages/catalyst_cardano_serialization/README.md +++ b/catalyst_voices_packages/catalyst_cardano_serialization/README.md @@ -91,7 +91,7 @@ void main() { 'addr_test1qpu5vlrf4xkxv2qpwngf6cjhtw542ayty80v8dyr49rf5ewvxwdrt70' 'qlcpeeagscasafhffqsxy36t90ldv06wqrk2qum8x5w', ), - amount: const Value(coin: Coin(10162333)), + amount: const Balance(coin: Coin(10162333)), ), ); @@ -99,12 +99,12 @@ void main() { address: ShelleyAddress.fromBech32( 'addr_test1vzpwq95z3xyum8vqndgdd9mdnmafh3djcxnc6jemlgdmswcve6tkw', ), - amount: const Value(coin: Coin(1000000)), + amount: const Balance(coin: Coin(1000000)), ); final txBuilder = TransactionBuilder( config: txBuilderConfig, - inputs: [utxo], + inputs: {utxo}, // fee can be left empty so that it's auto calculated or can be hardcoded // fee: const Coin(1000000), ttl: const SlotBigNum(410021),