WidgetbookState class
- Inheritance
-
- Object
- ChangeNotifier
- WidgetbookState
Constructors
-
WidgetbookState({String? path, String? query, bool previewMode = false, Map<
String, String> queryParams = const {}, AppBuilder appBuilder = widgetsAppBuilder, List<WidgetbookAddon> ? addons, List<WidgetbookIntegration> ? integrations, required WidgetbookRoot root})
Properties
-
addons
→ List<
WidgetbookAddon> ? -
final
- appBuilder → AppBuilder
-
final
-
directories
→ List<
WidgetbookNode> -
no setter
-
effectiveAddons
→ List<
WidgetbookAddon> ? -
Same as addons but without the ones that have no fields.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
-
integrations
→ List<
WidgetbookIntegration> ? -
final
- isNext → bool
-
Return
true
if SAM (Story-Arg-Mode) structure is used.no setter - knobs ↔ KnobsRegistry
-
latefinal
- path ↔ String?
-
getter/setter pair
- previewMode ↔ bool
-
getter/setter pair
- query ↔ String?
-
getter/setter pair
-
queryParams
↔ Map<
String, String> -
getter/setter pair
- root → WidgetbookRoot
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
story
→ Story<
Widget, StoryArgs< ?Widget> > -
Returns the current active Story.
no setter
- uri → Uri
-
A Uri representation of the current state.
no setter
- useCase → WidgetbookUseCase?
-
no setter
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
override
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateFromRouteConfig(
AppRouteConfig routeConfig) → void -
Update the current state using
AppRouteConfig
to update the path, previewMode and queryParams fields. Since these fields can be manipulated from the router's query parameters, as opposed to the rest of fields that stay unchanged during runtime. -
updateKnobValue<
T> (String label, T value) → void -
Updates Knob.value using the
label
to find the Knob. -
updatePath(
String newPath) → void - Update the path, causing a new useCase to bet returned. Resets the knobs during the update.
-
updateQuery(
String value) → void -
Updates the
q
query parameter with the givenvalue
. -
updateQueryField(
{required String group, required String field, required String value}) → void -
Update the field within the query
group
with the givenvalue
. -
updateQueryParam(
String name, String value) → void -
Update the
name
query parameter with the givenvalue
.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
of(
BuildContext context) → WidgetbookState -
Gets the current state using
context
.