s_extensions 0.0.7
s_extensions: ^0.0.7 copied to clipboard
A dart package aiming to provide useful extensions and helper functions to ease and speed up development.
0.0.7 #
Added #
StringExtensions #
removeNumbersremoves all the numbers from theString.removeWhiteSpaceremoves all the white spaces from theString.
WidgetExtensions #
marginAllreturns a new widget with the given margin.marginSymmetricreturns a new widget with the given margin.marginOnlyreturns a new widget with the given margin.paddingAllreturns a new widget with the given padding.paddingSymmetricreturns a new widget with the given padding.paddingOnlyreturns a new widget with the given padding.expandedreturns a new expanded widget with the given flex.flexiblereturns a new flexible widget with the given flex.alignreturns a new aligned widget with the given alignment.centerreturns a new centered widget.directionalityreturns a new directed text widget with the given text direction.roundedreturns a new rounded widget with the given radius.roundedTopreturns a new rounded widget from top with the given radius.roundedBottomreturns a new rounded widget from bottom with the given radius.decorationreturns a new decorated widget with the given decoration.refreshablereturns a new refresh indicator widget.scrollablereturns a new scrollable widget with the given scroll physics.constrainedreturns a new constrained widget with the given width and height.widthreturns a new constrained widget with the given width.heightreturns a new constrained widget with the given height.gesturesreturns a new [GestureDetector] widget with the given gestures.
0.0.6 #
Added #
StringExtensions #
isPalindromereturnstrueif this string is a palindrome.truncatetruncates theStringwhen more thanlengthcharacters exist.
ContextExtensions #
isKeyboardVisiblereturnstrueif the keyboard is visible.keyboardHeightreturns the height of the keyboard.isLandscapereturnstrueif the device orientation is landscape.isPortraitreturnstrueif the device orientation is portrait.
0.0.5 #
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).