Skip to content

Commit

Permalink
🚸 Add week duration to course widget.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexV525 committed Feb 19, 2020
1 parent 5c0938d commit a9b4145
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lib/pages/home/course_schedule_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,8 @@ class CourseWidget extends StatelessWidget {
style: TextStyle(fontWeight: FontWeight.w600),
),
if (course.name.length > 10) TextSpan(text: '...'),
if (!course.isCustom)
TextSpan(text: '\n${course.startWeek}-${course.endWeek}周'),
if (course.location != null) TextSpan(text: '\n📍${course.location}'),
],
style: Theme.of(context).textTheme.body1.copyWith(
Expand Down Expand Up @@ -755,6 +757,19 @@ class _CoursesDialogState extends State<CoursesDialog> {
),
textAlign: TextAlign.center,
),
if (!widget.courseList[index].isCustom)
Text(
'📅 '
'${widget.courseList[index].startWeek}'
'-'
'${widget.courseList[index].endWeek}'
'周',
style: TextStyle(
color: Colors.black,
fontSize: suSetSp(24.0),
height: 1.5,
),
),
if (widget.courseList[index].location != null)
Text(
'📍${widget.courseList[index].location}',
Expand All @@ -768,6 +783,12 @@ class _CoursesDialogState extends State<CoursesDialog> {
),
),
),
Positioned(
left: 0.0,
right: 0.0,
bottom: 0.0,
child: Icon(Icons.more_horiz),
),
],
);

Expand Down

0 comments on commit a9b4145

Please sign in to comment.