-
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.
- Loading branch information
1 parent
f90b055
commit 2652655
Showing
8 changed files
with
195 additions
and
68 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
55 changes: 0 additions & 55 deletions
55
catalyst_voices/lib/pages/registration/registration_exit_confirm_dialog.dart
This file was deleted.
Oops, something went wrong.
96 changes: 96 additions & 0 deletions
96
catalyst_voices/lib/pages/registration/widgets/exit_confirm_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,96 @@ | ||
import 'package:catalyst_voices/widgets/widgets.dart'; | ||
import 'package:catalyst_voices_assets/catalyst_voices_assets.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 RecoveryExitConfirmDialog extends StatelessWidget { | ||
const RecoveryExitConfirmDialog({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ExitConfirmDialog( | ||
title: context.l10n.warning, | ||
subtitle: context.l10n.recoveryExitConfirmDialogSubtitle, | ||
content: context.l10n.recoveryExitConfirmDialogContent, | ||
positive: context.l10n.recoveryExitConfirmDialogContinue, | ||
negative: context.l10n.cancelAnyways, | ||
); | ||
} | ||
} | ||
|
||
class RegistrationExitConfirmDialog extends StatelessWidget { | ||
const RegistrationExitConfirmDialog({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ExitConfirmDialog( | ||
title: context.l10n.warning, | ||
subtitle: context.l10n.registrationExitConfirmDialogSubtitle, | ||
content: context.l10n.registrationExitConfirmDialogContent, | ||
positive: context.l10n.registrationExitConfirmDialogContinue, | ||
negative: context.l10n.cancelAnyways, | ||
); | ||
} | ||
} | ||
|
||
class ExitConfirmDialog extends StatelessWidget { | ||
final String title; | ||
final String subtitle; | ||
final String content; | ||
final String positive; | ||
final String negative; | ||
|
||
const ExitConfirmDialog({ | ||
super.key, | ||
required this.title, | ||
required this.subtitle, | ||
required this.content, | ||
required this.positive, | ||
required this.negative, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return VoicesQuestionDialog( | ||
title: Text(title.toUpperCase()), | ||
icon: const _WarningIcon(), | ||
subtitle: Text(subtitle.toUpperCase()), | ||
content: Padding( | ||
padding: const EdgeInsets.only(bottom: 30), | ||
child: Text(content), | ||
), | ||
actions: [ | ||
VoicesQuestionActionItem.negative( | ||
positive, | ||
type: VoicesQuestionActionType.filled, | ||
), | ||
VoicesQuestionActionItem.positive( | ||
negative, | ||
type: VoicesQuestionActionType.text, | ||
), | ||
], | ||
); | ||
} | ||
} | ||
|
||
class _WarningIcon extends StatelessWidget { | ||
const _WarningIcon(); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final theme = Theme.of(context); | ||
final color = theme.colors.iconsError!; | ||
|
||
return VoicesAvatar( | ||
border: Border.all( | ||
color: color, | ||
width: 3, | ||
), | ||
icon: VoicesAssets.icons.exclamation.buildIcon(size: 36), | ||
backgroundColor: Colors.transparent, | ||
foregroundColor: color, | ||
radius: 40, | ||
); | ||
} | ||
} |
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