Skip to content

557: Align Undo Duration Text with Other Items in Settings #748

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"cmake.sourceDirectory": "E:/ultimate_alarm_clock/linux"
"cmake.sourceDirectory": "E:/ultimate_alarm_clock/linux",
"java.configuration.updateBuildConfiguration": "automatic"
}
6 changes: 4 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ if (keystorePropertiesFile.exists()) {
}

android {
// namespace "com.example.fl_location"
namespace "com.ccextractor.ultimate_alarm_clock"
compileSdkVersion 34
ndkVersion flutter.ndkVersion

Expand Down Expand Up @@ -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")
Expand Down
21 changes: 16 additions & 5 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
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 {
google()
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'
}
Expand All @@ -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
}
3 changes: 3 additions & 0 deletions devtools_options.yaml
Original file line number Diff line number Diff line change
@@ -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:
35 changes: 21 additions & 14 deletions lib/app/data/providers/isar_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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();
Expand Down Expand Up @@ -177,7 +177,8 @@ class IsarDb {
static Future<ProfileModel?> 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;
}
Expand All @@ -196,7 +197,8 @@ class IsarDb {
static Future<bool> 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;
}
Expand Down Expand Up @@ -372,7 +374,7 @@ class IsarDb {
'profileName': currentProfileName,
'profileData': ProfileModel.toMap(currentProfile!),
'alarmData': alarmMaps,
'owner': ''
'owner': '',
};
return profileSet;
}
Expand Down Expand Up @@ -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,
},
]);
});
Expand Down
47 changes: 21 additions & 26 deletions lib/app/modules/settings/views/customize_undo_duration.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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<HomeController>();
class CustomizeUndoDuration extends StatelessWidget {
final HomeController homeController = Get.find<HomeController>();
CustomizeUndoDuration({
super.key ,
super.key,
required this.themeController,
required this.height,
required this.width,
Expand All @@ -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;
Expand All @@ -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,
Expand All @@ -50,15 +50,14 @@ class CustomizeUndoDuration extends StatelessWidget{
onChanged: (double value) {
homeController.selecteddurationDouble.value = value;
homeController.duration.value = value.toInt();

},
min: 0.0,
max: 20.0,
divisions: 20,
label: homeController.duration.value.toString(),
),
// Replace the volMin Slider with RangeSlider

ElevatedButton(
onPressed: () {
Get.back();
Expand All @@ -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(
Expand All @@ -114,12 +110,11 @@ class CustomizeUndoDuration extends StatelessWidget{
),
],
),
),
],
),
),
),
),
);
}

}
}
7 changes: 4 additions & 3 deletions lib/app/modules/settings/views/enable_24Hour_format.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -31,10 +31,11 @@ class _Enable24HourFormatState extends State<Enable24HourFormat> {
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: [
Expand Down
4 changes: 2 additions & 2 deletions lib/app/modules/settings/views/enable_haptic_feedback.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -35,7 +35,7 @@ class _EnableHapticFeedbackState extends State<EnableHapticFeedback> {
widget.themeController.currentTheme.value == ThemeMode.light,
),
child: Padding(
padding: const EdgeInsets.only(left: 30, right: 20),
padding: containerPadding,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expand Down
5 changes: 3 additions & 2 deletions lib/app/modules/settings/views/enable_sorted_alarm_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,16 @@ class _EnableSortedAlarmListState extends State<EnableSortedAlarmList> {
color: widget.themeController.secondaryBackgroundColor.value,
),
child: Padding(
padding: EdgeInsets.only(left: 30, right: 20),
padding: containerPadding,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
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(
Expand Down
6 changes: 2 additions & 4 deletions lib/app/modules/settings/views/settings_view.dart
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -49,7 +47,7 @@ class SettingsView extends GetView<SettingsController> {
body: SingleChildScrollView(
child: Center(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 25.0),
padding: const EdgeInsets.all(16),
child: Column(
children: [
GoogleSignIn(
Expand Down
2 changes: 1 addition & 1 deletion lib/app/modules/settings/views/theme_value_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class _ThemeValueTileState extends State<ThemeValueTile> {
widget.themeController.currentTheme.value == ThemeMode.light,
),
child: Padding(
padding: EdgeInsets.only(left: 30, right: 20),
padding: containerPadding,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expand Down
Loading