diff --git a/.gitignore b/.gitignore index f99cbc8b..04a1d8a0 100644 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,6 @@ app.*.map.json /windows/flutter/generated_plugins.cmake /lib/firebase_options.dart /firebase.json + +# FVM Version Cache +.fvm/ \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 39657137..9354ab2b 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", + } \ No newline at end of file diff --git a/lib/app/modules/timer/views/timer_animation.dart b/lib/app/modules/timer/views/timer_animation.dart index a868377b..d383800d 100644 --- a/lib/app/modules/timer/views/timer_animation.dart +++ b/lib/app/modules/timer/views/timer_animation.dart @@ -1,6 +1,4 @@ import 'dart:async'; -import 'dart:ui'; -import 'dart:math' as math; import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:ultimate_alarm_clock/app/data/models/timer_model.dart'; @@ -63,8 +61,9 @@ class _TimerAnimatedCardState extends State widget.timer.startedOn, widget.timer.timerValue) < widget.timer.timerValue && widget.timer.isPaused == 0) { - widget.timer.timeElapsed =widget.timer.timerValue-Utils.getDifferenceMillisFromNow( - widget.timer.startedOn, widget.timer.timerValue); + widget.timer.timeElapsed = widget.timer.timerValue - + Utils.getDifferenceMillisFromNow( + widget.timer.startedOn, widget.timer.timerValue); IsarDb.updateTimerPauseStatus(widget.timer); } if (widget.timer.isPaused == 0) { @@ -84,203 +83,214 @@ class _TimerAnimatedCardState extends State padding: const EdgeInsets.symmetric( horizontal: 10.0, ), - child: Container( - height: context.height / 3.3, - width: context.width, - child: Obx( - () => Card( - margin: const EdgeInsets.all(5), - color: widget.timer.timeElapsed < widget.timer.timerValue - ? themeController.secondaryBackgroundColor.value - : themeController.secondaryColor.value, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular( - 18, + child: SingleChildScrollView( + child: Container( + height: context.height / 3.3, + width: context.width, + child: Obx( + () => Card( + margin: const EdgeInsets.all(5), + color: widget.timer.timeElapsed < widget.timer.timerValue + ? themeController.secondaryBackgroundColor.value + : themeController.secondaryColor.value, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular( + 18, + ), ), - ), - child: ClipRRect( - borderRadius: BorderRadius.circular(18), - child: Stack( - children: [ - AnimatedContainer( - decoration: BoxDecoration( - color: kprimaryDisabledTextColor.withOpacity(0.1), - borderRadius: BorderRadius.circular(18)), - duration: Duration(milliseconds: 1000), - height: context.height / 3.3, - width: context.width * - ((widget.timer.timeElapsed) / - (widget.timer.timerValue)), - ), - Center( - child: Padding( - padding: const EdgeInsets.only( - left: 25.0, - right: 20.0, - top: 20.0, - bottom: 20.0, - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Expanded( - flex: 3, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Text( - widget.timer.timerName, - overflow: TextOverflow.ellipsis, - // Set overflow property here - style: Theme.of( - context, - ).textTheme.bodySmall!.copyWith( - fontWeight: FontWeight.w500, - color: kprimaryColor, - fontSize: 18), - ), - Spacer(), - Padding( - padding: const EdgeInsets.only(right: 16.0), - child: InkWell( + child: ClipRRect( + borderRadius: BorderRadius.circular(18), + child: Stack( + children: [ + AnimatedContainer( + decoration: BoxDecoration( + color: kprimaryDisabledTextColor.withOpacity(0.1), + borderRadius: BorderRadius.circular(18)), + duration: Duration(milliseconds: 1000), + height: context.height / 3.3, + width: context.width * + ((widget.timer.timeElapsed) / + (widget.timer.timerValue)), + ), + Center( + child: Padding( + padding: const EdgeInsets.only( + left: 25.0, + right: 20.0, + top: 18.0, + // bottom: 16.0, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + flex: 3, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Text( + widget.timer.timerName, + overflow: TextOverflow.ellipsis, + // Set overflow property here + style: Theme.of( + context, + ).textTheme.bodySmall!.copyWith( + fontWeight: FontWeight.w500, + color: kprimaryColor, + fontSize: 18), + ), + Spacer(), + Padding( + padding: + const EdgeInsets.only(right: 16.0), + child: InkWell( + onTap: () { + setState(() { + if (_timerCounter != null && + widget.timer.isPaused == 0) { + stopTimer(); + } + widget.timer.timeElapsed = 0; + IsarDb.updateTimerTick( + widget.timer); + if (_timerCounter != null && + widget.timer.isPaused == 0) { + widget.timer.startedOn = + DateTime.now().toString(); + IsarDb.updateTimerTick( + widget.timer) + .then( + (value) => startTimer()); + } + }); + }, + child: Container( + decoration: BoxDecoration( + color: themeController + .primaryBackgroundColor.value, + borderRadius: + BorderRadius.circular(20)), + child: const Padding( + padding: EdgeInsets.all(4.0), + child: Icon( + Icons.refresh, + size: 18, + ), + ), + ), + ), + ), + InkWell( onTap: () { - setState(() { - if (_timerCounter != null && - widget.timer.isPaused == 0) { - stopTimer(); - } - widget.timer.timeElapsed = 0; - IsarDb.updateTimerTick(widget.timer); - if (_timerCounter != null && - widget.timer.isPaused == 0) { - widget.timer.startedOn = - DateTime.now().toString(); - IsarDb.updateTimerTick(widget.timer) - .then((value) => startTimer()); - } - }); + controller + .stopRinger(widget.timer.timerId); + controller + .deleteTimer(widget.timer.timerId); }, child: Container( decoration: BoxDecoration( - color: themeController.primaryBackgroundColor.value, + color: themeController + .primaryBackgroundColor.value, borderRadius: BorderRadius.circular(20)), child: const Padding( padding: EdgeInsets.all(4.0), child: Icon( - Icons.refresh, + Icons.close, size: 18, ), ), ), - ), - ), - InkWell( - onTap: () { - controller - .stopRinger(widget.timer.timerId); - controller - .deleteTimer(widget.timer.timerId); - }, - child: Container( - decoration: BoxDecoration( - color: themeController.primaryBackgroundColor.value, - borderRadius: - BorderRadius.circular(20)), - child: const Padding( - padding: EdgeInsets.all(4.0), - child: Icon( - Icons.close, - size: 18, - ), - ), - ), - ) - ], - ), - Padding( - padding: - const EdgeInsets.symmetric(vertical: 20), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Obx( - () => AnimatedContainer( - duration: Duration(seconds: 1), - child: Text( - '${Utils.formatMilliseconds(widget.timer.timerValue - widget.timer.timeElapsed)}', - style: Theme.of( - context, - ).textTheme.displayLarge!.copyWith( - color: themeController.primaryTextColor.value, - fontSize: 44, - ), + ) + ], + ), + Padding( + padding: + const EdgeInsets.only(top:20), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Obx( + () => AnimatedContainer( + duration: Duration(seconds: 1), + child: Text( + '${Utils.formatMilliseconds(widget.timer.timerValue - widget.timer.timeElapsed)}', + style: Theme.of( + context, + ).textTheme.displayLarge!.copyWith( + color: themeController + .primaryTextColor.value, + fontSize: 40, + ), + ), ), ), - ), - Padding( - padding: EdgeInsets.all(20), - child: GestureDetector( - onTap: () { - setState(() { - widget.timer.isPaused == 0 - ? stopTimer() - : startTimer(); - widget.timer.isPaused = - widget.timer.isPaused == 0 - ? 1 - : 0; - IsarDb.updateTimerPauseStatus( - widget.timer); - }); - if (widget.timer.timeElapsed >= - widget.timer.timerValue) { - controller.stopRinger( - widget.timer.timerId); + Padding( + padding: EdgeInsets.all(16), + child: GestureDetector( + onTap: () { setState(() { - widget.timer.timeElapsed = 0; - IsarDb.updateTimerTick( - widget.timer) - .then((value) => IsarDb - .updateTimerPauseStatus( - widget.timer)); - widget.timer.isPaused = 1; + widget.timer.isPaused == 0 + ? stopTimer() + : startTimer(); + widget.timer.isPaused = + widget.timer.isPaused == 0 + ? 1 + : 0; + IsarDb.updateTimerPauseStatus( + widget.timer); }); - } - }, - child: Container( - decoration: BoxDecoration( - color: kprimaryColor, - borderRadius: - BorderRadius.circular(80)), - width: 80, - height: 80, - child: Icon( - widget.timer.isPaused == 0 - ? Icons.pause - : Icons.play_arrow, - size: 30, - color: ksecondaryBackgroundColor, + if (widget.timer.timeElapsed >= + widget.timer.timerValue) { + controller.stopRinger( + widget.timer.timerId); + setState(() { + widget.timer.timeElapsed = 0; + IsarDb.updateTimerTick( + widget.timer) + .then((value) => IsarDb + .updateTimerPauseStatus( + widget.timer)); + widget.timer.isPaused = 1; + }); + } + }, + child: Container( + decoration: BoxDecoration( + color: kprimaryColor, + borderRadius: + BorderRadius.circular( + 80)), + width: 75, + height: 75, + child: Icon( + widget.timer.isPaused == 0 + ? Icons.pause + : Icons.play_arrow, + size: 30, + color: + ksecondaryBackgroundColor, + ), ), - ), - )) - ], + )) + ], + ), ), - ), - ], + ], + ), ), - ), - ], + ], + ), ), - ), - ) - ], + ) + ], + ), ), ), ), diff --git a/lib/app/modules/timer/views/timer_view.dart b/lib/app/modules/timer/views/timer_view.dart index a65d4b12..14c36a81 100644 --- a/lib/app/modules/timer/views/timer_view.dart +++ b/lib/app/modules/timer/views/timer_view.dart @@ -1,7 +1,6 @@ import 'package:flutter/services.dart'; import 'package:get/get.dart'; import 'package:flutter/material.dart'; -import 'package:get_storage/get_storage.dart'; import 'package:numberpicker/numberpicker.dart'; import 'package:ultimate_alarm_clock/app/data/providers/isar_provider.dart'; import 'package:ultimate_alarm_clock/app/modules/addOrUpdateAlarm/controllers/input_time_controller.dart'; @@ -11,7 +10,6 @@ import 'package:ultimate_alarm_clock/app/modules/timer/views/timer_animation.dar import 'package:ultimate_alarm_clock/app/utils/constants.dart'; import 'package:ultimate_alarm_clock/app/utils/end_drawer.dart'; import 'package:ultimate_alarm_clock/app/utils/utils.dart'; -import 'dart:math' as math; import '../../../data/models/timer_model.dart'; @@ -473,7 +471,7 @@ class TimerView extends GetView { height: height * 0.008, ), SizedBox( - width: 80, + width: 70, child: TextField( onChanged: (_) { inputTimeController.setTimerTime(); @@ -539,7 +537,7 @@ class TimerView extends GetView { height: height * 0.008, ), SizedBox( - width: 80, + width: 70, child: TextField( onChanged: (_) { inputTimeController.setTimerTime(); @@ -605,7 +603,7 @@ class TimerView extends GetView { height: height * 0.008, ), SizedBox( - width: 80, + width: 70, child: TextField( onChanged: (_) { inputTimeController.setTimerTime();