flutter_custom_utils 0.0.8 flutter_custom_utils: ^0.0.8 copied to clipboard
this package is for utility support and code simplification for personal and commercial use
-
get MediaQuery size
getSize(context)
Use
both 1 and 2
for aresponsive gridview
-
For responsive
grid item count
based on your static designwidth
.crossAxisCount: getResCrosCountGrid( context: context, width: 180, ),
-
For responsive grid item
aspect ratio
based on your static designheight
andwidth
.childAspectRatio: getResGridRatio( context: context, height: 165, width: 180, ),
-
For normal grid
aspect ratio
this will provide you aspect ratio whitch never barake in biger or smaller devise
crossAxisCount: 2, childAspectRatio: getGridRatio( crossAxisCount: 2, context: context, height: 165, width: 180, ),
Provide same
height
orwidth
in both methods
-
Get color from hash code
CHColor.fromHex('#fffff')
-
Get hash code from color
Color.fromRGBO(250, 250, 250, 0.1).toHex()
-
All
(padding/margin)
@override Widget build(BuildContext context) { return Container( child: Text('data').cPadAll(10) // cMargAll ); }
-
Only
(padding/margin)
@override Widget build(BuildContext context) { return Container( child: Text('data').cPadOnly( l: 10, r: 10, t: 10, b: 10, ), // cMargOnly ); }
-
Symmetric
(padding/margin)
@override Widget build(BuildContext context) { return Container( child: Text('data').cPadSymmetric( h: 10, v: 10, ), // cMargSymmetric ); }
-
Zero
(padding/margin)
@override Widget build(BuildContext context) { return Container( child: Text('data').cPadZero, // cMargZero ); }
-
Allows you to insert widgets inside a
CustomScrollView
Text('data').cSliverToBox
-
Allows you to handle
Visibility
andOpacity
Text('data').cVisible(true) Text('data').cOpacity(0.3)