Skip to content

Commit

Permalink
Chore: Updates dependencies (shared_preferences and package_info_plus…
Browse files Browse the repository at this point in the history
…) & cleanup utils.dart
  • Loading branch information
MostafaSolimanMO committed May 16, 2024
1 parent e94e22c commit 1f02d24
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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`
Expand All @@ -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

Expand Down
10 changes: 5 additions & 5 deletions lib/src/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<int> monthLength = List.filled(12, 0);
monthLength[0] = 31;
monthLength[2] = 31;
Expand All @@ -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;
Expand All @@ -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;
}

Expand Down
8 changes: 4 additions & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand Down

0 comments on commit 1f02d24

Please sign in to comment.