conditional_wrap

Creator: coderz1093

Last updated:

0 purchases

conditional_wrap Image
conditional_wrap Images

Languages

Categories

Add to Cart

Description:

conditional wrap

Flutter Conditional Wrap 🌯 #



A widget that allows you to conditionally wrap a child subtree with a parent widget

Usage #
Conditional Wrapping #
WidgetWrapper(
wrapper: (child) => _condition
? ParentWidget(child: child)
: child,
child: ChildSubtree(),
),
copied to clipboard
Null Safe Wrapping #
WidgetWrapper(
wrapper: (child) {
final color = _color;
return color != null
? ColoredBox(
color: color,
child: child,
)
: child;
},
child: Text('hello, friend.'),
),
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.