flutter_compose_ui_modifiers 0.3.4
flutter_compose_ui_modifiers: ^0.3.4 copied to clipboard
Flutter UI Modifiers is a collection of declarative widget modifiers to make your Flutter code shorter and linear.
example/README.md
FlutterUI Modifiers - Example #
When writing an app in Flutter, your widget hierarchy might look something like this:
List<Widget> list = [];
list.add(
Center(
child: Padding(
padding: EdgeInsets.all(16.0),
child: Text(
'Hello, World! π',
style: TextStyle(
color: Colors.red,
fontSize: 22,
), // TextStyle
), // Text
) // Padding
), // Center
);
With the flutter_compose_ui_modifiers
package installed you could transform the above code to a modifier-style equivalent which might look something like this:
List<Widget> list = [];
Text('Hello, World! π')
.font(size: 22)
.color(Colors.red)
.padding(all: 16)
.centered()
.assign(list);
More examples like this can be found in the in-code documentation.