s_extensions 0.0.4 copy "s_extensions: ^0.0.4" to clipboard
s_extensions: ^0.0.4 copied to clipboard

A dart package aiming to provide useful extensions and helper functions to ease and speed up development.

0.0.4 #

Added #

DateTimeExtensions #

  • operator + ads this duration of time to this date and returns the result.
  • operator - subtracts this duration of time from this date and returns the result.
  • fromNow returns the duration between this date and now.
  • isPast returns true if this date is in the past.
  • isFuture returns true if this date is in the future.
  • isInPreviousMonth returns true if this date is in the previous month.
  • isInNextMonth returns true if this date is in the next month.
  • isInNextYear returns true if this date is in the next year.
  • isInPreviousYear returns true if this date is in the previous year.
  • isToday returns true if this date is today.
  • isTomorrow returns true if this date is tomorrow.
  • isYesterday returns true if this date is yesterday.

0.0.3 #

Added #

StringExtensions #

  • reverse returns the reversed version of this string.
  • words returns a list of words in this string.
  • parseJson returns a parsed json [map] of this string.
  • isBlank returns true if this string is a blank by any chance.

MapExtensions #

  • toJson returns a parsed json [string] of this map.

ListExtensions #

  • toJson returns a parsed json [string] of this list.
  • operator + ads new [element] or [elements] to this list.
    [1, 2, 3] + 4; // [1, 2, 3, 4]
    [1, 2, 3] + [4, 5, 6]; // [1, 2, 3, 4, 5, 6]
    
  • toStack returns a stack widget with this list as children.
  • toColumn returns a column widget with this list as children.
  • toRow returns a row widget with this list as children.
  • random returns a random element from this list.

NumberExtensions #

  • isBetween returns true if this number is between the provided [min] and [max] values.
  • isDivisibleBy returns true if this number is divisible by the provided [divisor].
  • isEven returns true if this number is a even number.

BoolExtensions #

  • toggle returns false if this boolean is true, and true if this boolean is false.

Changes #

StringExtensions #

  • firstLetterUpperCase is deleted. Use capitalize instead.
  • toDate returns DateTime? to handle invalid formats.
  • toDouble returns double? to handle invalid formats.
  • toInt returns int? to handle invalid formats.

0.0.2 #

Added #

  • NumberExtensions: with format helper format.
  • DateTimeExtensions: with format helpers format, yyyyMMdd, yyyyMMddHHmm, yyyyMMddHHmmss, HHmm.

0.0.1 #

Added #

  • StringExtensions: toDate.
  • NumberExtensions: fixed00, fixed0.

0.0.0 #

Added #

  • NumExtensions with numeric helpers: half, quarter, square, sqRoot.
  • Duration helpers: misec, msec, sec, min, hr, day.
  • screenWidth extension getter for responsive layouts via property access (e.g., 0.9.screenWidth).
  • Static initialization and context management with FlutterExtensions to support property-based access without passing BuildContext.
  • Initialization verification (isInitialized), explicit init (init), and hot-reload-safe updates (update).
1
likes
0
points
482
downloads

Publisher

unverified uploader

Weekly Downloads

A dart package aiming to provide useful extensions and helper functions to ease and speed up development.

Repository (GitHub)
View/report issues

Topics

#productivity #tools #extensions

License

unknown (license)

Dependencies

flutter, intl

More

Packages that depend on s_extensions