-
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
626476a
commit f3b6fd5
Showing
10 changed files
with
153 additions
and
11 deletions.
There are no files selected for viewing
100 changes: 100 additions & 0 deletions
100
catalyst_voices/lib/pages/account/creation/task_picture.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,100 @@ | ||
import 'package:catalyst_voices_assets/catalyst_voices_assets.dart'; | ||
import 'package:catalyst_voices_brands/catalyst_voices_brands.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
enum TaskPictureType { | ||
normal, | ||
success, | ||
error; | ||
|
||
Color _foregroundColor(ThemeData theme) { | ||
return switch (this) { | ||
// TODO(damian-molinski): Color should come from colors scheme | ||
TaskPictureType.normal => const Color(0xFF0C288D), | ||
TaskPictureType.success => theme.colors.successContainer!, | ||
TaskPictureType.error => theme.colors.errorContainer!, | ||
}; | ||
} | ||
|
||
Color _backgroundColor(ThemeData theme) { | ||
return switch (this) { | ||
// TODO(damian-molinski): Color should come from colors scheme | ||
TaskPictureType.normal => const Color(0xFFCCE2FF), | ||
TaskPictureType.success => theme.colors.success!, | ||
TaskPictureType.error => theme.colorScheme.error, | ||
}; | ||
} | ||
} | ||
|
||
class TaskKeychainPicture extends StatelessWidget { | ||
final TaskPictureType type; | ||
|
||
const TaskKeychainPicture({ | ||
super.key, | ||
this.type = TaskPictureType.normal, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return TaskPicture( | ||
child: TaskPictureIconBox( | ||
type: type, | ||
child: VoicesAssets.images.keychain.buildIcon(allowSize: false), | ||
), | ||
); | ||
} | ||
} | ||
|
||
class TaskPicture extends StatelessWidget { | ||
final Widget child; | ||
|
||
const TaskPicture({ | ||
super.key, | ||
required this.child, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Stack( | ||
alignment: Alignment.topRight, | ||
children: [ | ||
CatalystImage.asset(VoicesAssets.images.taskIllustration.path), | ||
child, | ||
], | ||
); | ||
} | ||
} | ||
|
||
class TaskPictureIconBox extends StatelessWidget { | ||
final TaskPictureType type; | ||
final Widget child; | ||
|
||
const TaskPictureIconBox({ | ||
super.key, | ||
this.type = TaskPictureType.normal, | ||
required this.child, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final theme = Theme.of(context); | ||
|
||
final foregroundColor = type._foregroundColor(theme); | ||
final backgroundColor = type._backgroundColor(theme); | ||
|
||
final iconThemeData = IconThemeData(color: foregroundColor); | ||
|
||
return IconTheme( | ||
data: iconThemeData, | ||
child: Container( | ||
constraints: BoxConstraints.tight(const Size.square(125)), | ||
decoration: BoxDecoration( | ||
color: backgroundColor, | ||
shape: BoxShape.circle, | ||
), | ||
alignment: Alignment.center, | ||
child: child, | ||
), | ||
); | ||
} | ||
} |
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
Binary file added
BIN
+32.3 KB
catalyst_voices/packages/catalyst_voices_assets/assets/images/2.0x/task_illustration.webp
Binary file not shown.
Binary file added
BIN
+38.3 KB
catalyst_voices/packages/catalyst_voices_assets/assets/images/3.0x/task_illustration.webp
Binary file not shown.
22 changes: 22 additions & 0 deletions
22
catalyst_voices/packages/catalyst_voices_assets/assets/images/keychain.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.2 KB
catalyst_voices/packages/catalyst_voices_assets/assets/images/task_illustration.webp
Binary file not shown.
27 changes: 18 additions & 9 deletions
27
catalyst_voices/packages/catalyst_voices_assets/lib/generated/assets.gen.dart
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
catalyst_voices/packages/catalyst_voices_assets/lib/generated/colors.gen.dart
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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