DeviceBuilder class
DeviceBuilder builds Device size driven layout for its children
Constructors
- DeviceBuilder({WidgetWrapper? wrap, Color? bgColor})
- Create scenarios rendered on multiple device sizes in a widget to take a golden snapshot of. Renders devices horizontally and scenarios vertically.
Properties
- bgColor → Color?
-
background bgColor color of output .png file
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- requiredWidgetSize → Size
-
outputs calculated required size to render all Scenarios and their corresponding Devices
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
scenarios
→ List<
DeviceScenario> -
list of created DeviceScenarios for each device type
final
- wrap → WidgetWrapper?
-
Can be used to wrap all scenario widgets. Useful if you wish to
provide consistent UI treatment to all of them or need to inject dependencies.
final
Methods
-
addScenario(
{required Widget widget, String? name, OnScenarioCreate? onCreate}) → void -
addScenario will add a DeviceScenario for each device listed
under
_devicesForScenarios
-
build(
) → Widget -
build will build a list of
_scenarios
with a given layout -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
overrideDevicesForAllScenarios(
{required List< Device> devices}) → void -
Overrides the list of devices that are rendered for each scenario
Otherwise will default to using
GoldenToolkit.configuration.defaultDevices
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited