-
Notifications
You must be signed in to change notification settings - Fork 8
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
Showing
30 changed files
with
1,277 additions
and
120 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
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
77 changes: 77 additions & 0 deletions
77
catalyst_voices/apps/voices/lib/widgets/empty_state/empty_state.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,77 @@ | ||
import 'package:catalyst_voices/widgets/images/voices_image_scheme.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 EmptyState extends StatelessWidget { | ||
final String? title; | ||
final String? description; | ||
final Widget? image; | ||
final Widget? imageBackground; | ||
|
||
const EmptyState({ | ||
super.key, | ||
this.title, | ||
this.description, | ||
this.image, | ||
this.imageBackground, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final theme = Theme.of(context); | ||
final textTheme = theme.textTheme; | ||
return Center( | ||
child: Padding( | ||
padding: const EdgeInsets.symmetric(vertical: 64), | ||
child: Column( | ||
children: [ | ||
image ?? | ||
VoicesImagesScheme( | ||
image: CatalystSvgPicture.asset( | ||
VoicesAssets.images.noProposalForeground.path, | ||
), | ||
background: imageBackground ?? | ||
Container( | ||
height: 180, | ||
decoration: BoxDecoration( | ||
color: theme.colors.onSurfaceNeutral08, | ||
shape: BoxShape.circle, | ||
), | ||
), | ||
), | ||
const SizedBox(height: 24), | ||
SizedBox( | ||
width: 430, | ||
child: Column( | ||
children: [ | ||
Text( | ||
_buildTitle(context), | ||
style: textTheme.titleMedium | ||
?.copyWith(color: theme.colors.textOnPrimaryLevel1), | ||
), | ||
const SizedBox(height: 8), | ||
Text( | ||
_buildDescription(context), | ||
style: textTheme.bodyMedium | ||
?.copyWith(color: theme.colors.textOnPrimaryLevel1), | ||
textAlign: TextAlign.center, | ||
), | ||
], | ||
), | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
|
||
String _buildDescription(BuildContext context) { | ||
return description ?? context.l10n.noProposalStateDescription; | ||
} | ||
|
||
String _buildTitle(BuildContext context) { | ||
return title ?? context.l10n.noProposalStateTitle; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
catalyst_voices/apps/voices/lib/widgets/images/voices_image_scheme.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,23 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class VoicesImagesScheme extends StatelessWidget { | ||
final Widget image; | ||
final Widget? background; | ||
|
||
const VoicesImagesScheme({ | ||
super.key, | ||
required this.image, | ||
required this.background, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Stack( | ||
alignment: Alignment.center, | ||
children: [ | ||
if (background != null) background!, | ||
image, | ||
], | ||
); | ||
} | ||
} |
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
Oops, something went wrong.