-
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 test/voices-main-integration-test
- Loading branch information
Showing
53 changed files
with
2,029 additions
and
451 deletions.
There are no files selected for viewing
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
28 changes: 28 additions & 0 deletions
28
catalyst_voices/lib/pages/registration/create_keychain/create_keychain_panel.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,28 @@ | ||
import 'package:catalyst_voices/pages/registration/create_keychain/stage/stages.dart'; | ||
import 'package:catalyst_voices_models/catalyst_voices_models.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class CreateKeychainPanel extends StatelessWidget { | ||
final CreateKeychainStage stage; | ||
|
||
const CreateKeychainPanel({ | ||
super.key, | ||
required this.stage, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return switch (stage) { | ||
CreateKeychainStage.splash => const SplashPanel(), | ||
CreateKeychainStage.instructions => const InstructionsPanel(), | ||
CreateKeychainStage.seedPhrase || | ||
CreateKeychainStage.checkSeedPhraseInstructions || | ||
CreateKeychainStage.checkSeedPhrase || | ||
CreateKeychainStage.checkSeedPhraseResult || | ||
CreateKeychainStage.unlockPasswordInstructions || | ||
CreateKeychainStage.unlockPasswordCreate || | ||
CreateKeychainStage.created => | ||
const Placeholder(), | ||
}; | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
catalyst_voices/lib/pages/registration/create_keychain/stage/instructions_panel.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,59 @@ | ||
import 'package:catalyst_voices/widgets/widgets.dart'; | ||
import 'package:catalyst_voices_blocs/catalyst_voices_blocs.dart'; | ||
import 'package:catalyst_voices_brands/catalyst_voices_brands.dart'; | ||
import 'package:catalyst_voices_localization/catalyst_voices_localization.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class InstructionsPanel extends StatelessWidget { | ||
const InstructionsPanel({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final theme = Theme.of(context); | ||
final textColor = theme.colors.textOnPrimaryLevel0; | ||
|
||
return Column( | ||
crossAxisAlignment: CrossAxisAlignment.stretch, | ||
children: [ | ||
Text( | ||
context.l10n.accountInstructionsTitle, | ||
style: theme.textTheme.titleMedium?.copyWith(color: textColor), | ||
), | ||
const SizedBox(height: 24), | ||
Text( | ||
context.l10n.accountInstructionsMessage, | ||
style: theme.textTheme.bodyMedium?.copyWith(color: textColor), | ||
), | ||
const Spacer(), | ||
const _Navigation(), | ||
], | ||
); | ||
} | ||
} | ||
|
||
class _Navigation extends StatelessWidget { | ||
const _Navigation(); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Row( | ||
children: [ | ||
Expanded( | ||
child: VoicesBackButton( | ||
onTap: () { | ||
RegistrationBloc.of(context).add(const PreviousStepEvent()); | ||
}, | ||
), | ||
), | ||
const SizedBox(width: 10), | ||
Expanded( | ||
child: VoicesNextButton( | ||
onTap: () { | ||
RegistrationBloc.of(context).add(const NextStepEvent()); | ||
}, | ||
), | ||
), | ||
], | ||
); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
catalyst_voices/lib/pages/registration/create_keychain/stage/splash_panel.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,37 @@ | ||
import 'package:catalyst_voices/widgets/widgets.dart'; | ||
import 'package:catalyst_voices_blocs/catalyst_voices_blocs.dart'; | ||
import 'package:catalyst_voices_brands/catalyst_voices_brands.dart'; | ||
import 'package:catalyst_voices_localization/catalyst_voices_localization.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class SplashPanel extends StatelessWidget { | ||
const SplashPanel({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final theme = Theme.of(context); | ||
final textColor = theme.colors.textOnPrimaryLevel0; | ||
|
||
return Column( | ||
crossAxisAlignment: CrossAxisAlignment.stretch, | ||
children: [ | ||
Text( | ||
context.l10n.accountCreationSplashTitle, | ||
style: theme.textTheme.titleMedium?.copyWith(color: textColor), | ||
), | ||
const SizedBox(height: 24), | ||
Text( | ||
context.l10n.accountCreationSplashMessage, | ||
style: theme.textTheme.bodyMedium?.copyWith(color: textColor), | ||
), | ||
const Spacer(), | ||
VoicesFilledButton( | ||
child: Text(context.l10n.accountCreationSplashNextButton), | ||
onTap: () { | ||
RegistrationBloc.of(context).add(const NextStepEvent()); | ||
}, | ||
), | ||
], | ||
); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
catalyst_voices/lib/pages/registration/create_keychain/stage/stages.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,2 @@ | ||
export 'instructions_panel.dart'; | ||
export 'splash_panel.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
109 changes: 109 additions & 0 deletions
109
catalyst_voices/lib/pages/registration/information_panel.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,109 @@ | ||
import 'package:catalyst_voices/widgets/widgets.dart'; | ||
import 'package:catalyst_voices_brands/catalyst_voices_brands.dart'; | ||
import 'package:catalyst_voices_shared/catalyst_voices_shared.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class InformationPanel extends StatelessWidget { | ||
final String title; | ||
final String? subtitle; | ||
final String? body; | ||
final Widget picture; | ||
final double? progress; | ||
|
||
const InformationPanel({ | ||
super.key, | ||
required this.title, | ||
this.subtitle, | ||
this.body, | ||
required this.picture, | ||
this.progress, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
_Header( | ||
title: title, | ||
subtitle: subtitle, | ||
body: body, | ||
), | ||
const SizedBox(height: 12), | ||
Expanded(child: Center(child: picture)), | ||
const SizedBox(height: 12), | ||
_Footer( | ||
progress: progress, | ||
), | ||
], | ||
); | ||
} | ||
} | ||
|
||
class _Header extends StatelessWidget { | ||
final String title; | ||
final String? subtitle; | ||
final String? body; | ||
|
||
const _Header({ | ||
required this.title, | ||
this.subtitle, | ||
this.body, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final theme = Theme.of(context); | ||
final textColor = theme.colors.textOnPrimaryLevel0; | ||
|
||
final subtitle = this.subtitle; | ||
final body = this.body; | ||
|
||
return Column( | ||
mainAxisSize: MainAxisSize.min, | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: <Widget>[ | ||
Text( | ||
title, | ||
style: theme.textTheme.titleLarge?.copyWith(color: textColor), | ||
), | ||
if (subtitle != null) | ||
Text( | ||
subtitle, | ||
style: theme.textTheme.titleMedium?.copyWith(color: textColor), | ||
), | ||
if (body != null) | ||
Text( | ||
body, | ||
style: theme.textTheme.bodyMedium?.copyWith(color: textColor), | ||
), | ||
].separatedBy(const SizedBox(height: 12)).toList(), | ||
); | ||
} | ||
} | ||
|
||
class _Footer extends StatelessWidget { | ||
final double? progress; | ||
|
||
const _Footer({ | ||
this.progress, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final progress = this.progress; | ||
|
||
return Column( | ||
mainAxisSize: MainAxisSize.min, | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Offstage( | ||
offstage: progress == null, | ||
child: VoicesLinearProgressIndicator(value: progress ?? 0), | ||
), | ||
const SizedBox(height: 10), | ||
VoicesLearnMoreButton(onTap: () {}), | ||
], | ||
); | ||
} | ||
} |
Oops, something went wrong.