YustHelpers class

Yust helpers

Constructors

YustHelpers()

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

addDaysOrMore(DateTime dateTime, {int days = 0, int months = 0, int years = 0}) DateTime
adds a Duration that is more that 24 hours this works with time shifts like daylight saving time
dateDifference(DateTime? first, DateTime? second) Duration
Use this function instead of DateTime.difference!
dateTimeIncludeTime(DateTime dateTime) bool
Returns true if the given dateTime includes a time.
formatDate(DateTime? dateTime, {String locale = 'de', String? format}) String
Return a string representing dateTime in the German or English date format or another given format.
formatTime(DateTime? dateTime, {String? format}) String
Return a string representing dateTime in the German time format or another given format.
localNow({int? year, int? month, int? day, int? hour, int? minute, int? second, int? millisecond, int? microsecond}) DateTime
localToUtc(DateTime dateTime) DateTime
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
preserveKeysInMap(Map<String, dynamic> object, List<String> keys) → void
Clean a map, except of some keys.
randomString({int length = 8}) String
Returns a random String with a specific length.
removeKeysFromMap(Map<String, dynamic> object, List<String> keys) → void
Remove multiple keys from a map.
roundToDecimalPlaces(num value, [int fractionalDigits = 8]) double
Rounds a number to the given amount of decimal places
searchString({required List<String> strings, required String searchString, bool ignoreCase = true, bool reorder = true}) List<int>
Returns a list of indexes of the found strings. The search looks for strings that contain the search searchString.
toQuotedFieldPath(String? fieldPath) String?
Returns a quoted field path.
toString() String
A string representation of this object.
inherited
tryLocalToUtc(DateTime? dateTime) DateTime?
tryUtcToLocal(DateTime? dateTime) DateTime?
utcNow({int? year, int? month, int? day, int? hour, int? minute, int? second, int? millisecond, int? microsecond}) DateTime
utcToLocal(DateTime dateTime) DateTime

Operators

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

Static Properties

mockNowUTC ↔ TZDateTime?
Mock the current time in UTC. Only use this in tests!!!
getter/setter pair