DateTimes class

DateTimes class provide date and time picker functionality

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

calcValueByDateTime({required String fromDateTime, required String toDateTime, String format = Format.fyyyyMMddHHmmss}) TimeValue
calculate time value by from date to to date
datePicker({required BuildContext context, required dynamic onSelected(String date), String? date, String? minDate, String? maxDate, String format = Format.fyyyyMMdd}) → dynamic
pick date with customization
dateRangePicker({required BuildContext context, required dynamic onSelected(String fromDate, String toDate), String? fromDate, String? toDate, String? minDate, String? maxDate, String format = Format.fyyyyMMdd}) → dynamic
pick date range with customization
dateTimeToString({required DateTime date, String format = Format.fyyyyMMdd}) String
convert date (DateTime to String)
formatDateTime({required String dateTime, String inFormat = Format.fyyyyMMdd, String outFormat = Format.fyyyyMMdd}) String
format date and time (String)
getCurrentDate({String format = Format.fyyyyMMdd}) String
get current date with format
getCurrentDateTime({String format = Format.fyyyyMMddHHmmss}) String
get current datetime with format
getCurrentTime({String format = Format.fHHmmss}) String
get current time with format
getDateByPeriod({required String date, int days = 0, String format = Format.fyyyyMMdd}) String
date by period like add days or substract days
leadingZero(int value) String
set int value with leading zero
setValidDateTime({required String fromDateTime, required String toDateTime, String format = Format.fyyyyMMdd}) String
set valid date from valid date range
startAndEndDateOfMonth({String? date}) DateValue
start and end date of month by date
stringToDateTime({required String date, String format = Format.fyyyyMMdd}) DateTime
convert date (String to DateTime)
stringToTimeOfDay({required String? time}) TimeOfDay
convert time (String to TimeOfDay)
timeOfDayToString({required TimeOfDay time, bool hasSeconds = true, String format = Format.fHHmmss}) String
convert time (TimeOfDay to String)
timePicker({required BuildContext context, required dynamic onSelected(String time), String? time, String? minTime, String? maxTime, bool format24Hours = false, bool hasSeconds = false, TimePickerEntryMode timePickerEntryMode = TimePickerEntryMode.dial}) → dynamic
pick time with customization time HH:mm:ss
timer({required int seconds}) TimeValue
convert total second to time value seconds, minutes, hours, days
timeToValue({required String time}) TimeValue
convert time to value seconds, minutes, hours, days time HH:mm:ss
validDateTimeRange({required String fromDateTime, required String toDateTime, String format = Format.fyyyyMMdd, bool considerSameDateTime = true}) bool
check valid date range or not