Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e757d9afd | ||
|
|
fff41d95d7 | ||
|
|
93b1d78fd2 | ||
|
|
717b4b27aa |
@@ -290,12 +290,6 @@ extension StringExtension on String {
|
||||
return regex.hasMatch(trim());
|
||||
}
|
||||
|
||||
String firstUpper() {
|
||||
if (isEmpty) return this;
|
||||
if (length == 1) this[0].toUpperCase();
|
||||
return this[0].toUpperCase() + substring(1, length);
|
||||
}
|
||||
|
||||
String shortenName([int start = 0]) {
|
||||
if (length <= 16 || start >= length) {
|
||||
return this;
|
||||
|
||||
@@ -244,7 +244,7 @@ Future<void> showLessonBottomSheet(
|
||||
color: appStyle.colors.buttonSecondaryFill,
|
||||
),
|
||||
onTap: () {
|
||||
context.go('/timetable/subject', extra: lesson.subject);
|
||||
context.go('/timetable/subject', extra: lesson.subject.loadAndGet()!);
|
||||
},
|
||||
),
|
||||
]);
|
||||
|
||||
@@ -146,6 +146,7 @@ class _HomeMainScreen extends FirkaState<HomeMainScreen> {
|
||||
final todayLesson = widget.data.client!.cache
|
||||
.getClassLessons()
|
||||
.on(now)
|
||||
.sortByStart()
|
||||
.findAllSync();
|
||||
|
||||
for (final item in infoItems) {
|
||||
|
||||
@@ -62,6 +62,10 @@ class OmissionBar extends StatelessWidget {
|
||||
.toList();
|
||||
}
|
||||
|
||||
if (segmentColors.isEmpty) {
|
||||
segmentColors.add(stateColor(null));
|
||||
}
|
||||
|
||||
final bar = ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: Row(
|
||||
|
||||
@@ -18,6 +18,14 @@ extension IterableExtension<T> on Iterable<T> {
|
||||
}
|
||||
}
|
||||
|
||||
extension FirstUpperExtension on String {
|
||||
String firstUpper() {
|
||||
if (isEmpty) return this;
|
||||
if (length == 1) this[0].toUpperCase();
|
||||
return this[0].toUpperCase() + substring(1, length);
|
||||
}
|
||||
}
|
||||
|
||||
extension MidnightExtension on DateTime {
|
||||
DateTime getMidnight() {
|
||||
return subtract(
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:firka_common/core/extensions.dart';
|
||||
import 'package:firka_common/data/models/subject_cache_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@@ -34,7 +35,7 @@ class GradeSmallCard extends StatelessWidget {
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
subject.name,
|
||||
subject.name.firstUpper(),
|
||||
style: appStyle.fonts.B_16SB.apply(
|
||||
color: appStyle.colors.textPrimary,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user