Welcome to FLUF, the package that provides convenience functions to develop your Flutter app. FLUF means Flutter Leveraging User Functions.
These widgets extend from BaseAnimatedWidget which holds a Flutter AnimationController.
FlingWidgetRevealWidget
isReady(): shortcut for snapshot's connection state ==doneand snapshot has dataisLoading(): shortcut for snapshot's connection state ==waitingisComplete():
areMaxConstraintsValid: maximum dimensions are finiteareMinConstraintsValid: minimum dimensions are finite
isDark
breakpoint: current screen widthBreakpointbrightness: platform brightness settingcolorScheme: shortcut forTheme.of(context).colorSchemedesiredBrightness: desired user-defined brightness through [BuildContextOverride.themeMode]devicePixelRatio: number of device pixels for each logical pixelfadeTo(Widget): push and replace current widget with givenWidgetwith fade animationgetHorizontalPadding(bodyWidthRatio): horizontal padding with desired body width ratio of screen widthgetHorizontalPaddingEdgeInsets(context): get recommended horizontal padding depeneding on current breakpointlocale: shortcut forLocalizations.localeOf(this)mediaQuerySize: sizenavigator: shortcut forNavigator.of(BuildContext)orientation: orientationpop(): shortcut forNavigator.of(BuildContext).pop()renderRepaintBoundary: return this context's [RenderObject] as [RenderRepaintBoundary?]revealFrom(Widget, Duration, Alignment): reveal (scale and translate)WidgetfromAlignmentcornershowSnackBar(Widget, bool? floating): show a SnackBar using context`s ScaffoldMessengerslideTo(Widget, Duration, Axis): pushWidgetwith slide animationtextTheme: shortcut forTheme.of(context).textThemetheme: shortcut forTheme.of(context)
minusDelta(int): color with subtracteddeltain each of RGB valuesplusDelta(int): color with addeddeltain each of RGB valuesasPressableProperty():WidgetStatePropertywith reduced opacity for pressed statedeltaWithBrightnessOf(BuildContext context, int delta, bool? inverse): apply delta depending on platform brightness setting
isDayMonthToday: if this date's day and month match today's onesdayOfYear
hms(): format as HH:MM:SS String
seconds: equivalentDurationobject from seconds value
center: global center position asOffset?of this key'sWidget
milliseconds: equivalentDurationobject from milliseconds valuems: shortcut formillisecondsseconds: equivalentDurationobject from seconds valueisLeapYeardaysInYear: number of days in year, depending on leap years
-
getMainDiagonalIntersections(): indexes list of diagonals intersecting the main diagonal, if the list can be represented as a 2 dimensional array, returnsnullotherwise. E.g:[0, 1, 2, 3].getMainDiagonalIntersections()returns[[0], [1,2], [3]]. -
getHorizontalIntersections(): indexes list of horizontal intersections of the 2 dimensional array. -
containsValue: perform value-based comparison to look for an item in a list, instead of reference-based. -
findClosestIndex(double value): returns index of closest item tovalue, or-1if no item can't be found -
findContainingIndexes(double target): finds indexes of items wherevaluelies in between -
randomElement(): returns a random element within this list
inMinutes: in minutestoUTC(offset): in UTC timetoLocal(offset): in local time
let(R Function(T)): invoke lambda passing receiver object and return lambda's resultalso(void Function(T)): invoke lambda passing receiver object, and return this objectasWidgetStateProperty(Map<WidgetState, T>): map object asWidgetStatePropertylogType(String): log a message usingdart:developer'slogwithnameattribute set to object'sruntimeTypetryCast<T>: attempt cast to type, returnsnullon failure
toParagraph(): map todart:uiParagraphasync color(): compute average color (for emojis)sizeOfStyle(TextStyle?): compute size spanned by this string with given stylecaptialize: make first character upper casecaptitalizeAll: make first character of all space-separated items uppercasetoUri: parse this [String] as [Uri]splitUpperCase([String delimiter = " "]): split string at uppercase characters with optional delimiter. E.g: "camelCase" -> "camel Case"toClipboardData(): create aClipboardDataobject withthisas textcopyToClipboard(): copy this string into the clipboard as clipboard data
bold(): copy of this TextStlye with bold font weightitalic(): copy of this TextStlye with italic font styleunderline(): copy of this TextStlye with underline decorationtoUiTextStyle(): convert a Theme's text style to a Dartuipackage'sTextStyle
progress: current progress from 0.0 to 1.0.
atomicPage: current page index as non-nullable integer
toFile(directoryPath, filename, format): save this widget as image file
isRoot: if the current route name denotes to '/'isNamed(String): if the route setting's name matches given value
addSemantics(label, hint, value): wrap widget into a Semantics widgettoHero(Object? tag): wrap intoHero. Do nothing and return this if tag is null.toMaterialHero(Object? tag): wrap into a transparentMaterialwidget, and intoHero. This extension is useful forTextwidgets with different styles, or scenarri where the Hero transition underlines the animated widget with yellow lines, indicating that the source and target widgets differ. Do nothing and return this if tag is null.
RayPainterWaterfallPainter: Emoji grid painter with waterfall animation
- enum defining Material 3 screen width breakpoints
- Container for
Future-s with ability to await/dispose them all on demand
buildLoadingStatebuildInfoStatebuildCenterChild(Breakpoint, Widget)
loadJsonListreadFilereadFileAsBytes
now: now asDateTimeaccording to local timezonenowDate: same asnowwith all time-related fields set to 0nowUtc: now as UTCDateTimeepochMs: elapsed milliseconds since Unix epochutcOffset: UTC offset in minutes
nextInt(length)
lightTheme(): Material 3 light theme datadarkTheme(): Material 3 dark theme data
colorOfEmoji(String): compute tint color of given String emoji
- Set a value (origin 1.0) back and forth from
press()torelease()mixin calls. E.g : Create a widget that animates when it is pressed, and animates back once released.
- Use in combination with Isolates to conveniently wait for a return value
lightHapticFeedback()mediumHapticFeedback()heavyHapticFeedback()selectionHapticFeedback()vibrateFeedback()
Shimmer: manages a shimmering shine onto multipleShimmerLoadingWidgetShimmerLoadingWidget: a wrapper for a single widget with a shimmering loading state