applier_deviate static method
Implementation
static Applier<WidgetBuilder> applier_deviate(Alignment alignment) {
final x = alignment.x;
final y = alignment.y;
Row rowOf(List<Widget> children) => Row(
mainAxisAlignment: MainAxisAlignment.center,
children: children,
);
final rowBuilder = switch (x) {
0 => (child) => rowOf([child]),
1 => (child) => rowOf([child, WSizedBox.expand]),
-1 => (child) => rowOf([WSizedBox.expand, child]),
_ => throw UnimplementedError(),
};
Column columnOf(List<Widget> children) => Column(
mainAxisAlignment: MainAxisAlignment.center,
children: children,
);
final columnBuilder = switch (y) {
0 => (child) => columnOf([child]),
1 => (child) => columnOf([rowBuilder(child), WSizedBox.expand]),
-1 => (child) => columnOf([WSizedBox.expand, rowBuilder(child)]),
_ => throw UnimplementedError(),
};
return (child) => (context) => columnBuilder(child);
}