FlutterDurationExtensions extension
- on
Methods
-
formatWith(
BuildContext context, {int maxParts = 2, int secondsToShowNow = 0}) → String -
Localize duration using TranslatedDurationFormatter formatter
You have to add
TranslatedDurationFormatter.delegate
in yourlocalizationsDelegates
-
toTimeOfDay(
) → TimeOfDay - convert the duration to TimeOfDay if duration is greater than 24 hours it will throw an exception