flutter_custom_utils 0.1.7
flutter_custom_utils: ^0.1.7 copied to clipboard
It is designed to simplify code and support utilities for personal and commercial use
-
For duration and delay
void splash() { 2.cSeconds.cDelay(() { // code here }); }
-
Get the MediaQuery
context.cSize // getSize(context) context.cWidth context.cHeight context.cTheme context.cIsDarkMode context.cIconColor context.cTextTheme context.cOrient // orientation context.cIsLand // landscape context.cIsPort // portrait context.cDevicePixelRatio
Make a
responsive gridviewby using both1 and 2
-
Based on your static design's
width, calculate the responsivegrid item count.crossAxisCount: getResCrosCountGrid( context: context, width: 180, ), -
For responsive grid item
aspect ratio, it should be derived from your static design based onheightandwidth.childAspectRatio: getResGridRatio( context: context, height: 165, width: 180, ), -
For normal grid
aspect ratioHaving this aspect ratio will never break in larger or smaller devices
crossAxisCount: 2, childAspectRatio: getGridRatio( crossAxisCount: 2, context: context, height: 165, width: 180, ),
Your provided
heightandwidthdetermine how it works
-
Get color from hash code
CHColor.fromHex('#fffff') -
Get hash code from color
Color.fromRGBO(250, 250, 250, 0.1).toHex()
-
Allows you to handle
(padding/margin)Text('data').cPadZero // cMargZero Text('data').cPadAll(10) // cMargAll Text('data').cPadOnly(l: 10, r: 10, t: 10, b: 10,) // cMargOnly Text('data').cPadSymmetric(h: 10, v: 10,), // cMargSymmetric -
Allows you to handle
ClipRRectContainer().cClipAll(10) Container().cClipHorizontal(l:10, r:10,) Container().cClipVertical(t:10, b:10,) Container().cClipOnly(tl: 10, tr: 10, bl: 10, br: 10,) -
Allows you to insert widgets inside a
CustomScrollViewText('data').cToSliver -
Allows you to handle
VisibilityandOpacityText('data').cVisible(true) Text('data').cOpacity(0.3) -
Allows you to handle Alignment
Text('data').cAlignment(Alignment.topCenter) Text('data').cToCenter Text('data').cExpand(2) -
For PreferredSize
Text('data').cPreferSize(20)