A collection of useful classes and extensions so obvious you'll wonder why they aren't offical
Install via flutter pub add:
dart pub add obviousAfter years of copy-n-pasting the same constructor param values and other tedious actions as Flutter developers, it was time to package these actions into sensible, almost obvious classes and extensions we can all benefit from.
The easiest example (and my favorite) is needing to set all but one argument for EdgeInsets.only to the same value.
That's when ObviousEdgeInsets.except() was born:
ObviousEdgeInsets.except(bottom: 8)
// is synonimous with:
EdgeInsets.only(left: 8, top: 8, right: 8)ObviousEdgeInsets.exceptObviousConditionalExpanded
insetAllinsetHorizontalinsetVerticalinsetLeftinsetTopinsetBottominsetRight
mssecondsminuteshoursdays
heightBoxwidthBox
screenHeightscreenWidthaspectRatioisMobilepaddingviewPaddingviewInsetsisTabletisDesktop
pushpushReplacementpushAndRemoveUntilpushNamedpushReplacementNamedpushNamedAndRemoveUntilpopmaybePoppopAndPushNamed
showNewDialogshowSnackbar
This project was heavily inspired by other libraries like:
- flutter_animate (num to Duration)
- super_extensions (BuildContext to Navigator)