From 2c5fca29dd7a78bc4f780280e7ba090d960f576f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Pi=C3=B1eiro?= <92994759+NitroXen@users.noreply.github.com> Date: Sat, 31 Aug 2024 16:23:47 +0200 Subject: [PATCH 1/4] NitroXen fix dispose timer --- lib/app/age_calculate/age_calculator.dart | 2 +- lib/app/countdown_timer/countdown_timer.dart | 11 +++++++++-- lib/app/cube_timer/cube_timer.dart | 11 +++++++++-- lib/screen/home/screen/home_page.dart | 2 +- pubspec.lock | 4 ++-- pubspec.yaml | 2 +- 6 files changed, 23 insertions(+), 9 deletions(-) diff --git a/lib/app/age_calculate/age_calculator.dart b/lib/app/age_calculate/age_calculator.dart index 0338fdb..269e9d2 100644 --- a/lib/app/age_calculate/age_calculator.dart +++ b/lib/app/age_calculate/age_calculator.dart @@ -101,7 +101,7 @@ class _AgeCalculatorState extends State { child: Center( child: Text( _selectedDate == null - ? "0 years ||0 months||0 days" + ? "0 years 0 months 0 days" : _calculatedAge, style: const TextStyle( fontSize: 22, diff --git a/lib/app/countdown_timer/countdown_timer.dart b/lib/app/countdown_timer/countdown_timer.dart index f57705e..8d453fa 100644 --- a/lib/app/countdown_timer/countdown_timer.dart +++ b/lib/app/countdown_timer/countdown_timer.dart @@ -52,10 +52,10 @@ class _CountdownTimerState extends State { _isRunning = true; }); - _timer = Timer.periodic(const Duration(milliseconds: 10), (timer) { + _timer = Timer.periodic(const Duration(milliseconds: 100), (timer) { if (_milliseconds > 0) { setState(() { - _milliseconds -= 10; + _milliseconds -= 100; }); _saveTimerState(); } else { @@ -83,6 +83,13 @@ class _CountdownTimerState extends State { _saveTimerState(); } + @override + void dispose() { + _resetTimer(); + + super.dispose(); + } + String _formatTime(int milliseconds) { final hours = (milliseconds ~/ 3600000).toString().padLeft(2, '0'); final minutes = ((milliseconds ~/ 60000) % 60).toString().padLeft(2, '0'); diff --git a/lib/app/cube_timer/cube_timer.dart b/lib/app/cube_timer/cube_timer.dart index c7b7cc4..bc9a98d 100644 --- a/lib/app/cube_timer/cube_timer.dart +++ b/lib/app/cube_timer/cube_timer.dart @@ -29,9 +29,9 @@ class _TimerStateApp extends State { _isRunning = true; }); - _timer = Timer.periodic(const Duration(milliseconds: 10), (timer) { + _timer = Timer.periodic(const Duration(milliseconds: 100), (timer) { setState(() { - _milliseconds += 10; + _milliseconds += 100; }); _saveTimerState(); }); @@ -55,6 +55,13 @@ class _TimerStateApp extends State { }); } + @override + void dispose() { + _resetTimer(); + + super.dispose(); + } + String _formatTime(int milliseconds) { final minutes = (milliseconds ~/ 60000).toString().padLeft(2, '0'); final seconds = ((milliseconds ~/ 1000) % 60).toString().padLeft(2, '0'); diff --git a/lib/screen/home/screen/home_page.dart b/lib/screen/home/screen/home_page.dart index 8aba4ff..69e3904 100644 --- a/lib/screen/home/screen/home_page.dart +++ b/lib/screen/home/screen/home_page.dart @@ -145,7 +145,7 @@ class _HomePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox(height: 15), - HomePageText(text: 'Calculetor'), + HomePageText(text: 'Calculator'), SizedBox(height: 10), ], ), diff --git a/pubspec.lock b/pubspec.lock index dbb0a2f..880ae93 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -769,10 +769,10 @@ packages: dependency: transitive description: name: uuid - sha256: "83d37c7ad7aaf9aa8e275490669535c8080377cfa7a7004c24dfac53afffaa90" + sha256: f33d6bb662f0e4f79dcd7ada2e6170f3b3a2530c28fc41f49a411ddedd576a77 url: "https://pub.dev" source: hosted - version: "4.4.2" + version: "4.5.0" vector_math: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 24bbda9..8db6938 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -46,4 +46,4 @@ flutter: assets: - assets/app_icon.png - - .env + - assets/.env From ebe499990388cd8c59365d0f450e3c1b6c6a56bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Pi=C3=B1eiro?= <92994759+NitroXen@users.noreply.github.com> Date: Sat, 31 Aug 2024 16:26:30 +0200 Subject: [PATCH 2/4] NitroXen mod ageCalculator --- lib/app/age_calculate/age_calculator.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/app/age_calculate/age_calculator.dart b/lib/app/age_calculate/age_calculator.dart index 269e9d2..1f12a2c 100644 --- a/lib/app/age_calculate/age_calculator.dart +++ b/lib/app/age_calculate/age_calculator.dart @@ -49,7 +49,7 @@ class _AgeCalculatorState extends State { } setState(() { - _calculatedAge = "$years years ||$months months||$days days"; + _calculatedAge = "$years years $months months $days days"; }); } From cd7cc484b23eeb009de6e7054740dbeb0d9c70ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Pi=C3=B1eiro?= <92994759+NitroXen@users.noreply.github.com> Date: Mon, 2 Sep 2024 08:23:39 +0200 Subject: [PATCH 3/4] NitroXen 2/9/2024 --- lib/app/cube_timer/cube_timer.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/app/cube_timer/cube_timer.dart b/lib/app/cube_timer/cube_timer.dart index bc9a98d..5321931 100644 --- a/lib/app/cube_timer/cube_timer.dart +++ b/lib/app/cube_timer/cube_timer.dart @@ -58,7 +58,6 @@ class _TimerStateApp extends State { @override void dispose() { _resetTimer(); - super.dispose(); } From 44aed9f8b03b8f1907e664ba3308f683f4caa9b4 Mon Sep 17 00:00:00 2001 From: Md Apon Ahmed Date: Sat, 7 Sep 2024 12:38:50 +0600 Subject: [PATCH 4/4] Update pubspec.yaml --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 8db6938..24bbda9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -46,4 +46,4 @@ flutter: assets: - assets/app_icon.png - - assets/.env + - .env