From 1f02d24b363f59a35312bbf602e727bffff139a8 Mon Sep 17 00:00:00 2001 From: Mostafa Soliman Date: Thu, 16 May 2024 13:34:12 +0300 Subject: [PATCH] Chore: Updates dependencies (shared_preferences and package_info_plus) & cleanup utils.dart --- CHANGELOG.md | 9 +++++++-- lib/src/utils.dart | 10 +++++----- pubspec.yaml | 8 ++++---- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3755403..0710c36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 1.6.3 + +- Chore: Updates dependencies `shared_preferences` to `^2.2.3` and `package_info_plus` to `^8.0.0` + # 1.6.2 - Chore: Updates dependencies `package_info_plus` to `^6.0.0` @@ -9,8 +13,9 @@ # 1.6.0 -- Feat: Added [runOnEveryNewBuild](https://github.com/MostafaSolimanMO/once/pull/23) Function -- Fix: `runOnNewVersion` saves version numbers with non-numerical values and does not sanitize them upon retrieval [Issue #24](https://github.com/MostafaSolimanMO/once/issues/24) +- Feat: Added [runOnEveryNewBuild](https://github.com/MostafaSolimanMO/once/pull/23) Function +- Fix: `runOnNewVersion` saves version numbers with non-numerical values and does not sanitize them + upon retrieval [Issue #24](https://github.com/MostafaSolimanMO/once/issues/24) - Fix: Types Error in `runner.dart` - Chore: Update dependencies & example app diff --git a/lib/src/utils.dart b/lib/src/utils.dart index 5596ebc..38c21af 100644 --- a/lib/src/utils.dart +++ b/lib/src/utils.dart @@ -3,7 +3,7 @@ abstract class Utils { /// Return month days with accuracy in it, taking the current month and year /// considering the leap year - static int daysInMonth(final int monthNum, final int _year) { + static int daysInMonth(final int monthNum, final int year) { List monthLength = List.filled(12, 0); monthLength[0] = 31; monthLength[2] = 31; @@ -17,7 +17,7 @@ abstract class Utils { monthLength[10] = 30; monthLength[11] = 31; - if (_leapYear(_year) == true) { + if (_leapYear(year) == true) { monthLength[1] = 29; } else { monthLength[1] = 28; @@ -26,12 +26,12 @@ abstract class Utils { return monthLength[monthNum - 1]; } - static bool _leapYear(int _year) { + static bool _leapYear(int year) { bool leapYear = false; - bool leap = ((_year % 100 == 0) && (_year % 400 != 0)); + bool leap = ((year % 100 == 0) && (year % 400 != 0)); if (leap == true) { leapYear = false; - } else if (_year % 4 == 0) { + } else if (year % 4 == 0) { leapYear = true; } diff --git a/pubspec.yaml b/pubspec.yaml index 268da13..1564af3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: once description: Want to run a piece of code once periodically (Once - Daily - Weekly - Monthly - On new build - On new version - Any period)? We cover your back. -version: 1.6.2 +version: 1.6.3 repository: https://github.com/MostafaSolimanMO/once environment: @@ -9,11 +9,11 @@ environment: dependencies: flutter: sdk: flutter - shared_preferences: ^2.2.2 - package_info_plus: ^6.0.0 + shared_preferences: ^2.2.3 + package_info_plus: ^8.0.0 dev_dependencies: - flutter_lints: ^3.0.1 + flutter_lints: ^4.0.0 topics: - utils