-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Schedule card #1293
Open
DGoiana
wants to merge
8
commits into
develop
Choose a base branch
from
ui/schedule_card
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Schedule card #1293
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
cf0568e
initial design of schedule card
DGoiana 85deca9
deleting file
DGoiana d0ea8c4
design changes and active mode
DGoiana 04ca6aa
adding clock icon
DGoiana a102c11
adding gradient
DGoiana ad84c07
merging develop
DGoiana 63fd766
fix missing theme text style
DGoiana eaecc82
Merge branch 'develop' into ui/schedule_card
DGoiana File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:phosphor_flutter/phosphor_flutter.dart'; | ||
import 'package:uni_ui/cards/generic_card.dart'; | ||
import 'package:uni_ui/theme.dart'; | ||
|
||
class ScheduleCard extends StatelessWidget { | ||
const ScheduleCard( | ||
{super.key, | ||
required this.name, | ||
required this.acronym, | ||
required this.room, | ||
required this.type, | ||
// required this.badgeColor, | ||
this.isActive = false, | ||
this.teacherName, | ||
this.teacherPhoto}); | ||
|
||
final String name; | ||
final String acronym; | ||
final String room; | ||
final String type; | ||
// final BadgeColors badgeColor; | ||
final bool isActive; | ||
final String? teacherName; | ||
final String? teacherPhoto; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return GenericCard( | ||
gradient: isActive | ||
? RadialGradient( | ||
colors: [ | ||
Color(0xFF280709), | ||
Color(0xFF511515), | ||
], | ||
center: Alignment.topLeft, | ||
radius: 1.5, | ||
stops: [0, 1]) | ||
: null, | ||
key: key, | ||
child: Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: [ | ||
Expanded( | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Row( | ||
children: [ | ||
if (isActive) ...[ | ||
PhosphorIcon( | ||
PhosphorIcons.clock(PhosphorIconsStyle.duotone), | ||
color: Theme.of(context).colorScheme.secondary, | ||
size: 20, | ||
), | ||
SizedBox(width: 5), | ||
], | ||
Text( | ||
acronym, | ||
overflow: TextOverflow.ellipsis, | ||
style: TextStyle( | ||
fontSize: Theme.of(context) | ||
.textTheme | ||
.headlineMedium! | ||
.fontSize, | ||
fontWeight: Theme.of(context) | ||
.textTheme | ||
.headlineMedium! | ||
.fontWeight, | ||
color: isActive | ||
? Theme.of(context).colorScheme.secondary | ||
: Theme.of(context).colorScheme.primary), | ||
vitormpp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
), | ||
const SizedBox(width: 8), //TODO: Create a custom Gap()? | ||
Badge( | ||
label: Text(type), | ||
backgroundColor: BadgeColors.tp, | ||
textColor: Theme.of(context).colorScheme.surface, | ||
), | ||
], | ||
), | ||
Text( | ||
name, | ||
overflow: TextOverflow.ellipsis, | ||
style: TextStyle( | ||
fontSize: | ||
Theme.of(context).textTheme.titleLarge!.fontSize, | ||
fontWeight: | ||
Theme.of(context).textTheme.titleLarge!.fontWeight, | ||
color: isActive | ||
? Theme.of(context).colorScheme.secondary | ||
: Theme.of(context).colorScheme.primary), | ||
), | ||
SizedBox(height: 5), | ||
if (isActive) | ||
Row(children: [ | ||
CircleAvatar( | ||
radius: 15, | ||
backgroundImage: const AssetImage( | ||
'assets/images/profile_placeholder.png', // to change | ||
)), | ||
const SizedBox(width: 8), //TODO: create gap()? | ||
Text(teacherName!, | ||
style: TextStyle( | ||
color: isActive | ||
? Theme.of(context).colorScheme.secondary | ||
: Theme.of(context).colorScheme.primary)), | ||
]) | ||
], | ||
), | ||
), | ||
Column( | ||
children: [ | ||
PhosphorIcon( | ||
PhosphorIcons.mapPin(PhosphorIconsStyle.duotone), | ||
color: isActive | ||
? Theme.of(context).colorScheme.secondary | ||
: Theme.of(context).iconTheme.color, | ||
size: 35, | ||
), | ||
Text(room, | ||
overflow: TextOverflow.ellipsis, | ||
style: TextStyle( | ||
color: isActive | ||
? Theme.of(context).colorScheme.secondary | ||
: Theme.of(context).colorScheme.primary)), | ||
], | ||
) | ||
], | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
teacherPhoto
is not being used