forked from firka/firka
fix: apply title formatting for subject names
This commit is contained in:
@@ -290,12 +290,6 @@ extension StringExtension on String {
|
|||||||
return regex.hasMatch(trim());
|
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]) {
|
String shortenName([int start = 0]) {
|
||||||
if (length <= 16 || start >= length) {
|
if (length <= 16 || start >= length) {
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
@@ -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 {
|
extension MidnightExtension on DateTime {
|
||||||
DateTime getMidnight() {
|
DateTime getMidnight() {
|
||||||
return subtract(
|
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:firka_common/data/models/subject_cache_model.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
@@ -34,7 +35,7 @@ class GradeSmallCard extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
subject.name,
|
subject.name.firstUpper(),
|
||||||
style: appStyle.fonts.B_16SB.apply(
|
style: appStyle.fonts.B_16SB.apply(
|
||||||
color: appStyle.colors.textPrimary,
|
color: appStyle.colors.textPrimary,
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user