Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Commit

Permalink
update theme & show class room
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirari04 committed Nov 7, 2022
1 parent 038b65f commit 2547d5b
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 38 deletions.
20 changes: 10 additions & 10 deletions lib/data_seed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@ class DataSeed {
static Color getCourseColor(String course) {
switch (course.toUpperCase()) {
case "D":
return Color(0xFFD9042B);
return const Color(0xFFD9042B);
case "F":
return Color(0xFF0476D9);
return const Color(0xFF0476D9);
case "G":
return Color(0xFFA6036D);
return const Color(0xFFA6036D);
case "WR":
return Color(0xFFF2B705);
return const Color(0xFFF2B705);
case "TUU":
return Color(0xFFE08424);
return const Color(0xFFE08424);
case "M":
return Color(0xFF0E17E0);
return const Color(0xFF0E17E0);
case "E":
return Color(0xFF5FDE88);
return const Color(0xFF5FDE88);
case "RW":
return Color(0xFFE093DC);
return const Color(0xFFE093DC);
case "S":
return Color(0xFF0DE0DC);
return const Color(0xFF0DE0DC);
default:
return Color.fromARGB(255, 143, 143, 143);
return const Color.fromARGB(255, 143, 143, 143);
}
}
}
88 changes: 60 additions & 28 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,27 @@ class _MyAppState extends State<MyApp> {
DateTime now = DateTime.now();
if (now.isBefore(start)) {
// wait
return const Icon(Icons.timelapse_rounded);
return const Icon(
Icons.timelapse_rounded,
color: Colors.white,
);
} else if (now.isAfter(start) && now.isBefore(end)) {
//pending
return const Icon(Icons.pending_rounded);
return const Icon(
Icons.pending_rounded,
color: Colors.white,
);
} else if (now.isAfter(end)) {
//fin
return const Icon(Icons.done);
return const Icon(
Icons.done,
color: Colors.white,
);
} else {
return const Icon(Icons.error);
return const Icon(
Icons.error,
color: Colors.white,
);
}
}

Expand Down Expand Up @@ -113,29 +125,35 @@ class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
title: '2I Stundenplan',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: Scaffold(
backgroundColor: Colors.black12,
appBar: PreferredSize(
preferredSize: const Size.fromHeight(50),
child: AppBar(
title: Container(
child: Row(
children: [
Expanded(flex: 1, child: Text(data.title)),
Expanded(
flex: 0,
child: Container(
child: (isLoading == true)
? const CircularProgressIndicator(
color: Colors.white,
)
: const SizedBox.shrink(),
))
],
))),
backgroundColor: Colors.black,
title: Row(
children: [
Expanded(
flex: 1,
child: Text(
data.title,
style: const TextStyle(color: Colors.white),
)),
Expanded(
flex: 0,
child: Container(
child: (isLoading == true)
? const CircularProgressIndicator(
color: Colors.white,
)
: const SizedBox.shrink(),
))
],
)),
),
body: Container(
alignment: Alignment.topLeft,
Expand Down Expand Up @@ -182,7 +200,6 @@ class _MyAppState extends State<MyApp> {
int currentPause = 0;
bool showPauseBefore = ((mapIndex * 2) - 1 < 0 ||
lessonTimes.length <= (mapIndex * 2) - 1 ||
lessonTimes[(mapIndex * 2) - 1] == null ||
// check if dif between latest added... time & current ... time
// currentTimestamp - 6e+8 >
// lessonTimes[(mapIndex * 2) - 1] ||
Expand Down Expand Up @@ -236,15 +253,29 @@ class _MyAppState extends State<MyApp> {
)),
title: Row(children: [
/**
* ROW TIME
*/
* ROW TIME
*/
Expanded(
flex: 0,
child: Container(
margin: const EdgeInsets.only(right: 10),
child: Text(
datum.roomName.toString(),
style: const TextStyle(color: Colors.redAccent),
),
)),
/**
* ROW TIME
*/
Expanded(
flex: 1,
child: Text(
"${stingifyTime(parseTime(datum.lessonStart.toString(), datum.lessonDate.toString()))} - ${stingifyTime(parseTime(datum.lessonEnd.toString(), datum.lessonDate.toString()))}")),
"${stingifyTime(parseTime(datum.lessonStart.toString(), datum.lessonDate.toString()))} - ${stingifyTime(parseTime(datum.lessonEnd.toString(), datum.lessonDate.toString()))}",
style: const TextStyle(color: Colors.white),
)),
/**
* ROW STATUS
*/
* ROW STATUS
*/
Expanded(
flex: 0,
child: Row(
Expand All @@ -270,7 +301,7 @@ class _MyAppState extends State<MyApp> {
fontWeight: FontWeight.w600,
color: (isActiveDay == true)
? Colors.green
: Colors.black),
: Colors.white),
)),
listTile
],
Expand All @@ -284,7 +315,8 @@ class _MyAppState extends State<MyApp> {
padding: const EdgeInsets.fromLTRB(20, 10, 20, 10),
width: double.infinity,
child: Text(
"${currentPause} min Pause",
"$currentPause min Pause",
style: const TextStyle(color: Colors.white),
)),
listTile
],
Expand Down

0 comments on commit 2547d5b

Please sign in to comment.