From ad4852aea3aaa9032e63e6b37459cd9e7faafd7a Mon Sep 17 00:00:00 2001 From: Luca Coduri Date: Fri, 23 Sep 2022 17:34:11 +0200 Subject: [PATCH] fixes --- lib/main.dart | 6 +++--- lib/models/heure_de_cours.dart | 2 -- lib/models/horaires.dart | 2 -- lib/models/notes.dart | 2 +- lib/services/api/api.dart | 1 - lib/services/background_tasks/check_new_grades.dart | 2 +- lib/services/providers/horaires_provider.dart | 2 +- lib/widgets/screens/login_screen.dart | 2 +- lib/widgets/screens/settings_alert_screen.dart | 2 +- pubspec.yaml | 2 +- 10 files changed, 9 insertions(+), 14 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 772f6b3..86f9557 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,6 +1,5 @@ import 'dart:io'; -import 'package:timezone/data/latest.dart' as tz; import 'package:flutter/foundation.dart' as foundation; import 'package:flutter/material.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart'; @@ -15,6 +14,7 @@ import 'package:heig_front/utils/id_generator.dart'; import 'package:hive_flutter/hive_flutter.dart'; import 'package:intl/date_symbol_data_local.dart'; import 'package:provider/provider.dart'; +import 'package:timezone/data/latest.dart' as tz; import 'package:vrouter/vrouter.dart'; import 'package:workmanager/workmanager.dart'; @@ -84,8 +84,8 @@ Future setup() async { Workmanager().initialize( callbackDispatcher, // The top level function, aka callbackDispatcher - isInDebugMode: - true // If enabled it will post a notification whenever the task is running. Handy for debugging tasks + isInDebugMode: !foundation + .kReleaseMode // If enabled it will post a notification whenever the task is running. Handy for debugging tasks ); Workmanager().registerPeriodicTask( 'newGradeChecker', diff --git a/lib/models/heure_de_cours.dart b/lib/models/heure_de_cours.dart index ff8ea57..6a0ce83 100644 --- a/lib/models/heure_de_cours.dart +++ b/lib/models/heure_de_cours.dart @@ -1,5 +1,3 @@ -import 'package:get_it/get_it.dart'; -import 'package:heig_front/utils/id_generator.dart'; import 'package:heig_front/utils/notification.dart' show CanNotify; import 'package:hive_flutter/adapters.dart'; import 'package:timezone/timezone.dart'; diff --git a/lib/models/horaires.dart b/lib/models/horaires.dart index d5b16b6..3efda84 100644 --- a/lib/models/horaires.dart +++ b/lib/models/horaires.dart @@ -1,5 +1,3 @@ -import 'dart:developer'; - import 'package:flutter/material.dart'; import 'package:hive_flutter/adapters.dart'; import 'package:rrule/rrule.dart'; diff --git a/lib/models/notes.dart b/lib/models/notes.dart index 6f21006..38e8635 100644 --- a/lib/models/notes.dart +++ b/lib/models/notes.dart @@ -35,6 +35,6 @@ class Note { } @override - int get hashCode => hashValues( + int get hashCode => Object.hash( nom.hashCode, note.hashCode, moyenneClasse.hashCode, coef.hashCode); } diff --git a/lib/services/api/api.dart b/lib/services/api/api.dart index b252f64..aeece34 100644 --- a/lib/services/api/api.dart +++ b/lib/services/api/api.dart @@ -1,5 +1,4 @@ import 'dart:convert'; -import 'dart:developer'; import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:dio/dio.dart'; diff --git a/lib/services/background_tasks/check_new_grades.dart b/lib/services/background_tasks/check_new_grades.dart index 6d1b4fb..d2a5eb6 100644 --- a/lib/services/background_tasks/check_new_grades.dart +++ b/lib/services/background_tasks/check_new_grades.dart @@ -1,6 +1,5 @@ import 'dart:io' show Platform; -import 'package:timezone/data/latest.dart' as tz; import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:flutter/material.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart'; @@ -14,6 +13,7 @@ import 'package:heig_front/models/user.dart'; import 'package:heig_front/services/api/api.dart'; import 'package:heig_front/utils/constants.dart'; import 'package:hive_flutter/hive_flutter.dart'; +import 'package:timezone/data/latest.dart' as tz; import 'package:workmanager/workmanager.dart'; import '../../utils/asymmetric_crypt.dart'; diff --git a/lib/services/providers/horaires_provider.dart b/lib/services/providers/horaires_provider.dart index b08487b..d01f993 100644 --- a/lib/services/providers/horaires_provider.dart +++ b/lib/services/providers/horaires_provider.dart @@ -16,7 +16,7 @@ class HorairesProvider extends ChangeNotifier { late Horaires _horaires; final _box = Hive.box(BOX_HEIG); final _api = GetIt.I.get(); - static final int NB_SCHEDULED_NOTIFICATION = 64; + static const int NB_SCHEDULED_NOTIFICATION = 64; HorairesProvider() { final Horaires hiveHoraires = _box.get('horaires', diff --git a/lib/widgets/screens/login_screen.dart b/lib/widgets/screens/login_screen.dart index 5635295..ac264f5 100644 --- a/lib/widgets/screens/login_screen.dart +++ b/lib/widgets/screens/login_screen.dart @@ -90,7 +90,7 @@ class _LoginScreenState extends State { OutlinedButton( style: OutlinedButton.styleFrom( minimumSize: const Size(100, 40), - primary: Colors.teal, + foregroundColor: Colors.teal, side: const BorderSide( color: Color(0xffda291c), ), diff --git a/lib/widgets/screens/settings_alert_screen.dart b/lib/widgets/screens/settings_alert_screen.dart index 0f3c772..6db56c4 100644 --- a/lib/widgets/screens/settings_alert_screen.dart +++ b/lib/widgets/screens/settings_alert_screen.dart @@ -13,7 +13,7 @@ class SettingsAlertScreen extends StatelessWidget { Widget build(BuildContext context) { final btnStyle = OutlinedButton.styleFrom( minimumSize: const Size(100, 40), - primary: Colors.teal, + foregroundColor: Colors.teal, side: const BorderSide( color: Color(0xffda291c), ), diff --git a/pubspec.yaml b/pubspec.yaml index a8305ca..4dcacce 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.1.0 +version: 1.1.1 environment: sdk: ">=2.12.0 <3.0.0"