-
Notifications
You must be signed in to change notification settings - Fork 18
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
UC classes page redesign #1438
Open
pedroafmonteiro
wants to merge
15
commits into
ui/redesign
Choose a base branch
from
redesign/uc-classes
base: ui/redesign
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.
+256
−99
Open
UC classes page redesign #1438
Changes from 10 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
ff2a227
Initial version of the uc classes page redesign. Implemented horizont…
pedroafmonteiro 8b5ab29
Merge branch 'ui/redesign' into redesign/uc-classes
pedroafmonteiro 73eceb5
Merge branch 'ui/redesign' into redesign/uc-classes
pedroafmonteiro 410ac05
Class selection done.
pedroafmonteiro 5bfc1de
First version of the students listing. Needs refining.
pedroafmonteiro bc7d39b
Refactor student list display and improve UI layout in course unit cl…
pedroafmonteiro 30661ce
Rename course unit student row widget to course unit student tile for…
pedroafmonteiro d33e36b
Enhance course unit classes view with improved scrolling and selectio…
pedroafmonteiro 24872a3
Refactor class selection logic and improve scrolling behavior in cour…
pedroafmonteiro 87f2126
Refactored
pedroafmonteiro cf9ac93
Add figma_squircle package and updated CourseUnitStudentTile
pedroafmonteiro 16b73d1
Add student number getter utility
pedroafmonteiro e60b577
Fix student number initialization in CourseUnitClassesView
pedroafmonteiro 43a7368
Formatted and improved session provider usage in CourseUnitClassesView
pedroafmonteiro bfc7b95
Merge branch 'ui/redesign' into redesign/uc-classes
pedroafmonteiro 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
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
67 changes: 0 additions & 67 deletions
67
packages/uni_app/lib/view/course_unit_info/widgets/course_unit_student_row.dart
This file was deleted.
Oops, something went wrong.
82 changes: 82 additions & 0 deletions
82
packages/uni_app/lib/view/course_unit_info/widgets/course_unit_student_tile.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,82 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:uni/model/entities/course_units/course_unit_class.dart'; | ||
import 'package:uni/model/providers/startup/profile_provider.dart'; | ||
import 'package:uni/session/flows/base/session.dart'; | ||
import 'package:uni_ui/theme.dart'; | ||
|
||
class CourseUnitStudentTile extends StatelessWidget { | ||
const CourseUnitStudentTile(this.student, this.session, {super.key}); | ||
|
||
final CourseUnitStudent student; | ||
final Session session; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final userImage = ProfileProvider.fetchOrGetCachedProfilePicture( | ||
session, | ||
studentNumber: student.number, | ||
); | ||
return FutureBuilder( | ||
builder: (context, snapshot) { | ||
final names = student.name.split(RegExp(r'\s+')); | ||
final firstName = names.first; | ||
final lastName = names.last; | ||
|
||
return Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
Container( | ||
decoration: ShapeDecoration( | ||
shape: const ContinuousRectangleBorder( | ||
pedroafmonteiro marked this conversation as resolved.
Show resolved
Hide resolved
|
||
borderRadius: BorderRadius.all(Radius.circular(50)), | ||
), | ||
image: DecorationImage( | ||
fit: BoxFit.cover, | ||
image: snapshot.hasData && snapshot.data!.lengthSync() > 0 | ||
? FileImage(snapshot.data!) as ImageProvider | ||
: const AssetImage( | ||
'assets/images/profile_placeholder.png', | ||
), | ||
), | ||
), | ||
child: AspectRatio( | ||
aspectRatio: 1, | ||
child: Container(), | ||
), | ||
), | ||
const SizedBox(height: 8), | ||
LayoutBuilder( | ||
builder: (context, constraints) { | ||
return Container( | ||
width: constraints.maxWidth, | ||
padding: const EdgeInsets.symmetric(horizontal: 4), | ||
child: Column( | ||
children: [ | ||
Text( | ||
firstName, | ||
overflow: TextOverflow.fade, | ||
style: lightTheme.textTheme.titleLarge?.copyWith( | ||
color: grayText, | ||
), | ||
textAlign: TextAlign.center, | ||
), | ||
Text( | ||
lastName, | ||
overflow: TextOverflow.ellipsis, | ||
style: lightTheme.textTheme.titleLarge?.copyWith( | ||
color: grayText, | ||
), | ||
textAlign: TextAlign.center, | ||
), | ||
], | ||
), | ||
); | ||
}, | ||
), | ||
], | ||
); | ||
}, | ||
future: userImage, | ||
); | ||
} | ||
} |
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.
Care for the
!
operator. Make suresessionProvider.state
is not null.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.
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.
I was referring to the
sessionProvider.state!.username.replaceAll(RegExp(r'\D'), '')
one