fix: apply title formatting for subject names

This commit is contained in:
checkedear
2026-09-07 15:13:50 +02:00
parent 93b1d78fd2
commit fff41d95d7
3 changed files with 10 additions and 7 deletions

View File

@@ -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;

View File

@@ -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(

View File

@@ -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,
),