0 purchases
div
Div widget #
This widget is just a wrapper for the container Widget with an gesture detector and row, col (column) constructors.
it also use the first argument as a child or children
Usage #
basic usage: #
Div(
Text('Hello div'),
),
copied to clipboard
it has all container widget properties
Div(
Text('Hello div'),
color: Colors.red,
padding: EdgeInsets.all(12),
// and more ...
),
copied to clipboard
Row #
Div.row([
Text('Hello div'),
Text('Hello div'),
],),
copied to clipboard
Column #
Div.col([
Text('Hello div'),
Text('Hello div'),
],),
copied to clipboard
with Gesture detector #
Div(
Text('Hello div'),
onTap: () {
print('tap');
},
),
copied to clipboard
Why? #
to me think using first argument as a child or children can minimize the code and make it more readable, because when ur tree go to be more complex, it will be hard to read.
Example:
Div.col([
Text('Hello 0'),
Div(
Text('Hello 1'),
color: Colors.teal
),
Div.row([
Text('Text'),
]),
Div(
Text('Hello with onTap'),
onTap: () {
print('tap');
},
),
]),
copied to clipboard
Next? #
...
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.