diff --git a/lib/constants/common.dart b/lib/constants/common.dart index 150a5ad..e29f06a 100644 --- a/lib/constants/common.dart +++ b/lib/constants/common.dart @@ -5,6 +5,7 @@ import 'package:academia/models/user.dart'; import 'package:flutter/material.dart'; import 'package:hive/hive.dart'; import 'package:magnet/magnet.dart'; +import 'package:get/get.dart'; const String urlPrefix = "https://daystar-backend.onrender.com"; const String dbName = "appDB"; @@ -77,3 +78,18 @@ const TextStyle h6 = TextStyle( fontWeight: FontWeight.bold, fontSize: 15, ); + +void showCustomSnackbar( + String title, + String message, { + IconData? icon, + Color? iconColor, +}) { + Get.snackbar( + title, + message, + colorText: Colors.black, + backgroundColor: Colors.white, + icon: Icon(icon ?? Icons.info), + ); +} diff --git a/lib/constants/tools.dart b/lib/constants/tools.dart index 2971356..cde0df2 100644 --- a/lib/constants/tools.dart +++ b/lib/constants/tools.dart @@ -1,14 +1,5 @@ -import 'package:academia/controllers/settings_controller.dart'; -import 'package:academia/pages/attendance_page.dart'; -import 'package:academia/pages/exams_timetable_page.dart'; -import 'package:academia/pages/fees_page.dart'; -import 'package:academia/pages/gpacalculator_page.dart'; -import 'package:academia/pages/pdf_viewer.dart'; -import 'package:academia/pages/tasks_pages/taskmanager_page.dart'; -import 'package:academia/pages/webview_page.dart'; import 'package:get/get.dart'; -import 'package:flutter/material.dart'; -import 'package:academia/constants/common.dart'; +import 'package:academia/exports/barrel.dart'; final List> allTools = [ { @@ -41,19 +32,18 @@ final List> allTools = [ "ontap": () async { var controller = Get.find(); if (!controller.showFees.value) { - Get.snackbar("Tool locked", + showCustomSnackbar("Tool locked", "Fees functionality is locked in the settings page, please unlock it to view your fees statement", - icon: const Icon(Icons.lock)); + icon: Icons.lock); } else { try { var statements = await magnet.fetchFeeStatement(); Get.to(FeesPage(allStatements: statements)); } catch (e) { - Get.snackbar( + showCustomSnackbar( "Error", "Please check your internet connection and try again!", - icon: const Icon(Icons.network_check), - backgroundColor: Colors.white, + icon: Icons.network_check, ); } } @@ -73,11 +63,10 @@ final List> allTools = [ content: Text("Your Token is ${token['message'] ?? ''}"), ); } catch (e) { - Get.snackbar( + showCustomSnackbar( "Error", "Please check your internet connection and try again!", - icon: const Icon(Icons.network_check), - backgroundColor: Colors.white, + icon: Icons.network_check, ); } }, @@ -91,9 +80,11 @@ final List> allTools = [ "ontap": () async { var controller = Get.find(); if (controller.showAudit.value) { - Get.snackbar("Tool locked", - "Student Audit functionality is locked in the settings page, please unlock it to view your student audit", - icon: const Icon(Icons.lock)); + showCustomSnackbar( + "Tool locked", + "Student Audit functionality is locked in the settings page, please unlock it to view your student audit", + icon: Icons.lock, + ); } else { Get.to(PdfViewer( title: "Your audit", @@ -112,10 +103,10 @@ final List> allTools = [ "ontap": () async { var controller = Get.find(); if (controller.showTranscript.value) { - Get.snackbar( + showCustomSnackbar( "Tool locked", "Transcript functionality is locked in the settings page, please unlock it to view your transcript", - icon: const Icon(Icons.lock), + icon: Icons.lock, ); } else { Get.to(PdfViewer( diff --git a/lib/controllers/courses_page_controller.dart b/lib/controllers/courses_page_controller.dart index 7f17de2..9e4ab8e 100644 --- a/lib/controllers/courses_page_controller.dart +++ b/lib/controllers/courses_page_controller.dart @@ -19,6 +19,8 @@ class CoursesPageController extends GetxController { hasCourses.value = false; return false; } + await appDB.delete("timetable"); + userCourses.clear(); for (var i = 0; i < courses.length; i++) { userCourses.add(Courses.fromJson(courses[i])); diff --git a/lib/controllers/dashboard_controller.dart b/lib/controllers/dashboard_controller.dart index c67092f..806c830 100644 --- a/lib/controllers/dashboard_controller.dart +++ b/lib/controllers/dashboard_controller.dart @@ -36,7 +36,7 @@ class DashboardController extends GetxController { } else if (daypercent > 0.25) { return "Its almost midday☀️"; } - return "Make it or break it while its young!"; + return "The early bird..!"; } String get getWeekPercentQuote { @@ -60,7 +60,7 @@ class DashboardController extends GetxController { } else if (semesterPercent > 0.25) { return "CATS CATS, cats all the way"; } - return "Ready, aim shoot for the sky"; + return "Ready, aim shoot!"; } double get daypercent { diff --git a/lib/controllers/settings_controller.dart b/lib/controllers/settings_controller.dart index 5558692..ee4633e 100644 --- a/lib/controllers/settings_controller.dart +++ b/lib/controllers/settings_controller.dart @@ -1,6 +1,7 @@ import 'package:academia/constants/common.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; +import 'package:shorebird_code_push/shorebird_code_push.dart'; class SettingsController extends GetxController { Rx showGPA = true.obs; @@ -10,7 +11,10 @@ class SettingsController extends GetxController { Rx showAudit = false.obs; Rx showFees = true.obs; Rx birthdayNotify = true.obs; + Rx hasUpdates = false.obs; + Rx patch = "0.0.0".obs; late Map settings; + final ShorebirdCodePush shorebirdCodePush = ShorebirdCodePush(); @override void onInit() async { @@ -25,6 +29,13 @@ class SettingsController extends GetxController { debugPrint("Settings loaded!"); super.onInit(); + + shorebirdCodePush.currentPatchNumber().then((value) { + patch.value = value.toString(); + debugPrint("Current patch number is: $value"); + }); + + checkForUpdates(); } Future saveSettings() async { @@ -37,4 +48,14 @@ class SettingsController extends GetxController { settings["birthday_notify"] = birthdayNotify.value; await appDB.put("settings", settings); } + + Future checkForUpdates() async { + // Check whether a patch is available to install. + hasUpdates.value = await shorebirdCodePush.isNewPatchAvailableForDownload(); + + if (hasUpdates.value) { + // Download the new patch if it's available. + await shorebirdCodePush.downloadUpdateIfAvailable(); + } + } } diff --git a/lib/exports/barrel.dart b/lib/exports/barrel.dart new file mode 100644 index 0000000..912d9b7 --- /dev/null +++ b/lib/exports/barrel.dart @@ -0,0 +1,53 @@ +export 'package:flutter/material.dart'; +export 'package:academia/constants/common.dart'; +export 'package:academia/widgets/academia_app_bar.dart'; +export 'package:academia/controllers/notifications_controller.dart'; +export 'package:percent_indicator/percent_indicator.dart'; +export 'package:academia/widgets/count_down_widget.dart'; +export 'package:academia/widgets/exam_course_card.dart'; +export 'package:academia/controllers/settings_controller.dart'; +export 'package:academia/controllers/taskmanager_controller.dart'; +export 'package:academia/models/courses.dart'; +export 'package:academia/models/schedule.dart'; +export 'package:academia/models/tasks.dart'; +export 'package:academia/models/user.dart'; +export 'package:academia/notifications/notification_service.dart'; +export 'package:academia/pages/home_page.dart'; +export 'package:academia/pages/intro_page.dart'; +export 'package:academia/themes/theme.dart'; +export 'package:hive_flutter/hive_flutter.dart'; +export 'package:magnet/magnet.dart'; +export 'package:loading_animation_widget/loading_animation_widget.dart'; +export 'package:screenshot/screenshot.dart'; +export 'package:path_provider/path_provider.dart'; +export 'dart:convert'; +export 'dart:io'; +export 'dart:typed_data'; +export 'package:academia/controllers/courses_page_controller.dart'; +export 'package:academia/controllers/dashboard_controller.dart'; +export 'package:academia/pages/attendance_page.dart'; +export 'package:flutter_carousel_widget/flutter_carousel_widget.dart'; +export 'package:connectivity_plus/connectivity_plus.dart'; +export 'package:academia/pages/exams_timetable_page.dart'; +export 'package:academia/pages/fees_page.dart'; +export 'package:academia/pages/gpacalculator_page.dart'; +export 'package:academia/pages/pdf_viewer.dart'; +export 'package:academia/pages/tasks_pages/taskmanager_page.dart'; +export 'package:academia/pages/webview_page.dart'; +export 'package:academia/controllers/gpacalculator_controller.dart'; +export 'package:academia/pages/courses_page.dart'; +export 'package:academia/pages/dashboard.dart'; +export 'package:academia/pages/settings_page.dart'; +export 'package:academia/pages/tool_page.dart'; +export 'package:academia/pages/login_page.dart'; +export 'package:academia/controllers/login_controller.dart'; +export 'package:flutter_pdfview/flutter_pdfview.dart'; +export 'package:academia/widgets/info_card.dart'; +export 'package:cached_network_image/cached_network_image.dart'; +export 'package:academia/widgets/semester_timeline_tile.dart'; +export 'package:academia/constants/tools.dart'; +export 'package:academia/pages/birthday_page.dart'; +export 'package:academia/widgets/tool_card.dart'; +export 'package:academia/pages/tasks_pages/edittask_page.dart'; +export 'package:academia/pages/tasks_pages/newtask_page.dart'; +export 'package:academia/pages/tasks_pages/taskinfo_page.dart'; diff --git a/lib/main.dart b/lib/main.dart index e07a0b5..241bf1d 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,19 +1,5 @@ -import 'package:academia/constants/common.dart'; -import 'package:academia/controllers/notifications_controller.dart'; -import 'package:academia/controllers/settings_controller.dart'; -import 'package:academia/controllers/taskmanager_controller.dart'; -import 'package:academia/models/courses.dart'; -import 'package:academia/models/schedule.dart'; -import 'package:academia/models/tasks.dart'; -import 'package:academia/models/user.dart'; -import 'package:academia/notifications/notification_service.dart'; -import 'package:academia/pages/home_page.dart'; -import 'package:academia/pages/intro_page.dart'; -import 'package:academia/themes/theme.dart'; -import 'package:flutter/material.dart'; -import 'package:hive_flutter/hive_flutter.dart'; +import 'package:academia/exports/barrel.dart'; import 'package:get/get.dart'; -import 'package:magnet/magnet.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); diff --git a/lib/pages/attendance_page.dart b/lib/pages/attendance_page.dart index a669dd6..6bddd62 100644 --- a/lib/pages/attendance_page.dart +++ b/lib/pages/attendance_page.dart @@ -1,7 +1,6 @@ import 'package:academia/controllers/courses_page_controller.dart'; -import 'package:flutter/material.dart'; import 'package:get/get.dart'; -import 'package:loading_animation_widget/loading_animation_widget.dart'; +import 'package:academia/exports/barrel.dart'; class AttendancePage extends StatefulWidget { const AttendancePage({super.key}); diff --git a/lib/pages/birthday_page.dart b/lib/pages/birthday_page.dart index 746dcad..3c9905e 100644 --- a/lib/pages/birthday_page.dart +++ b/lib/pages/birthday_page.dart @@ -1,14 +1,7 @@ -import 'dart:convert'; -import 'dart:io'; -import 'dart:typed_data'; -import 'package:academia/constants/common.dart'; -import 'package:academia/controllers/settings_controller.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:intl/intl.dart'; -import 'package:screenshot/screenshot.dart'; -import 'package:path_provider/path_provider.dart'; +import 'package:academia/exports/barrel.dart'; +import 'package:flutter/cupertino.dart'; class BirthDayPage extends StatelessWidget { const BirthDayPage({super.key}); diff --git a/lib/pages/courses_page.dart b/lib/pages/courses_page.dart index 61ab5be..2378c5e 100644 --- a/lib/pages/courses_page.dart +++ b/lib/pages/courses_page.dart @@ -1,11 +1,6 @@ -import 'package:academia/constants/common.dart'; -import 'package:academia/controllers/courses_page_controller.dart'; -import 'package:academia/controllers/dashboard_controller.dart'; -import 'package:academia/pages/attendance_page.dart'; import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_carousel_widget/flutter_carousel_widget.dart'; import 'package:get/get.dart'; +import 'package:academia/exports/barrel.dart'; import 'package:liquid_pull_to_refresh/liquid_pull_to_refresh.dart'; class CoursesPage extends StatelessWidget { diff --git a/lib/pages/dashboard.dart b/lib/pages/dashboard.dart index b16ff25..ff66fc1 100644 --- a/lib/pages/dashboard.dart +++ b/lib/pages/dashboard.dart @@ -1,13 +1,7 @@ -import 'package:academia/constants/common.dart'; -import 'package:academia/controllers/dashboard_controller.dart'; -import 'package:academia/controllers/settings_controller.dart'; -import 'package:academia/widgets/academia_app_bar.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_carousel_widget/flutter_carousel_widget.dart'; +import 'package:academia/exports/barrel.dart'; import 'package:get/get.dart'; +import 'package:flutter/cupertino.dart'; import 'package:intl/intl.dart'; -import 'package:percent_indicator/percent_indicator.dart'; class DashBoard extends StatelessWidget { const DashBoard({super.key}); diff --git a/lib/pages/exams_timetable_page.dart b/lib/pages/exams_timetable_page.dart index 7c6eb92..3297797 100644 --- a/lib/pages/exams_timetable_page.dart +++ b/lib/pages/exams_timetable_page.dart @@ -1,14 +1,7 @@ -import 'package:academia/constants/common.dart'; -import 'package:academia/models/courses.dart'; -import 'package:academia/widgets/academia_app_bar.dart'; -import 'package:academia/widgets/count_down_widget.dart'; -import 'package:academia/widgets/exam_course_card.dart'; +import 'package:academia/exports/barrel.dart'; import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_carousel_widget/flutter_carousel_widget.dart'; import 'package:get/get.dart'; import 'package:intl/intl.dart'; -import 'package:loading_animation_widget/loading_animation_widget.dart'; class ExamTimeTablePage extends StatefulWidget { const ExamTimeTablePage({super.key}); diff --git a/lib/pages/fees_page.dart b/lib/pages/fees_page.dart index f37d989..d4b255f 100644 --- a/lib/pages/fees_page.dart +++ b/lib/pages/fees_page.dart @@ -1,8 +1,6 @@ -import 'package:academia/constants/common.dart'; +import 'package:academia/exports/barrel.dart'; import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; import 'package:get/get.dart'; -import 'package:loading_animation_widget/loading_animation_widget.dart'; class FeesPage extends StatefulWidget { const FeesPage({super.key, required this.allStatements}); diff --git a/lib/pages/gpacalculator_page.dart b/lib/pages/gpacalculator_page.dart index df634f6..311f692 100644 --- a/lib/pages/gpacalculator_page.dart +++ b/lib/pages/gpacalculator_page.dart @@ -1,6 +1,4 @@ -import 'package:academia/constants/common.dart'; -import 'package:academia/controllers/gpacalculator_controller.dart'; -import 'package:flutter/material.dart'; +import 'package:academia/exports/barrel.dart'; import 'package:get/get.dart'; class GpaCalculator extends StatelessWidget { diff --git a/lib/pages/home_page.dart b/lib/pages/home_page.dart index 26a48fe..3d64310 100644 --- a/lib/pages/home_page.dart +++ b/lib/pages/home_page.dart @@ -1,9 +1,4 @@ -import 'package:academia/controllers/settings_controller.dart'; -import 'package:academia/pages/courses_page.dart'; -import 'package:academia/pages/dashboard.dart'; -import 'package:academia/pages/settings_page.dart'; -import 'package:academia/pages/tool_page.dart'; -import 'package:flutter/material.dart'; +import 'package:academia/exports/barrel.dart'; import 'package:flutter/cupertino.dart'; import 'package:get/get.dart'; @@ -25,6 +20,7 @@ class _HomePageState extends State { @override Widget build(BuildContext context) { Get.put(SettingsController()); + Get.put(TaskManagerController()); return Scaffold( backgroundColor: Colors.blueGrey, extendBodyBehindAppBar: true, diff --git a/lib/pages/intro_page.dart b/lib/pages/intro_page.dart index e67fdbf..f63a832 100644 --- a/lib/pages/intro_page.dart +++ b/lib/pages/intro_page.dart @@ -1,10 +1,7 @@ -import 'package:academia/constants/common.dart'; -import 'package:academia/pages/login_page.dart'; +import 'package:academia/exports/barrel.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/services.dart'; -import 'package:flutter_carousel_widget/flutter_carousel_widget.dart'; import 'package:get/get.dart'; -import 'package:flutter/material.dart'; class IntroPage extends StatelessWidget { const IntroPage({super.key}); diff --git a/lib/pages/login_page.dart b/lib/pages/login_page.dart index 6bb9d97..219cc8e 100644 --- a/lib/pages/login_page.dart +++ b/lib/pages/login_page.dart @@ -1,10 +1,7 @@ -import 'package:academia/constants/common.dart'; -import 'package:academia/controllers/login_controller.dart'; +import 'package:academia/exports/barrel.dart'; import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:get/get.dart'; -import 'package:loading_animation_widget/loading_animation_widget.dart'; class LoginPage extends StatelessWidget { const LoginPage({super.key}); diff --git a/lib/pages/pdf_viewer.dart b/lib/pages/pdf_viewer.dart index a9d02eb..4721721 100644 --- a/lib/pages/pdf_viewer.dart +++ b/lib/pages/pdf_viewer.dart @@ -1,9 +1,6 @@ -import 'dart:typed_data'; +import 'package:academia/exports/barrel.dart'; import 'package:get/get.dart'; import 'package:http/http.dart' as http; -import 'package:flutter/material.dart'; -import 'package:flutter_pdfview/flutter_pdfview.dart'; -import 'package:loading_animation_widget/loading_animation_widget.dart'; class PdfViewer extends StatefulWidget { const PdfViewer({ diff --git a/lib/pages/settings_page.dart b/lib/pages/settings_page.dart index c6a265b..9dacb47 100644 --- a/lib/pages/settings_page.dart +++ b/lib/pages/settings_page.dart @@ -1,18 +1,6 @@ -import 'dart:convert'; -import 'dart:typed_data'; - -import 'package:academia/controllers/settings_controller.dart'; -import 'package:academia/notifications/notification_service.dart'; -import 'package:academia/pages/webview_page.dart'; -import 'package:academia/widgets/info_card.dart'; -import 'package:cached_network_image/cached_network_image.dart'; +import 'package:academia/exports/barrel.dart'; import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; import 'package:get/get.dart'; -import 'package:loading_animation_widget/loading_animation_widget.dart'; - -import '../constants/common.dart'; -import 'intro_page.dart'; class SettingsPage extends StatelessWidget { const SettingsPage({super.key}); @@ -352,6 +340,26 @@ class SettingsPage extends StatelessWidget { ), const Divider(), + const Divider(), + + ListTile( + title: Obx( + () => controller.hasUpdates.value + ? const Text("Updating") + : Text("Update v 1.0.${controller.patch.value}"), + ), + trailing: controller.hasUpdates.value + ? LoadingAnimationWidget.beat( + color: Theme.of(context).primaryColor, size: 20) + : IconButton( + onPressed: () async { + await controller.checkForUpdates(); + }, + icon: + const Icon(CupertinoIcons.arrow_right_circle)), + ), + const Divider(), + // button to refresh all content Padding( padding: diff --git a/lib/pages/tasks_pages/edittask_page.dart b/lib/pages/tasks_pages/edittask_page.dart index d269948..c0f55cd 100644 --- a/lib/pages/tasks_pages/edittask_page.dart +++ b/lib/pages/tasks_pages/edittask_page.dart @@ -1,6 +1,4 @@ -import 'package:academia/controllers/taskmanager_controller.dart'; -import 'package:academia/models/tasks.dart'; -import 'package:flutter/material.dart'; +import 'package:academia/exports/barrel.dart'; import 'package:get/get.dart'; import 'package:intl/intl.dart'; diff --git a/lib/pages/tasks_pages/newtask_page.dart b/lib/pages/tasks_pages/newtask_page.dart index 5df05b1..bc3c56f 100644 --- a/lib/pages/tasks_pages/newtask_page.dart +++ b/lib/pages/tasks_pages/newtask_page.dart @@ -1,5 +1,4 @@ -import 'package:academia/controllers/taskmanager_controller.dart'; -import 'package:flutter/material.dart'; +import 'package:academia/exports/barrel.dart'; import 'package:get/get.dart'; import 'package:intl/intl.dart'; diff --git a/lib/pages/tasks_pages/taskinfo_page.dart b/lib/pages/tasks_pages/taskinfo_page.dart index 240fb2a..5ab395e 100644 --- a/lib/pages/tasks_pages/taskinfo_page.dart +++ b/lib/pages/tasks_pages/taskinfo_page.dart @@ -1,7 +1,4 @@ -import 'package:academia/controllers/taskmanager_controller.dart'; -import 'package:academia/models/tasks.dart'; -import 'package:academia/pages/tasks_pages/edittask_page.dart'; -import 'package:flutter/material.dart'; +import 'package:academia/exports/barrel.dart'; import 'package:get/get.dart'; import 'package:intl/intl.dart'; diff --git a/lib/pages/tasks_pages/taskmanager_page.dart b/lib/pages/tasks_pages/taskmanager_page.dart index d769c74..370a975 100644 --- a/lib/pages/tasks_pages/taskmanager_page.dart +++ b/lib/pages/tasks_pages/taskmanager_page.dart @@ -1,8 +1,4 @@ -import 'package:academia/controllers/taskmanager_controller.dart'; -import 'package:academia/models/tasks.dart'; -import 'package:academia/pages/tasks_pages/newtask_page.dart'; -import 'package:academia/pages/tasks_pages/taskinfo_page.dart'; -import 'package:flutter/material.dart'; +import 'package:academia/exports/barrel.dart'; import 'package:get/get.dart'; import 'package:intl/intl.dart'; diff --git a/lib/pages/time_line_page.dart b/lib/pages/time_line_page.dart index 5df2c8d..8fbb602 100644 --- a/lib/pages/time_line_page.dart +++ b/lib/pages/time_line_page.dart @@ -1,11 +1,7 @@ -import 'package:academia/constants/common.dart'; -import 'package:academia/controllers/notifications_controller.dart'; -import 'package:academia/widgets/semester_timeline_tile.dart'; -import 'package:flutter/material.dart'; +import 'package:academia/exports/barrel.dart'; import 'package:get/get.dart'; import 'package:liquid_pull_to_refresh/liquid_pull_to_refresh.dart'; import 'package:intl/intl.dart'; -import 'package:loading_animation_widget/loading_animation_widget.dart'; class TimeLinePage extends StatelessWidget { const TimeLinePage({super.key}); diff --git a/lib/pages/tool_page.dart b/lib/pages/tool_page.dart index b05cde8..a07f127 100644 --- a/lib/pages/tool_page.dart +++ b/lib/pages/tool_page.dart @@ -1,10 +1,5 @@ -import 'package:academia/constants/common.dart'; -import 'package:academia/constants/tools.dart'; -import 'package:academia/controllers/settings_controller.dart'; -import 'package:academia/pages/birthday_page.dart'; -import 'package:academia/widgets/tool_card.dart'; +import 'package:academia/exports/barrel.dart'; import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:intl/intl.dart'; diff --git a/lib/pages/webview_page.dart b/lib/pages/webview_page.dart index 82974a7..9b2427a 100644 --- a/lib/pages/webview_page.dart +++ b/lib/pages/webview_page.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:academia/exports/barrel.dart'; import 'package:get/get.dart'; import 'package:webview_flutter/webview_flutter.dart'; diff --git a/lib/themes/theme.dart b/lib/themes/theme.dart index cd6ea5a..69d8975 100644 --- a/lib/themes/theme.dart +++ b/lib/themes/theme.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:academia/exports/barrel.dart'; ThemeData lightModeTheme = ThemeData( fontFamily: 'Nunito', diff --git a/lib/utils/random.dart b/lib/utils/random.dart deleted file mode 100644 index 1869839..0000000 --- a/lib/utils/random.dart +++ /dev/null @@ -1,9 +0,0 @@ -// Contains helper random function - -import 'dart:math'; - -T getRandomElement(List elements) { - final random = Random(); - final index = random.nextInt(elements.length); - return elements[index]; -} diff --git a/lib/widgets/academia_app_bar.dart b/lib/widgets/academia_app_bar.dart index 613dd9b..d654638 100644 --- a/lib/widgets/academia_app_bar.dart +++ b/lib/widgets/academia_app_bar.dart @@ -1,10 +1,5 @@ -import 'dart:convert'; -import 'dart:typed_data'; - -import 'package:academia/constants/common.dart'; -import 'package:academia/controllers/settings_controller.dart'; +import 'package:academia/exports/barrel.dart'; import 'package:academia/pages/time_line_page.dart'; -import 'package:flutter/material.dart'; import 'package:get/get.dart'; class AcademiaAppBar extends StatelessWidget { diff --git a/lib/widgets/caurosel_item_card.dart b/lib/widgets/caurosel_item_card.dart index bc6bd48..12c2a6e 100644 --- a/lib/widgets/caurosel_item_card.dart +++ b/lib/widgets/caurosel_item_card.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:academia/exports/barrel.dart'; class CauroselItemCard extends StatelessWidget { const CauroselItemCard({ diff --git a/lib/widgets/count_down_widget.dart b/lib/widgets/count_down_widget.dart index 9b994e6..f45aa97 100644 --- a/lib/widgets/count_down_widget.dart +++ b/lib/widgets/count_down_widget.dart @@ -1,8 +1,6 @@ +import 'package:academia/exports/barrel.dart'; import 'dart:async'; -import 'package:academia/constants/common.dart'; -import 'package:flutter/material.dart'; - class CountDown extends StatefulWidget { const CountDown({super.key, required this.deadline}); final DateTime deadline; diff --git a/lib/widgets/course_attendance_widget.dart b/lib/widgets/course_attendance_widget.dart index 169a907..9a923d2 100644 --- a/lib/widgets/course_attendance_widget.dart +++ b/lib/widgets/course_attendance_widget.dart @@ -1,6 +1,4 @@ -import 'package:academia/constants/common.dart'; -import 'package:flutter/material.dart'; -import 'package:percent_indicator/percent_indicator.dart'; +import 'package:academia/exports/barrel.dart'; class CourseAttendanceCard extends StatelessWidget { const CourseAttendanceCard({ diff --git a/lib/widgets/course_card.dart b/lib/widgets/course_card.dart index fb14998..aa54988 100644 --- a/lib/widgets/course_card.dart +++ b/lib/widgets/course_card.dart @@ -1,5 +1,4 @@ -import 'package:academia/constants/common.dart'; -import 'package:flutter/material.dart'; +import 'package:academia/exports/barrel.dart'; class CourseCard extends StatelessWidget { const CourseCard({ @@ -58,7 +57,7 @@ class CourseCard extends StatelessWidget { const Spacer(), Text( courseTitle, - style: TextStyle( + style: TextStyle( fontWeight: FontWeight.bold, fontSize: 20, color: titleColor, diff --git a/lib/widgets/course_detail_card.dart b/lib/widgets/course_detail_card.dart index 0cd42aa..5b90c15 100644 --- a/lib/widgets/course_detail_card.dart +++ b/lib/widgets/course_detail_card.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:academia/exports/barrel.dart'; class CourseDetailCard extends StatefulWidget { const CourseDetailCard({super.key}); diff --git a/lib/widgets/dateTime_picker.dart b/lib/widgets/dateTime_picker.dart index 42aaeaa..13f3269 100644 --- a/lib/widgets/dateTime_picker.dart +++ b/lib/widgets/dateTime_picker.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:academia/exports/barrel.dart'; import 'package:intl/intl.dart'; class DateTimePicker extends StatefulWidget { diff --git a/lib/widgets/events_widget.dart b/lib/widgets/events_widget.dart index d3ceb8e..1798f53 100644 --- a/lib/widgets/events_widget.dart +++ b/lib/widgets/events_widget.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:academia/exports/barrel.dart'; import 'package:flutter/cupertino.dart'; class EventCard extends StatefulWidget { diff --git a/lib/widgets/exam_course_card.dart b/lib/widgets/exam_course_card.dart index 5665001..b463df2 100644 --- a/lib/widgets/exam_course_card.dart +++ b/lib/widgets/exam_course_card.dart @@ -1,6 +1,5 @@ -import 'package:academia/constants/common.dart'; +import 'package:academia/exports/barrel.dart'; import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; class ExamCourseCard extends StatelessWidget { const ExamCourseCard({ diff --git a/lib/widgets/info_card.dart b/lib/widgets/info_card.dart index ffdaea0..eca728d 100644 --- a/lib/widgets/info_card.dart +++ b/lib/widgets/info_card.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:academia/exports/barrel.dart'; class InfoCard extends StatelessWidget { const InfoCard({ diff --git a/lib/widgets/semester_timeline_tile.dart b/lib/widgets/semester_timeline_tile.dart index 4fe2949..8548806 100644 --- a/lib/widgets/semester_timeline_tile.dart +++ b/lib/widgets/semester_timeline_tile.dart @@ -1,5 +1,4 @@ -import 'package:academia/constants/common.dart'; -import 'package:flutter/material.dart'; +import 'package:academia/exports/barrel.dart'; import 'package:timeline_tile/timeline_tile.dart'; class SemesterTimeLineTile extends StatelessWidget { diff --git a/lib/widgets/task_card.dart b/lib/widgets/task_card.dart index 7ee4089..67c72f8 100644 --- a/lib/widgets/task_card.dart +++ b/lib/widgets/task_card.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart'; +import 'package:academia/exports/barrel.dart'; import 'package:flutter/cupertino.dart'; class TaskCard extends StatelessWidget { diff --git a/lib/widgets/tool_card.dart b/lib/widgets/tool_card.dart index 5320d23..c6be08a 100644 --- a/lib/widgets/tool_card.dart +++ b/lib/widgets/tool_card.dart @@ -1,5 +1,4 @@ -import 'package:flutter/material.dart'; -import 'package:loading_animation_widget/loading_animation_widget.dart'; +import 'package:academia/exports/barrel.dart'; class ToolCard extends StatefulWidget { const ToolCard({ diff --git a/pubspec.yaml b/pubspec.yaml index 0e9b888..9bffb69 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: academia -description: A student's assistant. +description: "Daystar University School portal app." # The following line prevents the package from being accidentally published to # pub.dev using `flutter pub publish`. This is preferred for private packages. publish_to: 'none' # Remove this line if you wish to publish to pub.dev @@ -60,6 +60,11 @@ dependencies: flutter_pdfview: ^1.3.2 screenshot: ^2.1.0 path_provider: ^2.1.2 + timezone: ^0.9.2 + network_info_plus: ^4.1.0+1 + connectivity_plus: ^5.0.2 + shorebird_code_push: ^1.1.3 + story_view: ^0.16.0 @@ -95,6 +100,7 @@ flutter: assets: - assets/icons/ - assets/images/ + - shorebird.yaml # - images/a_dot_ham.jpeg # An image asset can refer to one or more resolution-specific "variants", see diff --git a/shorebird.yaml b/shorebird.yaml new file mode 100644 index 0000000..8d304bc --- /dev/null +++ b/shorebird.yaml @@ -0,0 +1,14 @@ +# This file is used to configure the Shorebird updater used by your app. +# Learn more at https://docs.shorebird.dev +# This file should be checked into version control. + +# This is the unique identifier assigned to your app. +# Your app_id is not a secret and is just used to identify your app +# when requesting patches from Shorebird's servers. +app_id: 0de1699c-c380-401c-9da1-a730c2cb3c55 + +# auto_update controls if Shorebird should automatically update in the background on launch. +# If auto_update: false, you will need to use package:shorebird_code_push to trigger updates. +# https://pub.dev/packages/shorebird_code_push +# Uncomment the following line to disable automatic updates. +# auto_update: false