div 0.0.2 copy "div: ^0.0.2" to clipboard
div: ^0.0.2 copied to clipboard

A div element for flutter

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'),
),

it has all container widget properties

Div(
  Text('Hello div'),
  color: Colors.red,
  padding: EdgeInsets.all(12),
  // and more ...
),

Row #

Div.row([
    Text('Hello div'),
    Text('Hello div'),
],),

Column #

Div.col([
    Text('Hello div'),
    Text('Hello div'),
],),

with Gesture detector #

Div(
    Text('Hello div'),
    onTap: () {
      print('tap');
    },
),

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');
        },
    ),
]),

Next? #

...

1
likes
120
pub points
48%
popularity

Publisher

verified publisherphysia.dev

A div element for flutter

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on div