Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ class UnnMobile extends StatelessWidget {
appBarTheme: const AppBarTheme(
scrolledUnderElevation: 3,
backgroundColor: Colors.white,
surfaceTintColor: Colors.transparent,
shadowColor: Colors.black,
),
useMaterial3: true,
colorScheme: ColorScheme.fromSeed(
Expand All @@ -32,8 +30,7 @@ class UnnMobile extends StatelessWidget {
scheduleSubjectHighlight: Color(0xFFFFF6E8),
defaultPostHighlight: Color(0xFFFFFFFF),
importantPostHighlight: Color(0xFFFFE3AF),
newPostHighlight: Color(0xFFFFF6E8),
subjectTypeHighlight: {
scheduleSubjectTypeColors: {
SubjectType.lecture: Color(0xFF1CA49C),
SubjectType.practice: Color(0xFFCD7255),
SubjectType.lab: Color(0xFF0961FF),
Expand All @@ -42,6 +39,7 @@ class UnnMobile extends StatelessWidget {
SubjectType.unknown: Color(0xFF6E757C),
},
ligtherTextColor: Color(0xFF717A84),
idkWhatColor: Color(0xFF989EA9),
),
],
),
Expand Down
66 changes: 0 additions & 66 deletions lib/core/misc/loading_pages.dart

This file was deleted.

41 changes: 21 additions & 20 deletions lib/ui/unn_mobile_colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ class UnnMobileColors extends ThemeExtension<UnnMobileColors> {
final Color? scheduleSubjectHighlight;
final Color? defaultPostHighlight;
final Color? importantPostHighlight;
final Color? newPostHighlight;
final Map<SubjectType, Color>? subjectTypeHighlight;
final Map<SubjectType, Color>? scheduleSubjectTypeColors;
final Color? ligtherTextColor;
final Color? idkWhatColor;

const UnnMobileColors({
required this.scheduleDayHighlight,
required this.scheduleSubjectHighlight,
required this.defaultPostHighlight,
required this.importantPostHighlight,
required this.newPostHighlight,
required this.subjectTypeHighlight,
required this.scheduleSubjectTypeColors,
required this.ligtherTextColor,
required this.idkWhatColor,
});

@override
Expand All @@ -30,9 +30,9 @@ class UnnMobileColors extends ThemeExtension<UnnMobileColors> {
Color? scheduleSubjectHighlight,
Color? defaultPostHighlight,
Color? importantPostHighlight,
Color? newPostHighlight,
Map<SubjectType, Color>? subjectTypeHighlight,
Map<SubjectType, Color>? scheduleSubjectTypeColors,
Color? ligtherTextColor,
Color? idkWhatColor,
}) =>
UnnMobileColors(
scheduleDayHighlight: scheduleDayHighlight ?? this.scheduleDayHighlight,
Expand All @@ -41,9 +41,10 @@ class UnnMobileColors extends ThemeExtension<UnnMobileColors> {
defaultPostHighlight: defaultPostHighlight ?? this.defaultPostHighlight,
importantPostHighlight:
importantPostHighlight ?? this.importantPostHighlight,
newPostHighlight: newPostHighlight ?? this.newPostHighlight,
subjectTypeHighlight: subjectTypeHighlight ?? this.subjectTypeHighlight,
scheduleSubjectTypeColors:
scheduleSubjectTypeColors ?? this.scheduleSubjectTypeColors,
ligtherTextColor: ligtherTextColor ?? this.ligtherTextColor,
idkWhatColor: idkWhatColor ?? this.idkWhatColor,
);

@override
Expand Down Expand Up @@ -78,16 +79,11 @@ class UnnMobileColors extends ThemeExtension<UnnMobileColors> {
otherColors.importantPostHighlight,
t,
),
newPostHighlight: Color.lerp(
newPostHighlight,
otherColors.newPostHighlight,
t,
),
subjectTypeHighlight: Map.fromIterables(
subjectTypeHighlight!.keys,
subjectTypeHighlight!.keys.map((SubjectType key) {
final Color thisColor = subjectTypeHighlight![key]!;
final Color otherColor = otherColors.subjectTypeHighlight![key]!;
scheduleSubjectTypeColors: Map.fromIterables(
scheduleSubjectTypeColors!.keys,
scheduleSubjectTypeColors!.keys.map((SubjectType key) {
final Color thisColor = scheduleSubjectTypeColors![key]!;
final Color otherColor = otherColors.scheduleSubjectTypeColors![key]!;

return Color.lerp(thisColor, otherColor, t) ?? thisColor;
}),
Expand All @@ -97,17 +93,22 @@ class UnnMobileColors extends ThemeExtension<UnnMobileColors> {
otherColors.ligtherTextColor,
t,
),
idkWhatColor: Color.lerp(
idkWhatColor,
otherColors.idkWhatColor,
t,
),
);
}
}

extension ThemeDataExtension on ThemeData {
Color getColorOfSubjectType(SubjectType subjectType) {
final extraColors = extension<UnnMobileColors>()!;
return extraColors.subjectTypeHighlight![subjectType] ?? primaryColor;
return extraColors.scheduleSubjectTypeColors![subjectType] ?? primaryColor;
}

Color getTimeBasedSurfaceColor(
Color getScheduleSurfaceColor(
DateTimeRange dateTimeRange, {
bool isEven = false,
}) {
Expand Down
Loading
Loading