From 0a0a40981dd8e7e72dbbf4e71188cb80e6b57380 Mon Sep 17 00:00:00 2001 From: wahyudizulhaidar Date: Sun, 8 Dec 2024 16:40:06 +0800 Subject: [PATCH] update to dart 3.5.4 --- android/app/build.gradle | 65 ++-- android/app/src/debug/AndroidManifest.xml | 3 +- android/app/src/main/AndroidManifest.xml | 48 +-- android/build.gradle | 21 +- .../gradle/wrapper/gradle-wrapper.properties | 6 +- android/settings.gradle | 30 +- lib/database/pills_database.dart | 26 +- lib/database/repository.dart | 58 +-- lib/helpers/platform_flat_button.dart | 18 +- lib/helpers/platform_slider.dart | 12 +- lib/helpers/snack_bar.dart | 28 +- lib/main.dart | 32 +- lib/models/calendar_day_model.dart | 4 +- lib/models/pill.dart | 63 ++-- lib/notifications/notifications.dart | 93 +++-- .../add_new_medicine/add_new_medicine.dart | 44 +-- lib/screens/add_new_medicine/form_fields.dart | 1 - lib/screens/home/home.dart | 123 +++++-- lib/screens/home/medicine_card.dart | 27 +- lib/screens/welcome/title_and_message.dart | 8 +- lib/screens/welcome/welcome.dart | 4 +- pubspec.lock | 342 ++++++++++++++---- pubspec.yaml | 22 +- 23 files changed, 686 insertions(+), 392 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index b8033a2..e2c1de1 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -1,54 +1,51 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' +plugins { + id "com.android.application" + id "kotlin-android" + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id "dev.flutter.flutter-gradle-plugin" } -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - android { - compileSdkVersion 28 + namespace = "com.example.medicines" + compileSdk = flutter.compileSdkVersion + ndkVersion = "27.0.12077973" + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + coreLibraryDesugaringEnabled true + } - lintOptions { - disable 'InvalidPackage' + kotlinOptions { + jvmTarget = '11' } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.example.medicines" - minSdkVersion 16 - targetSdkVersion 28 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName + applicationId = "com.example.medicines" + // You can update the following values to match your application needs. + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName } buildTypes { release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug + signingConfig = signingConfigs.debug } } } flutter { - source '../..' + source = "../.." } + +dependencies { + implementation 'androidx.window:window:1.3.0' + implementation 'androidx.window:window-java:1.3.0' + coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.2' +} \ No newline at end of file diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index ab0e481..f880684 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 2b1405c..d2193e0 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,14 +1,11 @@ - - + + + + - + android:turnScreenOn="true" + android:exported="true"> - + android:name="io.flutter.embedding.android.NormalTheme" + android:resource="@style/NormalTheme" + /> + android:name="io.flutter.embedding.android.SplashScreenDrawable" + android:resource="@drawable/launch_background" + /> - - - + @@ -56,7 +44,7 @@ - + - diff --git a/android/build.gradle b/android/build.gradle index e0d7ae2..8e9de9d 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,29 +1,18 @@ -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.5.0' - } -} - allprojects { repositories { google() - jcenter() + mavenCentral() } } -rootProject.buildDir = '../build' +rootProject.buildDir = "../build" subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" } subprojects { - project.evaluationDependsOn(':app') + project.evaluationDependsOn(":app") } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir -} +} \ No newline at end of file diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 296b146..4cfa16f 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Jun 23 08:50:38 CEST 2017 +#Tue Apr 16 15:28:58 WIB 2024 distributionBase=GRADLE_USER_HOME +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip +zipStoreBase=GRADLE_USER_HOME diff --git a/android/settings.gradle b/android/settings.gradle index 44e62bc..115c114 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,11 +1,25 @@ -include ':app' +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.7.3" apply false + id "org.jetbrains.kotlin.android" version "1.9.24" apply false +} + +include ":app" \ No newline at end of file diff --git a/lib/database/pills_database.dart b/lib/database/pills_database.dart index df67924..879a6c0 100644 --- a/lib/database/pills_database.dart +++ b/lib/database/pills_database.dart @@ -1,17 +1,25 @@ - - import 'package:path/path.dart'; import 'package:sqflite/sqflite.dart'; -class PillsDatabase{ +class PillsDatabase { - setDatabase() async{ + Future setDatabase() async { String databasePath = await getDatabasesPath(); - String path = join(databasePath,"pills_db"); - Database database = await openDatabase(path,version: 1,onCreate: (Database db,int version)async{ - await db.execute("CREATE TABLE Pills (id INTEGER PRIMARY KEY, name TEXT, amount TEXT, type TEXT, howManyWeeks INTEGER, medicineForm TEXT, time INTEGER, notifyId INTEGER)"); + String path = join(databasePath, "pills_db"); + Database database = await openDatabase(path, version: 1, onCreate: (Database db, int version) async { + await db.execute(''' + CREATE TABLE Pills ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + name TEXT, + amount TEXT, + type TEXT, + howManyWeeks INTEGER, + medicineForm TEXT, + time INTEGER, + notifyId INTEGER + ) + '''); }); return database; } - -} \ No newline at end of file +} diff --git a/lib/database/repository.dart b/lib/database/repository.dart index 414638e..58efd3b 100644 --- a/lib/database/repository.dart +++ b/lib/database/repository.dart @@ -3,47 +3,49 @@ import 'package:medicine/database/pills_database.dart'; import 'package:sqflite/sqflite.dart'; -class Repository{ +class Repository { + final PillsDatabase _pillsDatabase = PillsDatabase(); + static Database? _database; - PillsDatabase _pillsDatabase = PillsDatabase(); - static Database _database; - - //init database - Future get database async{ - if(_database != null) return _database; - _database = await _pillsDatabase.setDatabase(); - return _database; + Future get database async { + if (_database == null || !_database!.isOpen) { + _database = await _pillsDatabase.setDatabase(); + } + return _database!; } - //insert something to database - Future insertData(String table,Map data) async{ - Database db = await database; - try{ + Future insertData(String table, Map data) async { + try { + final db = await database; + + if (!data.containsKey('name') || !data.containsKey('amount') || !data.containsKey('type')) { + throw Exception('Data tidak lengkap, pastikan semua kolom yang diperlukan ada.'); + } + return await db.insert(table, data); - }catch(e){ + } catch (e) { + print('Error inserting data into $table: $e'); return null; } } - //get all data from database - Future>> getAllData(table) async{ - Database db = await database; - try{ - return db.query(table); - }catch(e){ + Future>?> getAllData(String table) async { + try { + final db = await database; + return await db.query(table); + } catch (e) { + print('Error fetching data: $e'); return null; } } - //delete data - Future deleteData(String table,int id) async{ - Database db = await database; - try{ - return await db.delete(table,where: "id = ?", whereArgs: [id]); - }catch(e){ + Future deleteData(String table, int id) async { + try { + final db = await database; + return await db.delete(table, where: "id = ?", whereArgs: [id]); + } catch (e) { + print('Error deleting data: $e'); return null; } } - - } \ No newline at end of file diff --git a/lib/helpers/platform_flat_button.dart b/lib/helpers/platform_flat_button.dart index 0abc13e..46e3bdb 100644 --- a/lib/helpers/platform_flat_button.dart +++ b/lib/helpers/platform_flat_button.dart @@ -1,14 +1,15 @@ import 'dart:io'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/cupertino.dart'; class PlatformFlatButton extends StatelessWidget { - final Function handler; + final VoidCallback? handler; final Widget buttonChild; final Color color; - PlatformFlatButton({@required this.buttonChild,@required this.color,@required this.handler}); + PlatformFlatButton( + {required this.buttonChild, required this.color, required this.handler}); @override Widget build(BuildContext context) { @@ -19,12 +20,15 @@ class PlatformFlatButton extends StatelessWidget { onPressed: this.handler, borderRadius: BorderRadius.circular(15.0), ) - : FlatButton( - color: this.color, + : TextButton( + style: TextButton.styleFrom( + backgroundColor: this.color, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(15.0), + ), + ), child: this.buttonChild, onPressed: this.handler, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(15.0)), ); } } diff --git a/lib/helpers/platform_slider.dart b/lib/helpers/platform_slider.dart index 9d5f7d4..b93644e 100644 --- a/lib/helpers/platform_slider.dart +++ b/lib/helpers/platform_slider.dart @@ -8,12 +8,12 @@ class PlatformSlider extends StatelessWidget { final Color color; PlatformSlider( - {@required this.value, - @required this.handler, - @required this.color, - @required this.max, - @required this.min, - @required this.divisions}); + {required this.value, + required this.handler, + required this.color, + required this.max, + required this.min, + required this.divisions}); @override Widget build(BuildContext context) { diff --git a/lib/helpers/snack_bar.dart b/lib/helpers/snack_bar.dart index 53258d4..aaf5e5c 100644 --- a/lib/helpers/snack_bar.dart +++ b/lib/helpers/snack_bar.dart @@ -1,16 +1,18 @@ import 'package:flutter/material.dart'; class Snackbar { - void showSnack(String message, GlobalKey _scaffoldKey, - Function undo) => - _scaffoldKey.currentState.showSnackBar( - SnackBar( - content: Text(message), - action: undo != null ? SnackBarAction( - textColor: Theme.of(_scaffoldKey.currentState.context).primaryColor, - label: "Undo", - onPressed: () => undo, - ):null, - ), - ); -} + void showSnack(BuildContext context, String message, GlobalKey scaffoldKey, VoidCallback? undo) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text(message), + action: undo != null + ? SnackBarAction( + textColor: Theme.of(context).primaryColor, + label: "Undo", + onPressed: undo, + ) + : null, + ), + ); + } +} \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index 429db19..65b6a74 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,17 +1,31 @@ -import 'package:flutter/cupertino.dart'; +import 'dart:io'; + import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:medicine/screens/add_new_medicine/add_new_medicine.dart'; import 'package:medicine/screens/home/home.dart'; +import 'package:permission_handler/permission_handler.dart'; import './screens/welcome/welcome.dart'; -void main() { +Future requestNotificationPermission() async { + if (Platform.isAndroid) { + PermissionStatus permission = await Permission.notification.request(); + if (permission.isDenied || permission.isRestricted) { + print('Notification permission denied'); + } + } +} + +void main() async { + WidgetsFlutterBinding.ensureInitialized(); + + await requestNotificationPermission(); + runApp(MedicineApp()); SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle( - systemNavigationBarColor: Colors.black.withOpacity(0.05), - statusBarColor: Colors.black.withOpacity(0.05), - statusBarIconBrightness: Brightness.dark - )); + systemNavigationBarColor: Colors.black.withOpacity(0.05), + statusBarColor: Colors.black.withOpacity(0.05), + statusBarIconBrightness: Brightness.dark)); } class MedicineApp extends StatelessWidget { @@ -22,17 +36,17 @@ class MedicineApp extends StatelessWidget { fontFamily: "Popins", primaryColor: Color.fromRGBO(7, 190, 200, 1), textTheme: TextTheme( - headline1: ThemeData.light().textTheme.headline1.copyWith( + displayLarge: ThemeData.light().textTheme.displayLarge?.copyWith( fontWeight: FontWeight.w700, fontSize: 38.0, fontFamily: "Popins", ), - headline5: ThemeData.light().textTheme.headline1.copyWith( + headlineSmall: ThemeData.light().textTheme.displayLarge?.copyWith( fontWeight: FontWeight.w400, fontSize: 17.0, fontFamily: "Popins", ), - headline3: ThemeData.light().textTheme.headline3.copyWith( + displaySmall: ThemeData.light().textTheme.displaySmall?.copyWith( fontWeight: FontWeight.w600, fontSize: 20.0, fontFamily: "Popins", diff --git a/lib/models/calendar_day_model.dart b/lib/models/calendar_day_model.dart index 92b9cd3..fe62e51 100644 --- a/lib/models/calendar_day_model.dart +++ b/lib/models/calendar_day_model.dart @@ -8,11 +8,11 @@ class CalendarDayModel { int year; bool isChecked; - CalendarDayModel({this.dayLetter,this.dayNumber,this.year, this.month, this.isChecked}); + CalendarDayModel({required this.dayLetter,required this.dayNumber,required this.year, required this.month, required this.isChecked}); //----------------| get current 7 days |---------------------- List getCurrentDays() { - final List daysList = List(); + final List daysList = []; DateTime currentTime = DateTime.now(); for (int i = 0; i < 7; i++) { daysList.add(CalendarDayModel( diff --git a/lib/models/pill.dart b/lib/models/pill.dart index 62f3aa5..1aabe3c 100644 --- a/lib/models/pill.dart +++ b/lib/models/pill.dart @@ -9,14 +9,14 @@ class Pill { int notifyId; Pill( - {this.id, - this.howManyWeeks, - this.time, - this.amount, - this.medicineForm, - this.name, - this.type, - this.notifyId}); + {required this.id, + required this.howManyWeeks, + required this.time, + required this.amount, + required this.medicineForm, + required this.name, + required this.type, + required this.notifyId}); //------------------set pill to map------------------- @@ -38,29 +38,36 @@ class Pill { //---------------------create pill object from map--------------------- Pill pillMapToObject(Map pillMap) { return Pill( - id: pillMap['id'], - name: pillMap['name'], - amount: pillMap['amount'], - type: pillMap['type'], - howManyWeeks: pillMap['howManyWeeks'], - medicineForm: pillMap['medicineForm'], - time: pillMap['time'], - notifyId: pillMap['notifyId']); + id: pillMap['id'] ?? 0, // Default jika 'id' null + name: pillMap['name'] ?? '', // Default jika 'name' null + amount: pillMap['amount'] ?? '', // Default jika 'amount' null + type: pillMap['type'] ?? '', // Default jika 'type' null + howManyWeeks: pillMap['howManyWeeks'] ?? 0, // Default jika 'howManyWeeks' null + medicineForm: pillMap['medicineForm'] ?? '', // Default jika 'medicineForm' null + time: pillMap['time'] ?? 0, // Default jika 'time' null + notifyId: pillMap['notifyId'] ?? 0 // Default jika 'notifyId' null + ); } //===================================================================== - - //---------------------| Get the medicine image path |------------------------- - String get image{ - switch(this.medicineForm){ - case "Syrup": return "assets/images/syrup.png"; break; - case "Pill":return "assets/images/pills.png"; break; - case "Capsule":return "assets/images/capsule.png"; break; - case "Cream":return "assets/images/cream.png"; break; - case "Drops":return "assets/images/drops.png"; break; - case "Syringe":return "assets/images/syringe.png"; break; - default : return "assets/images/pills.png"; break; + //---------------------| Get the medicines image path |------------------------- + String get image { + switch (this.medicineForm) { + case "Syrup": + return "assets/images/syrup.png"; + case "Pill": + return "assets/images/pills.png"; + case "Capsule": + return "assets/images/capsule.png"; + case "Cream": + return "assets/images/cream.png"; + case "Drops": + return "assets/images/drops.png"; + case "Syringe": + return "assets/images/syringe.png"; + default: + return "assets/images/pills.png"; } } - //============================================================================= +//============================================================================= } diff --git a/lib/notifications/notifications.dart b/lib/notifications/notifications.dart index ddc2ef5..8aa5032 100644 --- a/lib/notifications/notifications.dart +++ b/lib/notifications/notifications.dart @@ -1,76 +1,93 @@ -import 'package:medicine/models/pill.dart'; -import 'package:timezone/data/latest.dart' as tz; -import 'package:timezone/timezone.dart' as tz; + + import 'package:flutter/material.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; +import 'package:timezone/timezone.dart' as tz; class Notifications { + late BuildContext _context; - BuildContext _context; - - Future initNotifies(BuildContext context) async{ + Future initNotifies( + BuildContext context) async { this._context = context; - //-----------------------------| Inicialize local notifications |-------------------------------------- + //-----------------------------| Initialize local notifications |-------------------------------------- var initializationSettingsAndroid = - new AndroidInitializationSettings('app_icon'); - var initializationSettingsIOS = new IOSInitializationSettings(); - var initializationSettings = new InitializationSettings( + AndroidInitializationSettings('app_icon'); + var initializationSettingsIOS = DarwinInitializationSettings(); + var initializationSettings = InitializationSettings( android: initializationSettingsAndroid, iOS: initializationSettingsIOS); - FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = new FlutterLocalNotificationsPlugin(); - flutterLocalNotificationsPlugin.initialize(initializationSettings, - onSelectNotification: onSelectNotification); + FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = + FlutterLocalNotificationsPlugin(); + + await flutterLocalNotificationsPlugin.initialize( + initializationSettings, + onDidReceiveNotificationResponse: (NotificationResponse notificationResponse) { + onSelectNotification(notificationResponse.payload); + }, + ); + + const AndroidNotificationChannel channel = AndroidNotificationChannel( + 'medicines_id', + 'Medicines Notifications', + description: 'This channel is used for medicines notifications', + importance: Importance.high, + ); + + await flutterLocalNotificationsPlugin + .resolvePlatformSpecificImplementation< + AndroidFlutterLocalNotificationsPlugin>() + ?.createNotificationChannel(channel); + return flutterLocalNotificationsPlugin; //====================================================================================================== } - - //---------------------------------| Show the notification in the specific time |------------------------------- - Future showNotification(String title, String description, int time, int id, FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin) async { + Future showNotification(String title, String description, int time, int id, + FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin) async { await flutterLocalNotificationsPlugin.zonedSchedule( id.toInt(), title, description, tz.TZDateTime.now(tz.local).add(Duration(milliseconds: time)), const NotificationDetails( - android: AndroidNotificationDetails( - 'medicines_id', 'medicines', 'medicines_notification_channel', + android: AndroidNotificationDetails('medicines_id', 'medicines', + channelDescription: 'medicines_notification_channel', importance: Importance.high, priority: Priority.high, color: Colors.cyanAccent)), - androidAllowWhileIdle: true, + androidScheduleMode: AndroidScheduleMode.exactAllowWhileIdle, uiLocalNotificationDateInterpretation: - UILocalNotificationDateInterpretation.absoluteTime); + UILocalNotificationDateInterpretation.absoluteTime); } //================================================================================================================ - //-------------------------| Cancel the notify |--------------------------- - Future removeNotify(int notifyId, FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin) async{ - try{ + Future removeNotify(int notifyId, + FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin) async { + try { return await flutterLocalNotificationsPlugin.cancel(notifyId); - }catch(e){ + } catch (e) { return null; } } //========================================================================== - - //-------------| function to inicialize local notifications |--------------------------- - Future onSelectNotification(String payload) async { - showDialog( - context: _context, - builder: (_) { - return new AlertDialog( - title: Text("PayLoad"), - content: Text("Payload : $payload"), - ); - }, - ); + //-------------| function to initialize local notifications |--------------------------- + Future onSelectNotification(String? payload) async { + if (payload != null) { + showDialog( + context: _context, + builder: (_) { + return AlertDialog( + title: Text("PayLoad"), + content: Text("Payload : $payload"), + ); + }, + ); + } } //====================================================================================== - - } \ No newline at end of file diff --git a/lib/screens/add_new_medicine/add_new_medicine.dart b/lib/screens/add_new_medicine/add_new_medicine.dart index d096235..f3e199b 100644 --- a/lib/screens/add_new_medicine/add_new_medicine.dart +++ b/lib/screens/add_new_medicine/add_new_medicine.dart @@ -1,6 +1,5 @@ import 'dart:math'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:intl/intl.dart'; @@ -21,32 +20,27 @@ class AddNewMedicine extends StatefulWidget { } class _AddNewMedicineState extends State { - FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin; + late FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin; final _scaffoldKey = GlobalKey(); final Snackbar snackbar = Snackbar(); - //medicine types + //medicines types final List weightValues = ["pills", "ml", "mg"]; //list of medicines forms objects final List medicineTypes = [ MedicineType("Syrup", Image.asset("assets/images/syrup.png"), true), - MedicineType( - "Pill", Image.asset("assets/images/pills.png"), false), - MedicineType( - "Capsule", Image.asset("assets/images/capsule.png"), false), - MedicineType( - "Cream", Image.asset("assets/images/cream.png"), false), - MedicineType( - "Drops", Image.asset("assets/images/drops.png"), false), - MedicineType( - "Syringe", Image.asset("assets/images/syringe.png"), false), + MedicineType("Pill", Image.asset("assets/images/pills.png"), false), + MedicineType("Capsule", Image.asset("assets/images/capsule.png"), false), + MedicineType("Cream", Image.asset("assets/images/cream.png"), false), + MedicineType("Drops", Image.asset("assets/images/drops.png"), false), + MedicineType("Syringe", Image.asset("assets/images/syringe.png"), false), ]; //-------------Pill object------------------ int howManyWeeks = 1; - String selectWeight; + late String selectWeight; DateTime setDate = DateTime.now(); final TextEditingController nameController = TextEditingController(); final TextEditingController amountController = TextEditingController(); @@ -107,8 +101,8 @@ class _AddNewMedicineState extends State { "Add Pills", style: Theme.of(context) .textTheme - .headline3 - .copyWith(color: Colors.black), + .displaySmall + ?.copyWith(color: Colors.black), )), ), SizedBox( @@ -305,17 +299,20 @@ class _AddNewMedicineState extends State { //--------------------------------------SAVE PILL IN DATABASE--------------------------------------- Future savePill() async { - //check if medicine time is lower than actual time + //check if medicines time is lower than actual time if (setDate.millisecondsSinceEpoch <= DateTime.now().millisecondsSinceEpoch) { snackbar.showSnack( - "Check your medicine time and date", _scaffoldKey, null); + context, "Check your medicines time and date", _scaffoldKey, null); } else { //create pill object Pill pill = Pill( + id: Random().nextInt(10000000), amount: amountController.text, howManyWeeks: howManyWeeks, - medicineForm: medicineTypes[medicineTypes.indexWhere((element) => element.isChoose == true)].name, + medicineForm: medicineTypes[medicineTypes + .indexWhere((element) => element.isChoose == true)] + .name, name: nameController.text, time: setDate.millisecondsSinceEpoch, type: selectWeight, @@ -326,13 +323,16 @@ class _AddNewMedicineState extends State { dynamic result = await _repository.insertData("Pills", pill.pillToMap()); if (result == null) { - snackbar.showSnack("Something went wrong", _scaffoldKey, null); + snackbar.showSnack(context, "Something went wrong", _scaffoldKey, null); return; } else { //set the notification schneudele tz.initializeTimeZones(); tz.setLocalLocation(tz.getLocation('Europe/Warsaw')); - await _notifications.showNotification(pill.name, pill.amount + " " + pill.medicineForm + " " + pill.type, time, + await _notifications.showNotification( + pill.name, + pill.amount + " " + pill.medicineForm + " " + pill.type, + time, pill.notifyId, flutterLocalNotificationsPlugin); setDate = setDate.add(Duration(milliseconds: 604800000)); @@ -341,7 +341,7 @@ class _AddNewMedicineState extends State { } } //--------------------------------------------------------------------------------------- - snackbar.showSnack("Saved", _scaffoldKey, null); + snackbar.showSnack(context, "Saved", _scaffoldKey, null); Navigator.pop(context); } } diff --git a/lib/screens/add_new_medicine/form_fields.dart b/lib/screens/add_new_medicine/form_fields.dart index 7e4df48..8616637 100644 --- a/lib/screens/add_new_medicine/form_fields.dart +++ b/lib/screens/add_new_medicine/form_fields.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:medicine/screens/add_new_medicine/slider.dart'; diff --git a/lib/screens/home/home.dart b/lib/screens/home/home.dart index 0832b95..61a16e4 100644 --- a/lib/screens/home/home.dart +++ b/lib/screens/home/home.dart @@ -1,14 +1,36 @@ -import 'package:animated_text_kit/animated_text_kit.dart'; +import 'dart:io'; + import 'package:animated_widgets/animated_widgets.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; -import '../../notifications/notifications.dart'; +import 'package:permission_handler/permission_handler.dart'; + import '../../database/repository.dart'; +import '../../models/calendar_day_model.dart'; import '../../models/pill.dart'; -import '../../screens/home/medicines_list.dart'; +import '../../notifications/notifications.dart'; import '../../screens/home/calendar.dart'; -import '../../models/calendar_day_model.dart'; +import '../../screens/home/medicines_list.dart'; + +Future requestExactAlarmPermission(BuildContext context) async { + if (Platform.isAndroid) { + if (!await Permission.scheduleExactAlarm.isGranted) { + Navigator.of(context).push(MaterialPageRoute( + builder: (context) => Scaffold( + appBar: AppBar(title: Text('Grant Exact Alarm Permission')), + body: Center( + child: ElevatedButton( + onPressed: () { + openAppSettings(); + }, + child: Text('Open Settings to Grant Permission'), + ), + ), + ), + )); + } + } +} class Home extends StatefulWidget { @override @@ -16,21 +38,30 @@ class Home extends StatefulWidget { } class _HomeState extends State { - //-------------------| Flutter notifications |------------------- final Notifications _notifications = Notifications(); - FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin; + late FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin; + //=============================================================== //--------------------| List of Pills from database |---------------------- - List allListOfPills = List(); + List allListOfPills = []; final Repository _repository = Repository(); - List dailyPills = List(); + List dailyPills = []; + //========================================================================= //-----------------| Calendar days |------------------ - final CalendarDayModel _days = CalendarDayModel(); - List _daysList; + + final CalendarDayModel _days = CalendarDayModel( + dayLetter: 'M', + dayNumber: 1, + isChecked: false, + month: 12, + year: 2024, + ); + late List _daysList; + //==================================================== //handle last choose day index in calendar @@ -42,20 +73,38 @@ class _HomeState extends State { initNotifies(); setData(); _daysList = _days.getCurrentDays(); + WidgetsBinding.instance.addPostFrameCallback((_) { + requestExactAlarmPermission(context); + }); } //init notifications - Future initNotifies() async => flutterLocalNotificationsPlugin = await _notifications.initNotifies(context); - + Future initNotifies() async => flutterLocalNotificationsPlugin = + await _notifications.initNotifies(context); //--------------------GET ALL DATA FROM DATABASE--------------------- Future setData() async { allListOfPills.clear(); - (await _repository.getAllData("Pills")).forEach((pillMap) { - allListOfPills.add(Pill().pillMapToObject(pillMap)); - }); + var pillsData = await _repository.getAllData("Pills"); + + if (pillsData != null) { + pillsData.forEach((pillMap) { + // Pastikan parameter 'id' dan yang lainnya diberikan + allListOfPills.add(Pill( + id: pillMap['id'], + name: pillMap['name'], + amount: pillMap['amount'], + type: pillMap['type'], + howManyWeeks: pillMap['howManyWeeks'], + medicineForm: pillMap['medicineForm'], + time: pillMap['time'], + notifyId: pillMap['notifyId'])); + }); + } + chooseDay(_daysList[_lastChooseDay]); } + //=================================================================== @override @@ -104,8 +153,8 @@ class _HomeState extends State { "Journal", style: Theme.of(context) .textTheme - .headline1 - .copyWith(color: Colors.black), + .displayLarge + ?.copyWith(color: Colors.black), ), ShakeAnimatedWidget( enabled: true, @@ -126,26 +175,26 @@ class _HomeState extends State { ), Padding( padding: EdgeInsets.symmetric(horizontal: 5.0), - child: Calendar(chooseDay,_daysList), + child: Calendar(chooseDay, _daysList), ), SizedBox(height: deviceHeight * 0.03), dailyPills.isEmpty ? SizedBox( width: double.infinity, height: 100, - child: WavyAnimatedTextKit( - textStyle: TextStyle( + child: Center( + child: Text( + 'No Reminder', + style: TextStyle( fontSize: 32.0, fontWeight: FontWeight.bold, - color: Colors.black), - text: [ - "Loading..." - ], - isRepeatingAnimation: true, - speed: Duration(milliseconds: 150), + color: Colors.black, + ), + ), ), ) - : MedicinesList(dailyPills,setData,flutterLocalNotificationsPlugin) + : MedicinesList( + dailyPills, setData, flutterLocalNotificationsPlugin) ], ), ), @@ -154,27 +203,27 @@ class _HomeState extends State { ); } - //-------------------------| Click on the calendar day |------------------------- - void chooseDay(CalendarDayModel clickedDay){ + void chooseDay(CalendarDayModel clickedDay) { setState(() { _lastChooseDay = _daysList.indexOf(clickedDay); - _daysList.forEach((day) => day.isChecked = false ); + _daysList.forEach((day) => day.isChecked = false); CalendarDayModel chooseDay = _daysList[_daysList.indexOf(clickedDay)]; chooseDay.isChecked = true; dailyPills.clear(); allListOfPills.forEach((pill) { - DateTime pillDate = DateTime.fromMicrosecondsSinceEpoch(pill.time * 1000); - if(chooseDay.dayNumber == pillDate.day && chooseDay.month == pillDate.month && chooseDay.year == pillDate.year){ + DateTime pillDate = + DateTime.fromMicrosecondsSinceEpoch(pill.time * 1000); + if (chooseDay.dayNumber == pillDate.day && + chooseDay.month == pillDate.month && + chooseDay.year == pillDate.year) { dailyPills.add(pill); } }); - dailyPills.sort((pill1,pill2) => pill1.time.compareTo(pill2.time)); + dailyPills.sort((pill1, pill2) => pill1.time.compareTo(pill2.time)); }); } - //=============================================================================== - - +//=============================================================================== } diff --git a/lib/screens/home/medicine_card.dart b/lib/screens/home/medicine_card.dart index 28e334f..ae8615d 100644 --- a/lib/screens/home/medicine_card.dart +++ b/lib/screens/home/medicine_card.dart @@ -5,6 +5,7 @@ import 'package:medicine/database/repository.dart'; import 'package:medicine/models/pill.dart'; import 'package:medicine/notifications/notifications.dart'; + class MedicineCard extends StatelessWidget { final Pill medicine; @@ -14,7 +15,7 @@ class MedicineCard extends StatelessWidget { @override Widget build(BuildContext context) { - //check if the medicine time is lower than actual + //check if the medicines time is lower than actual final bool isEnd = DateTime.now().millisecondsSinceEpoch > medicine.time; return Card( @@ -30,7 +31,7 @@ class MedicineCard extends StatelessWidget { EdgeInsets.symmetric(vertical: 15.0, horizontal: 15.0), title: Text( medicine.name, - style: Theme.of(context).textTheme.headline1.copyWith( + style: Theme.of(context).textTheme.displayLarge?.copyWith( color: Colors.black, fontSize: 20.0, decoration: isEnd ? TextDecoration.lineThrough : null), @@ -39,7 +40,7 @@ class MedicineCard extends StatelessWidget { ), subtitle: Text( "${medicine.amount} ${medicine.medicineForm}", - style: Theme.of(context).textTheme.headline5.copyWith( + style: Theme.of(context).textTheme.headlineSmall?.copyWith( color: Colors.grey[600], fontSize: 15.0, decoration: isEnd ? TextDecoration.lineThrough : null), @@ -84,12 +85,14 @@ class MedicineCard extends StatelessWidget { context: context, builder: (context) => AlertDialog( title: Text("Delete ?"), - content: Text("Are you sure to delete $medicineName medicine?"), + content: Text("Are you sure to delete $medicineName medicines?"), contentTextStyle: TextStyle(fontSize: 17.0, color: Colors.grey[800]), actions: [ - FlatButton( - splashColor: Theme.of(context).primaryColor.withOpacity(0.3), + TextButton( + style: TextButton.styleFrom( + foregroundColor: Theme.of(context).primaryColor, splashFactory: InkRipple.splashFactory, disabledForegroundColor: Theme.of(context).primaryColor.withOpacity(0.3).withOpacity(0.38), + ), child: Text( "Cancel", style: TextStyle(color: Theme.of(context).primaryColor), @@ -98,10 +101,14 @@ class MedicineCard extends StatelessWidget { Navigator.of(context).pop(); }, ), - FlatButton( - splashColor: Theme.of(context).primaryColor.withOpacity(0.3), - child: Text("Delete", - style: TextStyle(color: Theme.of(context).primaryColor)), + TextButton( + style: TextButton.styleFrom( + foregroundColor: Theme.of(context).primaryColor, splashFactory: InkRipple.splashFactory, disabledForegroundColor: Theme.of(context).primaryColor.withOpacity(0.3).withOpacity(0.38), + ), + child: Text( + "Delete", + style: TextStyle(color: Theme.of(context).primaryColor), + ), onPressed: () async { await Repository().deleteData('Pills', medicineId); await Notifications().removeNotify(notifyId, flutterLocalNotificationsPlugin); diff --git a/lib/screens/welcome/title_and_message.dart b/lib/screens/welcome/title_and_message.dart index 0583d10..9347235 100644 --- a/lib/screens/welcome/title_and_message.dart +++ b/lib/screens/welcome/title_and_message.dart @@ -16,8 +16,8 @@ class TitleAndMessage extends StatelessWidget { "Be in control of your meds", style: Theme.of(context) .textTheme - .headline1 - .copyWith(color: Colors.black, height: 1.3), + .displayLarge + ?.copyWith(color: Colors.black, height: 1.3), textAlign: TextAlign.center, maxLines: 2, ), @@ -31,8 +31,8 @@ class TitleAndMessage extends StatelessWidget { "An easy-to-use and reliable app that helps you remember to take your meds at the right time", style: Theme.of(context) .textTheme - .headline5 - .copyWith(color: Colors.grey[600], height: 1.3,), + .headlineSmall + ?.copyWith(color: Colors.grey[600], height: 1.3,), textAlign: TextAlign.center, maxLines: 3, ), diff --git a/lib/screens/welcome/welcome.dart b/lib/screens/welcome/welcome.dart index 1795feb..6bac4b2 100644 --- a/lib/screens/welcome/welcome.dart +++ b/lib/screens/welcome/welcome.dart @@ -38,8 +38,8 @@ class Welcome extends StatelessWidget { "Get started now", style: Theme.of(context) .textTheme - .headline3 - .copyWith(color: Colors.white), + .displaySmall + ?.copyWith(color: Colors.white), ), ), )), diff --git a/pubspec.lock b/pubspec.lock index 910e7ca..9218eda 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,79 +5,106 @@ packages: dependency: "direct main" description: name: animated_text_kit - url: "https://pub.dartlang.org" + sha256: "37392a5376c9a1a503b02463c38bc0342ef814ddbb8f9977bc90f2a84b22fa92" + url: "https://pub.dev" source: hosted - version: "2.5.3" + version: "4.2.2" animated_widgets: dependency: "direct main" description: name: animated_widgets - url: "https://pub.dartlang.org" + sha256: "2d6b77a77fc733b06e185553ec0b8225ffd1dd0e6fa327900ff26f1e04995eda" + url: "https://pub.dev" source: hosted - version: "1.0.6" + version: "1.1.0" + args: + dependency: transitive + description: + name: args + sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6 + url: "https://pub.dev" + source: hosted + version: "2.6.0" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.4.2" + version: "2.11.0" auto_size_text: dependency: "direct main" description: name: auto_size_text - url: "https://pub.dartlang.org" + sha256: "3f5261cd3fb5f2a9ab4e2fc3fba84fd9fcaac8821f20a1d4e71f557521b22599" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "3.0.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.1.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "1.0.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.3" + version: "1.3.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.dev" source: hosted - version: "1.14.13" + version: "1.18.0" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.dartlang.org" + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 + url: "https://pub.dev" source: hosted - version: "0.1.3" + version: "1.0.8" + dbus: + dependency: transitive + description: + name: dbus + sha256: "365c771ac3b0e58845f39ec6deebc76e3276aa9922b0cc60840712094d9047ac" + url: "https://pub.dev" + source: hosted + version: "0.7.10" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.3.1" + ffi: + dependency: transitive + description: + name: ffi + sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6" + url: "https://pub.dev" + source: hosted + version: "2.1.3" flutter: dependency: "direct main" description: flutter @@ -87,63 +114,172 @@ packages: dependency: "direct main" description: name: flutter_local_notifications - url: "https://pub.dartlang.org" + sha256: ef41ae901e7529e52934feba19ed82827b11baa67336829564aeab3129460610 + url: "https://pub.dev" + source: hosted + version: "18.0.1" + flutter_local_notifications_linux: + dependency: transitive + description: + name: flutter_local_notifications_linux + sha256: "8f685642876742c941b29c32030f6f4f6dacd0e4eaecb3efbb187d6a3812ca01" + url: "https://pub.dev" source: hosted - version: "3.0.1+2" + version: "5.0.0" flutter_local_notifications_platform_interface: dependency: transitive description: name: flutter_local_notifications_platform_interface - url: "https://pub.dartlang.org" + sha256: "6c5b83c86bf819cdb177a9247a3722067dd8cc6313827ce7c77a4b238a26fd52" + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "8.0.0" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" intl: dependency: "direct main" description: name: intl - url: "https://pub.dartlang.org" + sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf + url: "https://pub.dev" source: hosted - version: "0.16.1" + version: "0.19.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" + url: "https://pub.dev" + source: hosted + version: "10.0.5" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" + url: "https://pub.dev" + source: hosted + version: "3.0.5" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.dev" + source: hosted + version: "3.0.1" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + url: "https://pub.dev" + source: hosted + version: "0.12.16+1" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" source: hosted - version: "0.12.8" + version: "0.11.1" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 + url: "https://pub.dev" source: hosted - version: "1.1.8" + version: "1.15.0" path: dependency: "direct main" description: name: path - url: "https://pub.dartlang.org" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + url: "https://pub.dev" + source: hosted + version: "1.9.0" + permission_handler: + dependency: "direct main" + description: + name: permission_handler + sha256: "18bf33f7fefbd812f37e72091a15575e72d5318854877e0e4035a24ac1113ecb" + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "11.3.1" + permission_handler_android: + dependency: transitive + description: + name: permission_handler_android + sha256: "71bbecfee799e65aff7c744761a57e817e73b738fedf62ab7afd5593da21f9f1" + url: "https://pub.dev" + source: hosted + version: "12.0.13" + permission_handler_apple: + dependency: transitive + description: + name: permission_handler_apple + sha256: e6f6d73b12438ef13e648c4ae56bd106ec60d17e90a59c4545db6781229082a0 + url: "https://pub.dev" + source: hosted + version: "9.4.5" + permission_handler_html: + dependency: transitive + description: + name: permission_handler_html + sha256: "38f000e83355abb3392140f6bc3030660cfaef189e1f87824facb76300b4ff24" + url: "https://pub.dev" + source: hosted + version: "0.1.3+5" + permission_handler_platform_interface: + dependency: transitive + description: + name: permission_handler_platform_interface + sha256: e9c8eadee926c4532d0305dff94b85bf961f16759c3af791486613152af4b4f9 + url: "https://pub.dev" + source: hosted + version: "4.2.3" + permission_handler_windows: + dependency: transitive + description: + name: permission_handler_windows + sha256: "1a790728016f79a41216d88672dbc5df30e686e811ad4e698bfc51f76ad91f1e" + url: "https://pub.dev" + source: hosted + version: "0.2.1" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 + url: "https://pub.dev" + source: hosted + version: "6.0.2" platform: dependency: transitive description: name: platform - url: "https://pub.dartlang.org" + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" + url: "https://pub.dev" source: hosted - version: "2.2.1" + version: "3.1.6" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.dartlang.org" + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "2.1.8" sky_engine: dependency: transitive description: flutter @@ -153,86 +289,146 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.10.0" sqflite: dependency: "direct main" description: name: sqflite - url: "https://pub.dartlang.org" + sha256: "2d7299468485dca85efeeadf5d38986909c5eb0cd71fd3db2c2f000e6c9454bb" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + sqflite_android: + dependency: transitive + description: + name: sqflite_android + sha256: "78f489aab276260cdd26676d2169446c7ecd3484bbd5fead4ca14f3ed4dd9ee3" + url: "https://pub.dev" source: hosted - version: "1.3.1+1" + version: "2.4.0" sqflite_common: dependency: transitive description: name: sqflite_common - url: "https://pub.dartlang.org" + sha256: "761b9740ecbd4d3e66b8916d784e581861fd3c3553eda85e167bc49fdb68f709" + url: "https://pub.dev" + source: hosted + version: "2.5.4+6" + sqflite_darwin: + dependency: transitive + description: + name: sqflite_darwin + sha256: "96a698e2bc82bd770a4d6aab00b42396a7c63d9e33513a56945cbccb594c2474" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + sqflite_platform_interface: + dependency: transitive + description: + name: sqflite_platform_interface + sha256: "8dd4515c7bdcae0a785b0062859336de775e8c65db81ae33dd5445f35be61920" + url: "https://pub.dev" source: hosted - version: "1.0.2+1" + version: "2.4.0" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + url: "https://pub.dev" source: hosted - version: "1.9.5" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.1.2" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.0.5" + version: "1.2.0" synchronized: dependency: transitive description: name: synchronized - url: "https://pub.dartlang.org" + sha256: "69fe30f3a8b04a0be0c15ae6490fc859a78ef4c43ae2dd5e8a623d45bfcf9225" + url: "https://pub.dev" source: hosted - version: "2.2.0+2" + version: "3.3.0+3" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" + url: "https://pub.dev" source: hosted - version: "0.2.17" + version: "0.7.2" timezone: dependency: "direct main" description: name: timezone - url: "https://pub.dartlang.org" + sha256: "2236ec079a174ce07434e89fcd3fcda430025eb7692244139a9cf54fdcf1fc7d" + url: "https://pub.dev" source: hosted - version: "0.5.9" - typed_data: + version: "0.9.4" + vector_math: dependency: transitive description: - name: typed_data - url: "https://pub.dartlang.org" + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "1.2.0" - vector_math: + version: "2.1.4" + vm_service: dependency: transitive description: - name: vector_math - url: "https://pub.dartlang.org" + name: vm_service + sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + url: "https://pub.dev" + source: hosted + version: "14.2.5" + web: + dependency: transitive + description: + name: web + sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb + url: "https://pub.dev" + source: hosted + version: "1.1.0" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + xml: + dependency: transitive + description: + name: xml + sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 + url: "https://pub.dev" source: hosted - version: "2.0.8" + version: "6.5.0" sdks: - dart: ">=2.9.0-14.0.dev <3.0.0" - flutter: ">=1.12.13+hotfix.5 <2.0.0" + dart: "3.5.4" + flutter: ">=3.24.0" diff --git a/pubspec.yaml b/pubspec.yaml index 2787337..8c07f5c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ">=2.7.0 <3.0.0" + sdk: "3.5.4" dependencies: flutter: @@ -27,15 +27,17 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^0.1.3 - intl: ^0.16.1 - sqflite: ^1.3.1+1 - auto_size_text: ^2.1.0 - path: ^1.7.0 - flutter_local_notifications: ^3.0.1+2 - timezone: ^0.5.9 - animated_text_kit: ^2.5.3 - animated_widgets: ^1.0.6 + cupertino_icons: ^1.0.8 + intl: ^0.19.0 + sqflite: ^2.3.3+1 + auto_size_text: ^3.0.0 + path: ^1.9.0 + flutter_local_notifications: ^18.0.1 + timezone: ^0.9.3 + animated_text_kit: ^4.2.2 + animated_widgets: ^1.1.0 + permission_handler: ^11.3.1 + dev_dependencies: flutter_test: sdk: flutter