Skip to content

Commit

Permalink
deprecate Dynamic method
Browse files Browse the repository at this point in the history
  • Loading branch information
Allan Ramos committed May 21, 2024
1 parent ca657ee commit f1145b9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,8 @@

- Adds support for custom text
customText / Changing text on return is able now by using .toCustomTimeElapsed() or .toCustomWDHMS() methods

## [0.3.0] - 2024-05-21.

- Adds support for dart 3.4.0
changes method
11 changes: 11 additions & 0 deletions lib/time_elapsed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,17 @@ class TimeElapsed {
return fromDateStr(date);
}
}

@deprecated

/// User should use [elapsedTime] instead of [elapsedTimeDynamic]
static String elapsedTimeDynamic(dynamic date) {
if (date!.runtimeType == DateTime) {
return fromDateTime(date);
} else {
return fromDateStr(date);
}
}
}

extension ReturningCustomTimeElapsedString on String {
Expand Down

0 comments on commit f1145b9

Please sign in to comment.