diff --git a/.vscode/settings.json b/.vscode/settings.json index 39657137..8e818264 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,4 @@ { - "cmake.sourceDirectory": "E:/ultimate_alarm_clock/linux" + "cmake.sourceDirectory": "E:/ultimate_alarm_clock/linux", + "java.configuration.updateBuildConfiguration": "automatic" } \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index 3da777f2..3d743a50 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -33,6 +33,8 @@ if (keystorePropertiesFile.exists()) { } android { + // namespace "com.example.fl_location" + namespace "com.ccextractor.ultimate_alarm_clock" compileSdkVersion 34 ndkVersion flutter.ndkVersion @@ -94,8 +96,8 @@ flutter { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - implementation "org.jetbrains.kotlin:kotlin-stdlib:1.7.10" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10" + // implementation "org.jetbrains.kotlin:kotlin-stdlib:1.8.22" + // implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10" implementation platform('com.google.firebase:firebase-bom:32.0.0') // Updated Firebase BOM to latest implementation 'com.google.firebase:protolite-well-known-types:18.0.0' implementation("com.android.volley:volley:1.2.1") diff --git a/android/build.gradle b/android/build.gradle index 5dc5d980..0e2e252c 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,8 +1,8 @@ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.8.22' ext { - compileSdkVersion = 34 - targetSdkVersion = 34 + compileSdkVersion = 35 + targetSdkVersion = 35 appCompatVersion = "1.6.1" } repositories { @@ -10,7 +10,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' + classpath 'com.android.tools.build:gradle:8.1.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.google.gms:google-services:4.3.15' } @@ -27,10 +27,21 @@ rootProject.buildDir = '../build' subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" } + +subprojects { + afterEvaluate { project -> + if (project.hasProperty('android')) { + project.android { + if (namespace == null) { + namespace project.group + } + } + } + } +} subprojects { project.evaluationDependsOn(':app') } - tasks.register("clean", Delete) { delete rootProject.buildDir } \ No newline at end of file diff --git a/devtools_options.yaml b/devtools_options.yaml new file mode 100644 index 00000000..fa0b357c --- /dev/null +++ b/devtools_options.yaml @@ -0,0 +1,3 @@ +description: This file stores settings for Dart & Flutter DevTools. +documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states +extensions: diff --git a/lib/app/data/providers/isar_provider.dart b/lib/app/data/providers/isar_provider.dart index 27a26bd4..80fc9be5 100644 --- a/lib/app/data/providers/isar_provider.dart +++ b/lib/app/data/providers/isar_provider.dart @@ -4,6 +4,7 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:isar/isar.dart'; import 'package:path_provider/path_provider.dart'; +import 'package:sqflite/sqflite.dart'; import 'package:ultimate_alarm_clock/app/data/models/alarm_model.dart'; import 'package:ultimate_alarm_clock/app/data/models/profile_model.dart'; import 'package:ultimate_alarm_clock/app/data/models/ringtone_model.dart'; @@ -12,7 +13,6 @@ import 'package:ultimate_alarm_clock/app/data/models/timer_model.dart'; import 'package:ultimate_alarm_clock/app/data/providers/firestore_provider.dart'; import 'package:ultimate_alarm_clock/app/data/providers/get_storage_provider.dart'; import 'package:ultimate_alarm_clock/app/utils/utils.dart'; -import 'package:sqflite/sqflite.dart'; class IsarDb { static final IsarDb _instance = IsarDb._internal(); @@ -177,7 +177,8 @@ class IsarDb { static Future getProfile(String name) async { final isarProvider = IsarDb(); final db = await isarProvider.db; - final a = await db.profileModels.filter().profileNameEqualTo(name).findFirst(); + final a = + await db.profileModels.filter().profileNameEqualTo(name).findFirst(); print('$a appkle'); return a; } @@ -196,7 +197,8 @@ class IsarDb { static Future profileExists(String name) async { final isarProvider = IsarDb(); final db = await isarProvider.db; - final a = await db.profileModels.filter().profileNameEqualTo(name).findFirst(); + final a = + await db.profileModels.filter().profileNameEqualTo(name).findFirst(); return a != null; } @@ -372,7 +374,7 @@ class IsarDb { 'profileName': currentProfileName, 'profileData': ProfileModel.toMap(currentProfile!), 'alarmData': alarmMaps, - 'owner': '' + 'owner': '', }; return profileSet; } @@ -633,30 +635,35 @@ class IsarDb { if (ringtoneCount.isEmpty) { await db.writeTxn(() async { await db.ringtoneModels.importJson([ - {'isarId' : fastHash('Digital Alarm 1'), + { + 'isarId': fastHash('Digital Alarm 1'), 'ringtoneName': 'Digital Alarm 1', 'ringtonePath': 'ringtones/digialarm.mp3', - 'currentCounterOfUsage': 0 + 'currentCounterOfUsage': 0, }, - {'isarId' : fastHash('Digital Alarm 2'), + { + 'isarId': fastHash('Digital Alarm 2'), 'ringtoneName': 'Digital Alarm 2', 'ringtonePath': 'ringtones/digialarm2.mp3', - 'currentCounterOfUsage': 0 + 'currentCounterOfUsage': 0, }, - {'isarId' : fastHash('Digital Alarm 3'), + { + 'isarId': fastHash('Digital Alarm 3'), 'ringtoneName': 'Digital Alarm 3', 'ringtonePath': 'ringtones/digialarm3.mp3', - 'currentCounterOfUsage': 0 + 'currentCounterOfUsage': 0, }, - {'isarId' : fastHash('Mystery'), + { + 'isarId': fastHash('Mystery'), 'ringtoneName': 'Mystery', 'ringtonePath': 'ringtones/mystery.mp3', - 'currentCounterOfUsage': 0 + 'currentCounterOfUsage': 0, }, - {'isarId' : fastHash('New Day'), + { + 'isarId': fastHash('New Day'), 'ringtoneName': 'New Day', 'ringtonePath': 'ringtones/newday.mp3', - 'currentCounterOfUsage': 0 + 'currentCounterOfUsage': 0, }, ]); }); diff --git a/lib/app/modules/settings/views/customize_undo_duration.dart b/lib/app/modules/settings/views/customize_undo_duration.dart index 0d49abfb..aef0c7f6 100644 --- a/lib/app/modules/settings/views/customize_undo_duration.dart +++ b/lib/app/modules/settings/views/customize_undo_duration.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:ultimate_alarm_clock/app/modules/home/controllers/home_controller.dart'; @@ -7,10 +6,10 @@ import '../../../utils/constants.dart'; import '../../../utils/utils.dart'; import '../controllers/theme_controller.dart'; -class CustomizeUndoDuration extends StatelessWidget{ - HomeController homeController = Get.find(); +class CustomizeUndoDuration extends StatelessWidget { + final HomeController homeController = Get.find(); CustomizeUndoDuration({ - super.key , + super.key, required this.themeController, required this.height, required this.width, @@ -23,7 +22,7 @@ class CustomizeUndoDuration extends StatelessWidget{ Widget build(BuildContext context) { int duration; return Obx( - () => InkWell( + () => InkWell( onTap: () { Utils.hapticFeedback(); duration = homeController.duration.value; @@ -34,12 +33,13 @@ class CustomizeUndoDuration extends StatelessWidget{ homeController.duration.value = duration; return true; }, - titlePadding: const EdgeInsets.symmetric(vertical: 20, horizontal: 5), + // titlePadding: + // const EdgeInsets.symmetric(vertical: 20, horizontal: 5), backgroundColor: themeController.secondaryBackgroundColor.value, title: 'Customize Undo Duration'.tr, titleStyle: Theme.of(context).textTheme.displaySmall, content: Obx( - () => Column( + () => Column( children: [ Text( '${homeController.duration.value} seconds'.tr, @@ -50,7 +50,6 @@ class CustomizeUndoDuration extends StatelessWidget{ onChanged: (double value) { homeController.selecteddurationDouble.value = value; homeController.duration.value = value.toInt(); - }, min: 0.0, max: 20.0, @@ -58,7 +57,7 @@ class CustomizeUndoDuration extends StatelessWidget{ label: homeController.duration.value.toString(), ), // Replace the volMin Slider with RangeSlider - + ElevatedButton( onPressed: () { Get.back(); @@ -79,33 +78,30 @@ class CustomizeUndoDuration extends StatelessWidget{ ); }, child: Container( + padding: containerPadding, width: width * 0.91, height: height * 0.09, decoration: Utils.getCustomTileBoxDecoration( isLightMode: themeController.currentTheme.value == ThemeMode.light, ), child: Center( - child: Padding( - padding: EdgeInsets.only(left: 10, right: 10), - child: ListTile( - tileColor: themeController.secondaryBackgroundColor.value, - title: Text( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( 'Undo Duration'.tr, - style: TextStyle( - color: themeController.primaryTextColor.value, - fontSize: 15 - ), + style: Theme.of(context).textTheme.bodyLarge, ), - trailing: Wrap( + Wrap( crossAxisAlignment: WrapCrossAlignment.center, children: [ Obx( - () => Text( + () => Text( '${homeController.duration.value.round().toInt()} seconds', style: Theme.of(context).textTheme.bodyMedium!.copyWith( - color: themeController.primaryTextColor.value, - fontSize: 13 - ), + color: themeController.primaryTextColor.value, + fontSize: 13, + ), ), ), Icon( @@ -114,12 +110,11 @@ class CustomizeUndoDuration extends StatelessWidget{ ), ], ), - ), + ], ), ), ), ), ); } - -} \ No newline at end of file +} diff --git a/lib/app/modules/settings/views/enable_24Hour_format.dart b/lib/app/modules/settings/views/enable_24Hour_format.dart index 55893d46..d0331356 100644 --- a/lib/app/modules/settings/views/enable_24Hour_format.dart +++ b/lib/app/modules/settings/views/enable_24Hour_format.dart @@ -2,8 +2,8 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:ultimate_alarm_clock/app/modules/settings/controllers/settings_controller.dart'; import 'package:ultimate_alarm_clock/app/modules/settings/controllers/theme_controller.dart'; -import 'package:ultimate_alarm_clock/app/utils/utils.dart'; import 'package:ultimate_alarm_clock/app/utils/constants.dart'; +import 'package:ultimate_alarm_clock/app/utils/utils.dart'; class Enable24HourFormat extends StatefulWidget { const Enable24HourFormat({ @@ -31,10 +31,11 @@ class _Enable24HourFormatState extends State { width: widget.width * 0.91, height: widget.height * 0.1, decoration: Utils.getCustomTileBoxDecoration( - isLightMode: widget.themeController.currentTheme.value == ThemeMode.light, + isLightMode: + widget.themeController.currentTheme.value == ThemeMode.light, ), child: Padding( - padding: const EdgeInsets.only(left: 30, right: 20), + padding: containerPadding, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ diff --git a/lib/app/modules/settings/views/enable_haptic_feedback.dart b/lib/app/modules/settings/views/enable_haptic_feedback.dart index 165dc865..93459992 100644 --- a/lib/app/modules/settings/views/enable_haptic_feedback.dart +++ b/lib/app/modules/settings/views/enable_haptic_feedback.dart @@ -2,8 +2,8 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:ultimate_alarm_clock/app/modules/settings/controllers/settings_controller.dart'; import 'package:ultimate_alarm_clock/app/modules/settings/controllers/theme_controller.dart'; -import 'package:ultimate_alarm_clock/app/utils/utils.dart'; import 'package:ultimate_alarm_clock/app/utils/constants.dart'; +import 'package:ultimate_alarm_clock/app/utils/utils.dart'; class EnableHapticFeedback extends StatefulWidget { const EnableHapticFeedback({ @@ -35,7 +35,7 @@ class _EnableHapticFeedbackState extends State { widget.themeController.currentTheme.value == ThemeMode.light, ), child: Padding( - padding: const EdgeInsets.only(left: 30, right: 20), + padding: containerPadding, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ diff --git a/lib/app/modules/settings/views/enable_sorted_alarm_list.dart b/lib/app/modules/settings/views/enable_sorted_alarm_list.dart index 260a458b..3980a0a6 100644 --- a/lib/app/modules/settings/views/enable_sorted_alarm_list.dart +++ b/lib/app/modules/settings/views/enable_sorted_alarm_list.dart @@ -38,7 +38,7 @@ class _EnableSortedAlarmListState extends State { color: widget.themeController.secondaryBackgroundColor.value, ), child: Padding( - padding: EdgeInsets.only(left: 30, right: 20), + padding: containerPadding, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -46,7 +46,8 @@ class _EnableSortedAlarmListState extends State { child: Text( 'Enable Sorted Alarm List'.tr, style: Theme.of(context).textTheme.bodyLarge!.copyWith( - color: widget.themeController.primaryTextColor.value), + color: widget.themeController.primaryTextColor.value, + ), ), ), Obx( diff --git a/lib/app/modules/settings/views/settings_view.dart b/lib/app/modules/settings/views/settings_view.dart index 680430cd..13ed3b67 100644 --- a/lib/app/modules/settings/views/settings_view.dart +++ b/lib/app/modules/settings/views/settings_view.dart @@ -1,15 +1,13 @@ import 'package:flutter/material.dart'; - import 'package:get/get.dart'; import 'package:ultimate_alarm_clock/app/modules/settings/views/customize_undo_duration.dart'; - import 'package:ultimate_alarm_clock/app/modules/settings/views/enable_24Hour_format.dart'; - import 'package:ultimate_alarm_clock/app/modules/settings/views/enable_haptic_feedback.dart'; import 'package:ultimate_alarm_clock/app/modules/settings/views/enable_sorted_alarm_list.dart'; import 'package:ultimate_alarm_clock/app/modules/settings/views/language_menu.dart'; import 'package:ultimate_alarm_clock/app/modules/settings/views/theme_value_tile.dart'; import 'package:ultimate_alarm_clock/app/utils/utils.dart'; + import '../controllers/settings_controller.dart'; import 'google_sign_in.dart'; @@ -49,7 +47,7 @@ class SettingsView extends GetView { body: SingleChildScrollView( child: Center( child: Padding( - padding: const EdgeInsets.symmetric(vertical: 25.0), + padding: const EdgeInsets.all(16), child: Column( children: [ GoogleSignIn( diff --git a/lib/app/modules/settings/views/theme_value_tile.dart b/lib/app/modules/settings/views/theme_value_tile.dart index 589daf24..b0b863bd 100644 --- a/lib/app/modules/settings/views/theme_value_tile.dart +++ b/lib/app/modules/settings/views/theme_value_tile.dart @@ -41,7 +41,7 @@ class _ThemeValueTileState extends State { widget.themeController.currentTheme.value == ThemeMode.light, ), child: Padding( - padding: EdgeInsets.only(left: 30, right: 20), + padding: containerPadding, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ diff --git a/lib/app/utils/constants.dart b/lib/app/utils/constants.dart index e6773e72..02500fa3 100644 --- a/lib/app/utils/constants.dart +++ b/lib/app/utils/constants.dart @@ -33,7 +33,9 @@ const Color kLightSecondaryBackgroundColor = Color(0xffF9F9F9); const Color kLightPrimaryTextColor = Color(0xff444444); const Color kLightSecondaryTextColor = Color(0xff444444); const Color kLightPrimaryDisabledTextColor = Color(0xffACACAB); - +// padding +EdgeInsetsGeometry containerPadding = + const EdgeInsets.only(left: 30, right: 20); // Dark ThemeData ThemeData kThemeData = ThemeData( canvasColor: kprimaryBackgroundColor, @@ -46,8 +48,8 @@ ThemeData kThemeData = ThemeData( ), fontFamily: 'poppins', checkboxTheme: CheckboxThemeData( - checkColor: MaterialStateProperty.all(kprimaryTextColor), - fillColor: MaterialStateProperty.all(kprimaryBackgroundColor), + checkColor: WidgetStateProperty.all(kprimaryTextColor), + fillColor: WidgetStateProperty.all(kprimaryBackgroundColor), ), textTheme: const TextTheme( titleSmall: TextStyle(color: kprimaryTextColor, letterSpacing: 0.15), @@ -84,7 +86,7 @@ ThemeData kThemeData = ThemeData( appBarTheme: const AppBarTheme(backgroundColor: kprimaryBackgroundColor), colorScheme: ColorScheme.fromSwatch().copyWith( secondary: ksecondaryColor, - background: kprimaryBackgroundColor, + surface: kprimaryBackgroundColor, onPrimaryContainer: ksecondaryBackgroundColor, ), inputDecorationTheme: InputDecorationTheme( @@ -112,8 +114,8 @@ ThemeData kThemeData = ThemeData( ), outlinedButtonTheme: const OutlinedButtonThemeData( style: ButtonStyle( - backgroundColor: MaterialStatePropertyAll(Colors.transparent), - side: MaterialStatePropertyAll(BorderSide(color: kprimaryColor)), + backgroundColor: WidgetStatePropertyAll(Colors.transparent), + side: WidgetStatePropertyAll(BorderSide(color: kprimaryColor)), ), ), bottomNavigationBarTheme: const BottomNavigationBarThemeData( @@ -189,8 +191,8 @@ ThemeData kLightThemeData = ThemeData( ), fontFamily: 'poppins', checkboxTheme: CheckboxThemeData( - checkColor: MaterialStateProperty.all(kprimaryTextColor), - fillColor: MaterialStateProperty.all(kLightPrimaryBackgroundColor), + checkColor: WidgetStateProperty.all(kprimaryTextColor), + fillColor: WidgetStateProperty.all(kLightPrimaryBackgroundColor), ), textTheme: const TextTheme( titleSmall: TextStyle(color: kLightPrimaryTextColor, letterSpacing: 0.15), @@ -227,7 +229,7 @@ ThemeData kLightThemeData = ThemeData( appBarTheme: const AppBarTheme(backgroundColor: kLightPrimaryBackgroundColor), colorScheme: ColorScheme.fromSwatch().copyWith( secondary: kLightSecondaryColor, - background: kLightPrimaryBackgroundColor, + surface: kLightPrimaryBackgroundColor, onPrimaryContainer: kLightSecondaryBackgroundColor, ), inputDecorationTheme: InputDecorationTheme( @@ -255,8 +257,8 @@ ThemeData kLightThemeData = ThemeData( ), outlinedButtonTheme: const OutlinedButtonThemeData( style: ButtonStyle( - backgroundColor: MaterialStatePropertyAll(Colors.transparent), - side: MaterialStatePropertyAll(BorderSide(color: kprimaryColor)), + backgroundColor: WidgetStatePropertyAll(Colors.transparent), + side: WidgetStatePropertyAll(BorderSide(color: kprimaryColor)), ), ), bottomNavigationBarTheme: const BottomNavigationBarThemeData( @@ -321,7 +323,13 @@ ThemeData kLightThemeData = ThemeData( ), ); -const List defaultRingtones = ['Digital Alarm 1','Digital Alarm 2','Digital Alarm 3','Mystery','New Day']; +const List defaultRingtones = [ + 'Digital Alarm 1', + 'Digital Alarm 2', + 'Digital Alarm 3', + 'Mystery', + 'New Day', +]; const Map Holidays = { 'Christian Holidays': 'en.christian#holiday@group.v.calendar.google.com', diff --git a/pubspec.yaml b/pubspec.yaml index ddf51bbd..28a4c693 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -65,6 +65,9 @@ dev_dependencies: flutter_test: sdk: flutter +dependency_overrides: + sensors_plus: ^6.1.1 + flutter_native_splash: android: true ios: true