flutter_widget_extension 0.0.1 copy "flutter_widget_extension: ^0.0.1" to clipboard
flutter_widget_extension: ^0.0.1 copied to clipboard

A Flutter package for chain build widget, decrease widget nested hell.

FlutterWidgetExtension #

🔵 Internationalization #

English | 中文文档

ℹ️ Introductions #

A Flutter package for chain build widget, decrease widget nested hell. Only pick the frequently used function. Some method may introduce unnecessary container. Please refre the souce code.

Example Before:

  Widget widget() {
    return Padding(
        padding: EdgeInsets.all(20.0),
        child: Center(
            child: Stack(
          alignment: AlignmentDirectional.topEnd,
          children: [
            GestureDetector(
              onTap: () => debugPrint("Widget2 is clicked"),
              child: Container(
                decoration: BoxDecoration(
                  borderRadius: BorderRadius.circular(20.0),
                  color: Colors.purple,
                ),
                child: Container(
                  margin: EdgeInsets.all(4.0),
                  child: ClipRRect(
                    borderRadius: BorderRadius.circular(20.0),
                    child: Image.network(
                        "https://c-ssl.duitang.com/uploads/item/201609/20/20160920124307_mcZHQ.thumb.1000_0.jpeg"),
                  ),
                ),
              ),
            ),
            IconButton(
                onPressed: () => debugPrint("Icon is clicked"),
                icon: const Icon(
                  Icons.highlight_remove,
                  color: Colors.pink,
                )),
          ],
        )));
  }

After:

  Widget widget() {
    return Image.network("https://c-ssl.duitang.com/uploads/item/201609/20/20160920124307_mcZHQ.thumb.1000_0.jpeg")
        .round(20.0)
        .margin(const EdgeInsets.all(4.0))
        .backgroundColor(Colors.purple)
        .round(20.0)
        .onTap(() => debugPrint("Widget2 is clicked"))
        .badge(IconButton(
            onPressed: () => debugPrint("Icon is clicked"),
            icon: const Icon(
              Icons.highlight_remove,
              color: Colors.pink,
            )))
        .center()
        .padding(const EdgeInsets.all(20.0));
  }

😜 Authors #

mamz

License MIT

4
likes
140
points
30
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Flutter package for chain build widget, decrease widget nested hell.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flutter_widget_extension