home: fix styling in active lesson
This commit is contained in:
@@ -4,6 +4,7 @@ import 'package:firka/l10n/app_localizations.dart';
|
||||
import 'package:firka/ui/model/style.dart';
|
||||
import 'package:firka/ui/widget/firka_icon.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
|
||||
import '../../../helpers/api/model/timetable.dart';
|
||||
import '../../widget/class_icon.dart';
|
||||
@@ -45,7 +46,7 @@ class LessonBigWidget extends StatelessWidget {
|
||||
padding: EdgeInsets.all(4),
|
||||
child: FirkaIconWidget(
|
||||
FirkaIconType.majesticons, 'cupFilled',
|
||||
color: wearStyle.colors.accent, size: 24),
|
||||
color: appStyle.colors.accent, size: 24),
|
||||
),
|
||||
),
|
||||
Text(l10n.breakTxt,
|
||||
@@ -101,7 +102,7 @@ class LessonBigWidget extends StatelessWidget {
|
||||
padding: EdgeInsets.all(4),
|
||||
child: FirkaIconWidget(
|
||||
FirkaIconType.majesticonsLocal, 'cupFilled',
|
||||
color: wearStyle.colors.accent, size: 24),
|
||||
color: appStyle.colors.accent, size: 24),
|
||||
),
|
||||
),
|
||||
Text(l10n.breakTxt,
|
||||
@@ -181,31 +182,44 @@ class LessonBigWidget extends StatelessWidget {
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Card(
|
||||
// TODO: improve this to match design
|
||||
shadowColor: Colors.transparent,
|
||||
color: appStyle.colors.a15p,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(4),
|
||||
child: Text(lessonNo.toString(),
|
||||
style: appStyle.fonts.B_12R
|
||||
.apply(color: appStyle.colors.secondary)),
|
||||
),
|
||||
),
|
||||
Card(
|
||||
shadowColor: Colors.transparent,
|
||||
color: appStyle.colors.a15p,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(4),
|
||||
child: ClassIconWidget(
|
||||
color: wearStyle.colors.accent,
|
||||
size: 24,
|
||||
uid: lesson!.uid,
|
||||
className: lesson!.name,
|
||||
category: lesson!.subject?.name ?? '',
|
||||
),
|
||||
SizedBox(
|
||||
width: 18,
|
||||
height: 18,
|
||||
child: Stack(
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
"assets/icons/subtract.svg",
|
||||
color: appStyle.colors.a15p,
|
||||
width: 18,
|
||||
height: 18,
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 5),
|
||||
child: Text(lessonNo.toString(),
|
||||
style: appStyle.fonts.B_12R
|
||||
.apply(color: appStyle.colors.secondary)),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Transform.translate(
|
||||
offset: Offset(-4, 0),
|
||||
child: Card(
|
||||
shadowColor: Colors.transparent,
|
||||
color: appStyle.colors.a15p,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(16)),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(4),
|
||||
child: ClassIconWidget(
|
||||
color: appStyle.colors.accent,
|
||||
size: 24,
|
||||
uid: lesson!.uid,
|
||||
className: lesson!.name,
|
||||
category: lesson!.subject?.name ?? '',
|
||||
),
|
||||
),
|
||||
)),
|
||||
Text(lesson!.subject?.name ?? 'N/A',
|
||||
style: appStyle.fonts.B_16SB
|
||||
.apply(color: appStyle.colors.textPrimary)),
|
||||
@@ -287,7 +301,7 @@ class LessonBigWidget extends StatelessWidget {
|
||||
padding: EdgeInsets.all(4),
|
||||
child: FirkaIconWidget(
|
||||
FirkaIconType.majesticonsLocal, 'cupFilled',
|
||||
color: wearStyle.colors.accent, size: 24),
|
||||
color: appStyle.colors.accent, size: 24),
|
||||
),
|
||||
),
|
||||
Text(l10n.breakTxt,
|
||||
|
||||
@@ -17,6 +17,16 @@ class LessonSmallWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var subjectName = lesson.subject?.name ?? 'N/A';
|
||||
if (subjectName.length >= 25) {
|
||||
subjectName = "${subjectName.substring(0, 25 - 3)}...";
|
||||
}
|
||||
|
||||
var roomName = lesson.roomName ?? '?';
|
||||
if (roomName.length >= 8) {
|
||||
roomName = "${roomName.substring(0, 8 - 3)}...";
|
||||
}
|
||||
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
@@ -31,7 +41,7 @@ class LessonSmallWidget extends StatelessWidget {
|
||||
category: lesson.subject?.name ?? '',
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
Text(lesson.subject?.name ?? "N/A",
|
||||
Text(subjectName,
|
||||
style: appStyle.fonts.B_16SB
|
||||
.apply(color: appStyle.colors.textPrimary)),
|
||||
],
|
||||
@@ -41,7 +51,7 @@ class LessonSmallWidget extends StatelessWidget {
|
||||
color: appStyle.colors.a15p,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(4),
|
||||
child: Text(lesson.roomName ?? '?',
|
||||
child: Text(roomName,
|
||||
style: appStyle.fonts.B_12R
|
||||
.apply(color: appStyle.colors.secondary)),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user