From 726365ed79516cfc9837c0e1e37f61feb773aec0 Mon Sep 17 00:00:00 2001 From: Anubhav Agrawal <56795892+anubhavagr@users.noreply.github.com> Date: Mon, 30 Aug 2021 14:18:29 +0530 Subject: [PATCH 1/7] Create utils.dart Updated as per new offline timetable sem-5 --- lib/utils.dart | 57 +++++++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/lib/utils.dart b/lib/utils.dart index 2e7b35f..cd1afe8 100644 --- a/lib/utils.dart +++ b/lib/utils.dart @@ -7,61 +7,60 @@ import 'models.dart'; void assignTimeTable(String currentDay) { timeTable.clear(); switch (currentDay) { + case "Monday": - timeTable.add(Period("OOPS", 60)); - timeTable.add(Period("DBMS", 60)); - timeTable.add(Period("DM", 60)); + timeTable.add(Period("MP", 60)); + timeTable.add(Period("CN", 60)); + timeTable.add(Period("FLAT", 60)); timeTable.add(Period("Recess", 60)); - timeTable.add(Period("ADA", 60)); - timeTable.add(Period("OOPS Lab", 120)); + timeTable.add(Period("DAP", 60)); + timeTable.add(Period("DAP/MP LAB", 120)); break; case "Tuesday": - timeTable.add(Period("DM", 60)); - timeTable.add(Period("CSA", 60)); - timeTable.add(Period("ADA", 60)); + timeTable.add(Period("E1", 60)); + timeTable.add(Period("MP", 60)); + timeTable.add(Period("CN", 60)); timeTable.add(Period("Recess", 60)); - timeTable.add(Period("OOPS", 60)); - timeTable.add(Period("CSI", 120)); + timeTable.add(Period("FLAT", 60)); + timeTable.add(Period("CN/PROJECT LAB", 120)); break; case "Wednesday": - timeTable.add(Period("OOPS", 60)); - timeTable.add(Period("DM", 60)); - timeTable.add(Period("DBMS", 60)); + timeTable.add(Period("DAP", 60)); + timeTable.add(Period("E1", 60)); + timeTable.add(Period("MP", 60)); timeTable.add(Period("Rececss", 60)); - timeTable.add(Period("CSA", 60)); - timeTable.add(Period("Virtual Lab", 120)); + timeTable.add(Period("CN", 60)); + timeTable.add(Period("EVS", 120)); break; case "Thursday": - timeTable.add(Period("CSA", 60)); - timeTable.add(Period("ADA", 60)); - timeTable.add(Period("OOPS", 60)); + timeTable.add(Period("FLAT", 60)); + timeTable.add(Period("DAP", 60)); + timeTable.add(Period("E1", 60)); timeTable.add(Period("Recess", 60)); - timeTable.add(Period("DM", 60)); - timeTable.add(Period("CSA/HW Lab", 120)); + timeTable.add(Period("MP", 60)); + timeTable.add(Period("PROJECT/CN LAB", 120)); break; case "Friday": - timeTable.add(Period("DBMS", 60)); - timeTable.add(Period("ADA", 60)); - timeTable.add(Period("CSA", 60)); + timeTable.add(Period("CN", 60)); + timeTable.add(Period("FLAT", 60)); + timeTable.add(Period("DAP", 60)); timeTable.add(Period("Recess", 60)); - timeTable.add(Period("DM", 60)); - timeTable.add(Period("DBMS Lab", 120)); + timeTable.add(Period("E1", 60)); + timeTable.add(Period("MP/DAP LAB", 120)); break; case "Saturday": - timeTable.add(Period("ADA", 60)); - timeTable.add(Period("DBMS", 60)); - timeTable.add(Period("CSA", 60)); - timeTable.add(Period("OOPS", 60)); + timeTable.add(Period("Fun-day", 14 * 60)); break; case "Sunday": timeTable.add(Period("Fun-day", 14 * 60)); break; + } setupExactTimes(); } From 677b66d8fad62a27302e68a5304692ceb91932d4 Mon Sep 17 00:00:00 2001 From: Anubhav Agrawal <56795892+anubhavagr@users.noreply.github.com> Date: Tue, 8 Mar 2022 15:48:50 +0530 Subject: [PATCH 2/7] Add files via upload --- utils.dart | 184 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 184 insertions(+) create mode 100644 utils.dart diff --git a/utils.dart b/utils.dart new file mode 100644 index 0000000..d9acd94 --- /dev/null +++ b/utils.dart @@ -0,0 +1,184 @@ +import 'package:flutter/material.dart'; +import 'package:time_table/SizeConfig.dart'; +import 'globals.dart'; +import 'models.dart'; + + +void assignTimeTable(String currentDay) { + timeTable.clear(); + switch (currentDay) { + + case "Monday": + timeTable.add(Period("SEPM", 50)); + timeTable.add(Period("AIES", 50)); + timeTable.add(Period("CNS", 50)); + timeTable.add(Period("IOT", 50)); + timeTable.add(Period("Recess", 50)); + timeTable.add(Period("CD", 50)); + timeTable.add(Period("TCSS", 100)); + break; + + case "Tuesday": + timeTable.add(Period("CNS", 50)); + timeTable.add(Period("IOT", 50)); + timeTable.add(Period("AIES", 50)); + timeTable.add(Period("SEPM", 50)); + timeTable.add(Period("Recess", 50)); + timeTable.add(Period("Android LAB", 150)); + break; + + case "Wednesday": + timeTable.add(Period("AIES", 50)); + timeTable.add(Period("SEPM LAB", 150)); + timeTable.add(Period("Recess", 50)); + timeTable.add(Period("CNS", 50)); + timeTable.add(Period("SEPM", 50)); + timeTable.add(Period("CD", 50)); + break; + + case "Thursday": + timeTable.add(Period("CD", 50)); + timeTable.add(Period("IOT", 50)); + timeTable.add(Period("AIES", 50)); + timeTable.add(Period("CNS", 50)); + timeTable.add(Period("Recess", 50)); + timeTable.add(Period("AIES LAB", 150)); + break; + + case "Friday": + timeTable.add(Period("CD", 50)); + timeTable.add(Period("SEPM", 50)); + timeTable.add(Period("IOT", 50)); + timeTable.add(Period("CNS", 50)); + timeTable.add(Period("Recess", 50)); + timeTable.add(Period("IOT LAB", 150)); + break; + + case "Saturday": + timeTable.add(Period("IOT", 50)); + timeTable.add(Period("CD", 50)); + timeTable.add(Period("SEPM", 50)); + timeTable.add(Period("AIES", 50)); + timeTable.add(Period("LIBRARY", 50)); + + break; + + case "Sunday": + timeTable.add(Period("Fun-day", 14 * 50)); + break; + + } + setupExactTimes(); +} + +// ----------------------------------------------------------------------------- + +String determinePeriod() { + DateTime now = DateTime.now(); + if (now.compareTo(collegeStart) >= 0 && now.compareTo(collegeEnd) <= 0) { + displayTimer = true; + for (Period period in timeTable) { + if (now.compareTo(period.startsAt) >= 0 && + now.compareTo(period.endsAt) <= 0) { + relativeEnding = period.endsAt; + return period.name; + } + } + } + + return "TimeTable"; +} + +// ----------------------------------------------------------------------------- + +void setupExactTimes() { + DateTime tmpTime = collegeStart; + for (Period period in timeTable) { + period.startsAt = tmpTime; + tmpTime = tmpTime.add(Duration(minutes: period.lengthInMinutes)); + period.endsAt = tmpTime; + } +} + +// ----------------------------------------------------------------------------- + +Future asyncDayChooser(BuildContext context) async { + return await showDialog( + context: context, + barrierDismissible: true, + builder: (BuildContext context) { + return SimpleDialog( + title: Text('Choose day', + style: TextStyle( + fontSize: SizeConfig.safeBlockHorizontal * 7, + fontWeight: FontWeight.bold)), + children: [ + SimpleDialogOption( + onPressed: () { + assignTimeTable('Monday'); + todayState.refresh('Monday'); + Navigator.pop(context); + remainingState.refresh(); + }, + child: Text('Monday', + style: TextStyle( + fontSize: SizeConfig.safeBlockHorizontal * 5.5)), + ), + SimpleDialogOption( + onPressed: () { + assignTimeTable('Tuesday'); + todayState.refresh('Tuesday'); + Navigator.pop(context); + remainingState.refresh(); + }, + child: Text('Tuesday', + style: TextStyle( + fontSize: SizeConfig.safeBlockHorizontal * 5.5)), + ), + SimpleDialogOption( + onPressed: () { + assignTimeTable('Wednesday'); + todayState.refresh('Wednesday'); + Navigator.pop(context); + remainingState.refresh(); + }, + child: Text('Wednesday', + style: TextStyle( + fontSize: SizeConfig.safeBlockHorizontal * 5.5)), + ), + SimpleDialogOption( + onPressed: () { + assignTimeTable('Thursday'); + todayState.refresh('Thursday'); + Navigator.pop(context); + remainingState.refresh(); + }, + child: Text('Thursday', + style: TextStyle( + fontSize: SizeConfig.safeBlockHorizontal * 5.5)), + ), + SimpleDialogOption( + onPressed: () { + assignTimeTable('Friday'); + todayState.refresh('Friday'); + Navigator.pop(context); + remainingState.refresh(); + }, + child: Text('Friday', + style: TextStyle( + fontSize: SizeConfig.safeBlockHorizontal * 5.5)), + ), + SimpleDialogOption( + onPressed: () { + assignTimeTable('Saturday'); + todayState.refresh('Saturday'); + Navigator.pop(context); + remainingState.refresh(); + }, + child: Text('Saturday', + style: TextStyle( + fontSize: SizeConfig.safeBlockHorizontal * 5.5))), + ], + ); + }); + From 031f276a1865f50116758bf804a3454a1de27597 Mon Sep 17 00:00:00 2001 From: Anubhav Agrawal <56795892+anubhavagr@users.noreply.github.com> Date: Tue, 8 Mar 2022 15:49:27 +0530 Subject: [PATCH 3/7] Delete utils.dart --- utils.dart | 184 ----------------------------------------------------- 1 file changed, 184 deletions(-) delete mode 100644 utils.dart diff --git a/utils.dart b/utils.dart deleted file mode 100644 index d9acd94..0000000 --- a/utils.dart +++ /dev/null @@ -1,184 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:time_table/SizeConfig.dart'; -import 'globals.dart'; -import 'models.dart'; - - -void assignTimeTable(String currentDay) { - timeTable.clear(); - switch (currentDay) { - - case "Monday": - timeTable.add(Period("SEPM", 50)); - timeTable.add(Period("AIES", 50)); - timeTable.add(Period("CNS", 50)); - timeTable.add(Period("IOT", 50)); - timeTable.add(Period("Recess", 50)); - timeTable.add(Period("CD", 50)); - timeTable.add(Period("TCSS", 100)); - break; - - case "Tuesday": - timeTable.add(Period("CNS", 50)); - timeTable.add(Period("IOT", 50)); - timeTable.add(Period("AIES", 50)); - timeTable.add(Period("SEPM", 50)); - timeTable.add(Period("Recess", 50)); - timeTable.add(Period("Android LAB", 150)); - break; - - case "Wednesday": - timeTable.add(Period("AIES", 50)); - timeTable.add(Period("SEPM LAB", 150)); - timeTable.add(Period("Recess", 50)); - timeTable.add(Period("CNS", 50)); - timeTable.add(Period("SEPM", 50)); - timeTable.add(Period("CD", 50)); - break; - - case "Thursday": - timeTable.add(Period("CD", 50)); - timeTable.add(Period("IOT", 50)); - timeTable.add(Period("AIES", 50)); - timeTable.add(Period("CNS", 50)); - timeTable.add(Period("Recess", 50)); - timeTable.add(Period("AIES LAB", 150)); - break; - - case "Friday": - timeTable.add(Period("CD", 50)); - timeTable.add(Period("SEPM", 50)); - timeTable.add(Period("IOT", 50)); - timeTable.add(Period("CNS", 50)); - timeTable.add(Period("Recess", 50)); - timeTable.add(Period("IOT LAB", 150)); - break; - - case "Saturday": - timeTable.add(Period("IOT", 50)); - timeTable.add(Period("CD", 50)); - timeTable.add(Period("SEPM", 50)); - timeTable.add(Period("AIES", 50)); - timeTable.add(Period("LIBRARY", 50)); - - break; - - case "Sunday": - timeTable.add(Period("Fun-day", 14 * 50)); - break; - - } - setupExactTimes(); -} - -// ----------------------------------------------------------------------------- - -String determinePeriod() { - DateTime now = DateTime.now(); - if (now.compareTo(collegeStart) >= 0 && now.compareTo(collegeEnd) <= 0) { - displayTimer = true; - for (Period period in timeTable) { - if (now.compareTo(period.startsAt) >= 0 && - now.compareTo(period.endsAt) <= 0) { - relativeEnding = period.endsAt; - return period.name; - } - } - } - - return "TimeTable"; -} - -// ----------------------------------------------------------------------------- - -void setupExactTimes() { - DateTime tmpTime = collegeStart; - for (Period period in timeTable) { - period.startsAt = tmpTime; - tmpTime = tmpTime.add(Duration(minutes: period.lengthInMinutes)); - period.endsAt = tmpTime; - } -} - -// ----------------------------------------------------------------------------- - -Future asyncDayChooser(BuildContext context) async { - return await showDialog( - context: context, - barrierDismissible: true, - builder: (BuildContext context) { - return SimpleDialog( - title: Text('Choose day', - style: TextStyle( - fontSize: SizeConfig.safeBlockHorizontal * 7, - fontWeight: FontWeight.bold)), - children: [ - SimpleDialogOption( - onPressed: () { - assignTimeTable('Monday'); - todayState.refresh('Monday'); - Navigator.pop(context); - remainingState.refresh(); - }, - child: Text('Monday', - style: TextStyle( - fontSize: SizeConfig.safeBlockHorizontal * 5.5)), - ), - SimpleDialogOption( - onPressed: () { - assignTimeTable('Tuesday'); - todayState.refresh('Tuesday'); - Navigator.pop(context); - remainingState.refresh(); - }, - child: Text('Tuesday', - style: TextStyle( - fontSize: SizeConfig.safeBlockHorizontal * 5.5)), - ), - SimpleDialogOption( - onPressed: () { - assignTimeTable('Wednesday'); - todayState.refresh('Wednesday'); - Navigator.pop(context); - remainingState.refresh(); - }, - child: Text('Wednesday', - style: TextStyle( - fontSize: SizeConfig.safeBlockHorizontal * 5.5)), - ), - SimpleDialogOption( - onPressed: () { - assignTimeTable('Thursday'); - todayState.refresh('Thursday'); - Navigator.pop(context); - remainingState.refresh(); - }, - child: Text('Thursday', - style: TextStyle( - fontSize: SizeConfig.safeBlockHorizontal * 5.5)), - ), - SimpleDialogOption( - onPressed: () { - assignTimeTable('Friday'); - todayState.refresh('Friday'); - Navigator.pop(context); - remainingState.refresh(); - }, - child: Text('Friday', - style: TextStyle( - fontSize: SizeConfig.safeBlockHorizontal * 5.5)), - ), - SimpleDialogOption( - onPressed: () { - assignTimeTable('Saturday'); - todayState.refresh('Saturday'); - Navigator.pop(context); - remainingState.refresh(); - }, - child: Text('Saturday', - style: TextStyle( - fontSize: SizeConfig.safeBlockHorizontal * 5.5))), - ], - ); - }); - From 228915b1b964acef4b555d862b708dd156d10634 Mon Sep 17 00:00:00 2001 From: Anubhav Agrawal <56795892+anubhavagr@users.noreply.github.com> Date: Tue, 8 Mar 2022 15:52:03 +0530 Subject: [PATCH 4/7] Update utils.dart Sec A, Sem 6 --- lib/utils.dart | 73 +++++++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 33 deletions(-) diff --git a/lib/utils.dart b/lib/utils.dart index cd1afe8..5a0a006 100644 --- a/lib/utils.dart +++ b/lib/utils.dart @@ -8,59 +8,66 @@ void assignTimeTable(String currentDay) { timeTable.clear(); switch (currentDay) { - case "Monday": - timeTable.add(Period("MP", 60)); - timeTable.add(Period("CN", 60)); - timeTable.add(Period("FLAT", 60)); - timeTable.add(Period("Recess", 60)); - timeTable.add(Period("DAP", 60)); - timeTable.add(Period("DAP/MP LAB", 120)); +case "Monday": + timeTable.add(Period("SEPM", 50)); + timeTable.add(Period("AIES", 50)); + timeTable.add(Period("CNS", 50)); + timeTable.add(Period("IOT", 50)); + timeTable.add(Period("Recess", 50)); + timeTable.add(Period("CD", 50)); + timeTable.add(Period("TCSS", 100)); break; case "Tuesday": - timeTable.add(Period("E1", 60)); - timeTable.add(Period("MP", 60)); - timeTable.add(Period("CN", 60)); - timeTable.add(Period("Recess", 60)); - timeTable.add(Period("FLAT", 60)); - timeTable.add(Period("CN/PROJECT LAB", 120)); + timeTable.add(Period("CNS", 50)); + timeTable.add(Period("IOT", 50)); + timeTable.add(Period("AIES", 50)); + timeTable.add(Period("SEPM", 50)); + timeTable.add(Period("Recess", 50)); + timeTable.add(Period("Android LAB", 150)); break; case "Wednesday": - timeTable.add(Period("DAP", 60)); - timeTable.add(Period("E1", 60)); - timeTable.add(Period("MP", 60)); - timeTable.add(Period("Rececss", 60)); - timeTable.add(Period("CN", 60)); - timeTable.add(Period("EVS", 120)); + timeTable.add(Period("AIES", 50)); + timeTable.add(Period("SEPM LAB", 150)); + timeTable.add(Period("Recess", 50)); + timeTable.add(Period("CNS", 50)); + timeTable.add(Period("SEPM", 50)); + timeTable.add(Period("CD", 50)); break; case "Thursday": - timeTable.add(Period("FLAT", 60)); - timeTable.add(Period("DAP", 60)); - timeTable.add(Period("E1", 60)); - timeTable.add(Period("Recess", 60)); - timeTable.add(Period("MP", 60)); - timeTable.add(Period("PROJECT/CN LAB", 120)); + timeTable.add(Period("CD", 50)); + timeTable.add(Period("IOT", 50)); + timeTable.add(Period("AIES", 50)); + timeTable.add(Period("CNS", 50)); + timeTable.add(Period("Recess", 50)); + timeTable.add(Period("AIES LAB", 150)); break; case "Friday": - timeTable.add(Period("CN", 60)); - timeTable.add(Period("FLAT", 60)); - timeTable.add(Period("DAP", 60)); - timeTable.add(Period("Recess", 60)); - timeTable.add(Period("E1", 60)); - timeTable.add(Period("MP/DAP LAB", 120)); + timeTable.add(Period("CD", 50)); + timeTable.add(Period("SEPM", 50)); + timeTable.add(Period("IOT", 50)); + timeTable.add(Period("CNS", 50)); + timeTable.add(Period("Recess", 50)); + timeTable.add(Period("IOT LAB", 150)); break; case "Saturday": - timeTable.add(Period("Fun-day", 14 * 60)); + timeTable.add(Period("IOT", 50)); + timeTable.add(Period("CD", 50)); + timeTable.add(Period("SEPM", 50)); + timeTable.add(Period("AIES", 50)); + timeTable.add(Period("LIBRARY", 50)); + break; case "Sunday": - timeTable.add(Period("Fun-day", 14 * 60)); + timeTable.add(Period("Fun-day", 14 * 50)); break; + } setupExactTimes(); } From c03492409b115cf61fe8fd36df788d5689474de0 Mon Sep 17 00:00:00 2001 From: Anubhav Agrawal <56795892+anubhavagr@users.noreply.github.com> Date: Tue, 8 Mar 2022 15:56:03 +0530 Subject: [PATCH 5/7] Create dart.yml --- .github/workflows/dart.yml | 42 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/dart.yml diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml new file mode 100644 index 0000000..bd08b2f --- /dev/null +++ b/.github/workflows/dart.yml @@ -0,0 +1,42 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Dart + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + # Note: This workflow uses the latest stable version of the Dart SDK. + # You can specify other versions if desired, see documentation here: + # https://github.com/dart-lang/setup-dart/blob/main/README.md + # - uses: dart-lang/setup-dart@v1 + - uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd603 + + - name: Install dependencies + run: dart pub get + + # Uncomment this step to verify the use of 'dart format' on each commit. + # - name: Verify formatting + # run: dart format --output=none --set-exit-if-changed . + + # Consider passing '--fatal-infos' for slightly stricter analysis. + - name: Analyze project source + run: dart analyze + + # Your project will need to have tests in test/ and a dependency on + # package:test for this step to succeed. Note that Flutter projects will + # want to change this to 'flutter test'. + - name: Run tests + run: dart test From b915df084d1a72156c0837270980515577dec981 Mon Sep 17 00:00:00 2001 From: Anubhav Agrawal <56795892+anubhavagr@users.noreply.github.com> Date: Tue, 8 Mar 2022 15:56:13 +0530 Subject: [PATCH 6/7] Delete .github/workflows directory --- .github/workflows/dart.yml | 42 -------------------------------------- 1 file changed, 42 deletions(-) delete mode 100644 .github/workflows/dart.yml diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml deleted file mode 100644 index bd08b2f..0000000 --- a/.github/workflows/dart.yml +++ /dev/null @@ -1,42 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -name: Dart - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - # Note: This workflow uses the latest stable version of the Dart SDK. - # You can specify other versions if desired, see documentation here: - # https://github.com/dart-lang/setup-dart/blob/main/README.md - # - uses: dart-lang/setup-dart@v1 - - uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd603 - - - name: Install dependencies - run: dart pub get - - # Uncomment this step to verify the use of 'dart format' on each commit. - # - name: Verify formatting - # run: dart format --output=none --set-exit-if-changed . - - # Consider passing '--fatal-infos' for slightly stricter analysis. - - name: Analyze project source - run: dart analyze - - # Your project will need to have tests in test/ and a dependency on - # package:test for this step to succeed. Note that Flutter projects will - # want to change this to 'flutter test'. - - name: Run tests - run: dart test From 42976fabd1b3740314f50724fcf0322d71878d38 Mon Sep 17 00:00:00 2001 From: Anubhav Agrawal <56795892+anubhavagr@users.noreply.github.com> Date: Tue, 8 Mar 2022 17:57:08 +0530 Subject: [PATCH 7/7] Update utils.dart --- lib/utils.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/utils.dart b/lib/utils.dart index 5a0a006..4844779 100644 --- a/lib/utils.dart +++ b/lib/utils.dart @@ -67,7 +67,6 @@ case "Monday": timeTable.add(Period("Fun-day", 14 * 50)); break; - } setupExactTimes(); }