Skip to content

Commit

Permalink
#170 improved lightmode
Browse files Browse the repository at this point in the history
  • Loading branch information
DevKevYT committed Apr 28, 2022
1 parent d8517d8 commit 1bb2e6c
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 33 deletions.
14 changes: 7 additions & 7 deletions lib/core/api/models/timetable.day.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,31 @@ class TimeTableDay {
switch (_date.weekday) {
case 1:
_dayName = "Montag";
_shortDayName = "Mo";
_shortDayName = "Mo.";
break;
case 2:
_dayName = "Dienstag";
_shortDayName = "Di";
_shortDayName = "Di.";
break;
case 3:
_dayName = "Mittwoch";
_shortDayName = "Mi";
_shortDayName = "Mi.";
break;
case 4:
_dayName = "Donnerstag";
_shortDayName = "Do";
_shortDayName = "Do.";
break;
case 5:
_dayName = "Freitag";
_shortDayName = "Fr";
_shortDayName = "Fr.";
break;
case 6:
_dayName = "Samstag";
_shortDayName = "Sa";
_shortDayName = "Sa.";
break;
case 7:
_dayName = "Sonntag";
_shortDayName = "So";
_shortDayName = "So.";
break;
default:
"";
Expand Down
1 change: 1 addition & 0 deletions lib/core/service/time_table.service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class TimeTableService with ChangeNotifier {
isLoading = true;
notifyListeners();

//apiManager = SOLCApiManager(await getServerAddress(), 6969);
apiManager = SOLCApiManager(await getServerAddress(), 6969);

apiManager!.getVersion().then(
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/screens/settings/settings.screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ class SettingsScreen extends ConsumerWidget {
" bis " +
Utils.convertToDDMM(validator.getBlockEnd())
: "Phasierung geladen für Block ? - ?",
style: TextStyle(fontSize: 13, color: theme.colors.background),
style: TextStyle(fontSize: 13, color: theme.colors.textInverted),
),
),
),
Expand Down
8 changes: 6 additions & 2 deletions lib/ui/screens/teacher_classes/teacher_classes.screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ class _TeacherClassesScreenState extends ConsumerState<TeacherClassesScreen> {
showClearButton: true,
clearOnSubmit: false,
buildDefaultAppBar: (BuildContext context) {
final theme = ref.watch(themeService).theme;

return AppBar(
title: const Text("Meine Klassen"),
backgroundColor: theme.colors.primary,
actions: [
searchString == ""
? searchBar.getSearchAction(context)
Expand All @@ -65,7 +68,8 @@ class _TeacherClassesScreenState extends ConsumerState<TeacherClassesScreen> {

List<Widget> list = [];
List<SchoolClass> allClassesAsTeacher = await _timeTableService.session.getClassesAsTeacher(checkRange: 2);
List<SchoolClass> ownClassesAsTeacher = await _timeTableService.session.getOwnClassesAsClassteacher();
List<SchoolClass> ownClassesAsTeacher =
await _timeTableService.session.getOwnClassesAsClassteacher(simulateTeacher: "CAG");

if (searchString != "") {
allClassesAsTeacher = allClassesAsTeacher
Expand All @@ -81,7 +85,7 @@ class _TeacherClassesScreenState extends ConsumerState<TeacherClassesScreen> {
padding: EdgeInsets.fromLTRB(20, 20, 20.0, 5),
child: Center(
child: AutoSizeText(
"Ihre Klassen als Klassenlehrer:in",
"Ihre Klassen als Klassenleitung",
style: TextStyle(fontSize: 20),
maxLines: 1,
overflow: TextOverflow.ellipsis,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ class _TeacherClassCardState extends ConsumerState<TeacherClassCard> {
: IconButton(
icon: const Icon(Icons.cloud_upload_rounded),
iconSize: 30,
color: theme.colors.textInverted,
onPressed: () async {
FilePickerResult? result = await FilePicker.platform.pickFiles(
type: FileType.custom,
Expand Down Expand Up @@ -356,6 +357,7 @@ class _TeacherClassCardState extends ConsumerState<TeacherClassCard> {
: Icon(
Icons.adaptive.arrow_forward_rounded,
size: 30,
color: theme.colors.textInverted,
),
],
),
Expand Down
8 changes: 4 additions & 4 deletions lib/ui/screens/time_table/time_table.screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class TimeTableScreen extends ConsumerWidget {
CustomTimeTableCard(
child: Icon(
Icons.calendar_today_rounded,
color: theme.colors.icon,
color: theme.colors.textInverted,
),
color: theme.colors.timetableCardEdge,
),
Expand Down Expand Up @@ -244,14 +244,14 @@ class TimeTableScreen extends ConsumerWidget {
_timeTableService.getTimeTable();
},
icon: const Icon(Icons.today),
tooltip: "Spring zur aktuellen Woche",
tooltip: "Springe zur aktuellen Woche",
)
],
),
drawer: const CustomDrawer(),
body: LiquidPullToRefresh(
showChildOpacityTransition: false,
color: theme.colors.primary,
color: theme.colors.timetableBackground,
backgroundColor: Colors.white,
onRefresh: () async {
ref.read(timeTableService).session.clearManagerCache();
Expand Down Expand Up @@ -287,7 +287,7 @@ class TimeTableScreen extends ConsumerWidget {
}
},
child: Container(
color: theme.colors.background,
color: theme.colors.timetableBackground,
child: (_timeTable == null)
? Center(
child: CircularProgressIndicator(
Expand Down
5 changes: 3 additions & 2 deletions lib/ui/screens/time_table/widgets/custom_time_table_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ class CustomTimeTableCard extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
return Card(
elevation: child != null ? 3 : 0,
elevation: child != null ? 5 : 0,
shadowColor: child != null ? Colors.black : null,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10.0)),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(7.0)),
color: color,
margin: const EdgeInsets.all(2),
child: Center(child: child),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@ class CustomTimeTableDayCard extends ConsumerWidget {
final theme = ref.watch(themeService).theme;

return Card(
elevation: 3,
elevation: 5,
shadowColor: Colors.black,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10.0)),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(7.0)),
color: (cardColor ?? theme.colors.primary),
margin: const EdgeInsets.all(2),
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(timeTableDay.getShortName(), style: TextStyle(color: theme.colors.text)),
Text(timeTableDay.getFormattedDate(), style: TextStyle(color: theme.colors.text)),
Text(timeTableDay.getShortName(), style: TextStyle(color: theme.colors.textInverted)),
Text(timeTableDay.getFormattedDate(), style: TextStyle(color: theme.colors.textInverted)),
],
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ class CustomTimeTableHourCard extends ConsumerWidget {
int hour = timeTableHour.yIndex + 1;

return Card(
elevation: 3,
elevation: 5,
shadowColor: Colors.black,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10.0)),
color: customColor ?? theme.colors.primary,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(7.0)),
color: customColor ?? theme.colors.elementBackground,
margin: const EdgeInsets.all(2),
child: Padding(
padding: const EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 5.0),
child: Column(
Expand All @@ -33,7 +34,7 @@ class CustomTimeTableHourCard extends ConsumerWidget {
timeTableHour.getStartTimeString(),
maxLines: 1,
overflow: TextOverflow.fade,
style: TextStyle(color: theme.colors.text),
style: TextStyle(color: theme.colors.textInverted),
),
),
),
Expand All @@ -42,7 +43,7 @@ class CustomTimeTableHourCard extends ConsumerWidget {
child: Center(
child: Text(
hour.toString(),
style: TextStyle(color: theme.colors.text),
style: TextStyle(color: theme.colors.textInverted),
),
),
),
Expand All @@ -52,7 +53,7 @@ class CustomTimeTableHourCard extends ConsumerWidget {
alignment: Alignment.bottomRight,
child: Text(
timeTableHour.getEndTimeString(),
style: TextStyle(color: theme.colors.text),
style: TextStyle(color: theme.colors.textInverted),
),
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class TimeTableDetailScreen extends ConsumerWidget {
body: ListView(
children: [
Padding(
padding: const EdgeInsets.all(10.0),
padding: const EdgeInsets.fromLTRB(10, 10, 10.0, 0),
child: Card(
elevation: 10,
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.vertical(top: Radius.circular(10))),
Expand Down Expand Up @@ -80,7 +80,7 @@ class TimeTableDetailScreen extends ConsumerWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AutoSizeText(
"Lehrer: ${_timeTableHour.teacher.longName}",
"Lehrkraft: ${_timeTableHour.teacher.longName}",
style: TextStyle(color: theme.colors.textInverted, fontSize: 17),
maxLines: 1,
overflow: TextOverflow.clip,
Expand Down Expand Up @@ -132,13 +132,14 @@ class TimeTableDetailScreen extends ConsumerWidget {
),
_timeTableHour.lessionInformation.isNotEmpty
? Padding(
padding: const EdgeInsets.fromLTRB(5, 5, 5, 20),
padding: const EdgeInsets.fromLTRB(10, 2, 10, 20),
child: Card(
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.vertical(bottom: Radius.circular(10))),
elevation: 10,
child: Column(
children: [
Container(
color: Colors.black26,
color: theme.colors.elementBackground,
alignment: Alignment.topLeft,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
Expand Down
10 changes: 7 additions & 3 deletions lib/ui/themes/app_colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
class AppColors {
const AppColors({
required this.primary,
required this.timetableBackground,
required this.primaryLight,
required this.background,
required this.elementBackground,
Expand Down Expand Up @@ -50,6 +51,7 @@ class AppColors {
final Color primary;
final Color primaryLight;
final Color background;
final Color timetableBackground;
final Color elementBackground;
final Color errorBackground;
final Color text;
Expand Down Expand Up @@ -95,9 +97,10 @@ class AppColors {

factory AppColors.light() {
return AppColors(
primary: Colors.blue.shade800,
primary: const Color.fromARGB(255, 14, 120, 240),
primaryLight: Colors.red.shade500,
background: const Color.fromARGB(255, 244, 245, 255),
background: const Color.fromARGB(255, 225, 225, 230),
timetableBackground: const Color.fromARGB(255, 201, 201, 211),
elementBackground: Colors.grey.shade600,
errorBackground: Colors.red.shade900,
text: Colors.white,
Expand All @@ -114,7 +117,7 @@ class AppColors {
loginBackgroundGradient1: const Color.fromARGB(255, 13, 43, 177),
loginBackgroundGradient2: const Color.fromARGB(255, 15, 39, 148),
timetableCardBackground: Colors.grey.shade800,
timetableCardEdge: const Color(0xff3d3d3d),
timetableCardEdge: Color.fromARGB(255, 255, 255, 255),
// Phase colors
phaseFree: Colors.green.shade700,
phaseOrienting: Colors.orange.shade700,
Expand Down Expand Up @@ -145,6 +148,7 @@ class AppColors {
primary: Colors.grey.shade900,
primaryLight: Colors.grey.shade800,
background: const Color(0xff2b2e36),
timetableBackground: const Color(0xff2b2e36),
elementBackground: Colors.black,
errorBackground: Colors.red.shade900,
text: Colors.white,
Expand Down

0 comments on commit 1bb2e6c

Please sign in to comment.