In Flutter, you often see the pattern <Class>.of(context) (e.g., Theme.of(context)). This package adds extension getters on BuildContext for those classes so you can just say:
Note: This uses the name of routes, so it only works with named routes.
📱 Widgets
🔳 Buttons
Did you ever want to show a progress indicator inside a button? Or were annoyed to conditionally set a Button's onPressed to disable it? Fear no more — black_hole_flutter has got you covered!
This screenshot only shows an excerpt of all available button types and variants.
isEnabled: Settings this to false disables this button, even if onPressed is set.
🥙 FillOrWrap
A layout with two different behaviors:
By default, all children are positioned next to each other with equal widths. This is comparable to a Row with all children wrapped in Expanded.
If the children are too wide to fit in a single line, or one child would become smaller than its reported minimum width, the children get positioned below each other ("wrapped"). This is similar to a Column with MainAxisSize.min.
🎯 LeftCenterRight
A layout taking optional left, center, and right children.
It will try to keep center in the center of itself, even if only one of left and right is set, or they have different widths.
🟢 Circle
A circle with optional diameter, background color, padding, and child.