super_time

Creator: coderz1093

Last updated:

0 purchases

super_time Image
super_time Images

Languages

Categories

Add to Cart

Description:

super time

Super Time Flutter Package #
Work fast and efficiently with time in Dart.
Installation #
Add this to your package's pubspec.yaml file:
dependencies:
super_time: <latest>
copied to clipboard
or
dart pub add super_time
copied to clipboard
Usage #
import 'package:super_time/super_time.dart';
copied to clipboard
Features #
Date Extensions #
st_toFr({bool withTime = false, bool withDay = true})
Converts the DateTime object to a French-formatted string.
DateTime.now().st_toFr(); // Output: "31 décembre 2023"
copied to clipboard
st_toEn({bool withTime = false, bool withDay = true})
Converts the DateTime object to an English-formatted string.
DateTime.now().st_toEn(); // Output: "December 31, 2023"
copied to clipboard
st_toFormat(String format)
Formats the DateTime object according to the provided format string.
DateTime.now().st_toFormat("dd/MM/yyyy"); // Output: "31/12/2023"
copied to clipboard
st_timeAgo()
Generates a human-readable time ago representation.
DateTime.now().subtract(Duration(minutes: 30)).st_timeAgo(); // Output: "30 minutes ago"
copied to clipboard
st_toTimestamp()
Converts the DateTime object to a timestamp string.
DateTime.now().st_toTimestamp(); // Output: "20231231120000"
copied to clipboard
st_toJson()
Converts the DateTime object to a JSON representation.
DateTime.now().st_toJson(); // Output: {"year": 2023, "month": 12, "day": 31, "hour": 12, "mi// nute": 0, "second": 0}
copied to clipboard
Overloaded Operators #
DateTime newDate = DateTime.now() + Duration(days: 7); // Adds 7 days to the current date
DateTime pastDate = DateTime.now() - 3.st_hours; // Subtracts 3 hours from the current date
copied to clipboard
Integer Extensions #
st_seconds, st_minutes, st_hours, st_days
Converts the integer to a Duration representing seconds, minutes, hours, or days, respectively.
int seconds = 120;
Duration duration = seconds.st_seconds; // Output: Duration(seconds: 120)
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.