s_extensions 0.0.4
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.fromNowreturns the duration between this date and now.isPastreturnstrueif this date is in the past.isFuturereturnstrueif this date is in the future.isInPreviousMonthreturnstrueif this date is in the previous month.isInNextMonthreturnstrueif this date is in the next month.isInNextYearreturnstrueif this date is in the next year.isInPreviousYearreturnstrueif this date is in the previous year.isTodayreturnstrueif this date is today.isTomorrowreturnstrueif this date is tomorrow.isYesterdayreturnstrueif this date is yesterday.
0.0.3 #
Added #
StringExtensions #
reversereturns the reversed version of this string.wordsreturns a list of words in this string.parseJsonreturns a parsed json [map] of this string.isBlankreturnstrueif this string is a blank by any chance.
MapExtensions #
toJsonreturns a parsed json [string] of this map.
ListExtensions #
toJsonreturns 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]toStackreturns a stack widget with this list as children.toColumnreturns a column widget with this list as children.toRowreturns a row widget with this list as children.randomreturns a random element from this list.
NumberExtensions #
isBetweenreturnstrueif this number is between the provided [min] and [max] values.isDivisibleByreturnstrueif this number is divisible by the provided [divisor].isEvenreturnstrueif this number is a even number.
BoolExtensions #
togglereturnsfalseif this boolean istrue, andtrueif this boolean isfalse.
Changes #
StringExtensions #
firstLetterUpperCaseis deleted. Usecapitalizeinstead.toDatereturnsDateTime?to handle invalid formats.toDoublereturnsdouble?to handle invalid formats.toIntreturnsint?to handle invalid formats.
0.0.2 #
Added #
NumberExtensions: with format helperformat.DateTimeExtensions: with format helpersformat,yyyyMMdd,yyyyMMddHHmm,yyyyMMddHHmmss,HHmm.
0.0.0 #
Added #
NumExtensionswith numeric helpers:half,quarter,square,sqRoot.- Duration helpers:
misec,msec,sec,min,hr,day. screenWidthextension getter for responsive layouts via property access (e.g.,0.9.screenWidth).- Static initialization and context management with
FlutterExtensionsto support property-based access without passingBuildContext. - Initialization verification (
isInitialized), explicit init (init), and hot-reload-safe updates (update).