From d615059500ac312c96305275d321cee9249c204b Mon Sep 17 00:00:00 2001 From: Vitor Pires Date: Tue, 10 Dec 2024 16:59:11 +0000 Subject: [PATCH] fix: conflicts --- .../uni_ui/lib/cards/course_grade_card.dart | 3 + packages/uni_ui/lib/cards/exam_card.dart | 3 + packages/uni_ui/lib/cards/profile_card.dart | 64 +++++++++++++++++++ packages/uni_ui/lib/cards/service_card.dart | 3 + 4 files changed, 73 insertions(+) create mode 100644 packages/uni_ui/lib/cards/profile_card.dart diff --git a/packages/uni_ui/lib/cards/course_grade_card.dart b/packages/uni_ui/lib/cards/course_grade_card.dart index 297cbd870..f090bb5de 100644 --- a/packages/uni_ui/lib/cards/course_grade_card.dart +++ b/packages/uni_ui/lib/cards/course_grade_card.dart @@ -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, diff --git a/packages/uni_ui/lib/cards/exam_card.dart b/packages/uni_ui/lib/cards/exam_card.dart index 218535a94..4351e9c7d 100644 --- a/packages/uni_ui/lib/cards/exam_card.dart +++ b/packages/uni_ui/lib/cards/exam_card.dart @@ -10,6 +10,7 @@ class ExamCard extends StatelessWidget { required this.acronym, required this.rooms, required this.type, + required this.tooltip, this.startTime, this.isInvisible = false, this.showIcon = true, @@ -20,6 +21,7 @@ class ExamCard extends StatelessWidget { final String acronym; final List rooms; final String type; + final String tooltip; final String? startTime; final bool isInvisible; final bool showIcon; @@ -31,6 +33,7 @@ class ExamCard extends StatelessWidget { opacity: isInvisible ? 0.6 : 1.0, child: GenericCard( key: key, + tooltip: tooltip, child: Row( children: [ Expanded( diff --git a/packages/uni_ui/lib/cards/profile_card.dart b/packages/uni_ui/lib/cards/profile_card.dart new file mode 100644 index 000000000..2b6dd480a --- /dev/null +++ b/packages/uni_ui/lib/cards/profile_card.dart @@ -0,0 +1,64 @@ +import 'package:flutter/material.dart'; +import 'package:phosphor_flutter/phosphor_flutter.dart'; +import 'package:uni_ui/generic_card.dart'; + +class ProfileCard extends StatelessWidget { + const ProfileCard({ + super.key, + required this.label, + required this.content, + required this.tooltip, + this.onClick, + }); + + final String label; + final String content; + 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: [ + Text( + label, + overflow: TextOverflow.ellipsis, + style: Theme.of(context).textTheme.titleSmall!, + ), + Text( + content, + overflow: TextOverflow.ellipsis, + ), + ], + ), + ), + if (onClick != null) + Positioned( + bottom: -4, + right: 2, + child: GestureDetector( + onTap: onClick, + child: Container( + child: PhosphorIcon( + PhosphorIcons.plus(PhosphorIconsStyle.light), + color: Colors.white, + size: 14, + ), + padding: EdgeInsets.all(3.0), + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Theme.of(context).colorScheme.primary, + ), + ), + ), + ), + ], + ); + } +} \ No newline at end of file diff --git a/packages/uni_ui/lib/cards/service_card.dart b/packages/uni_ui/lib/cards/service_card.dart index 83c5f7c45..f38dfcc71 100644 --- a/packages/uni_ui/lib/cards/service_card.dart +++ b/packages/uni_ui/lib/cards/service_card.dart @@ -7,15 +7,18 @@ class ServiceCard extends StatelessWidget { super.key, required this.name, required this.openingHours, + required this.tooltip, }); final String name; final List openingHours; + final String tooltip; @override Widget build(BuildContext context) { return GenericCard( key: key, + tooltip: tooltip, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [