Skip to content

Commit

Permalink
feat: update cards
Browse files Browse the repository at this point in the history
  • Loading branch information
vitormpp committed Dec 3, 2024
1 parent 38400c3 commit 987e671
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
11 changes: 5 additions & 6 deletions packages/uni_ui/lib/course_grade_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,20 @@ class CourseGradeCard extends StatelessWidget {
{required this.courseName,
required this.ects,
required this.grade,
required this.tooltip,
super.key});

final String courseName;
final double ects;
final double grade;
final String tooltip;

@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return GenericCard(
key: key,
tooltip: tooltip,
child: SizedBox(
width: MediaQuery.of(context).size.width * 0.35,
height: MediaQuery.of(context).size.height * 0.09,
Expand All @@ -32,12 +35,8 @@ class CourseGradeCard extends StatelessWidget {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"${ects} ECTS",
style: theme.textTheme.bodyLarge
),
Text("${grade.toInt()}",
style: theme.textTheme.bodyLarge)
Text("${ects} ECTS", style: theme.textTheme.bodyLarge),
Text("${grade.toInt()}", style: theme.textTheme.bodyLarge)
],
)
],
Expand Down
13 changes: 8 additions & 5 deletions packages/uni_ui/lib/profile/profile_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,22 @@ class ProfileCard extends StatelessWidget {
super.key,
required this.label,
required this.content,
this.tooltip,
required this.tooltip,
this.onClick,
});

final String label;
final String content;
final String? tooltip;
final String tooltip;
final VoidCallback? onClick;

@override
Widget build(BuildContext context) {
return Stack(
clipBehavior: Clip.none,
children: [
GenericCard(
tooltip: tooltip,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expand All @@ -35,12 +38,12 @@ class ProfileCard extends StatelessWidget {
],
),
),
if (tooltip != null)
if (onClick != null)
Positioned(
bottom: -4,
right: 2,
child: Tooltip(
message: tooltip!,
child: GestureDetector(
onTap: onClick,
child: Container(
child: PhosphorIcon(
PhosphorIcons.plus(PhosphorIconsStyle.light),
Expand Down

0 comments on commit 987e671

Please sign in to comment.