Changes

  • fixed issue with MediaQuery
  • added implementation of Addon API which allows for #363
  • removed all builder functions except appBuilder
  • removed themes property from Widgetbook Widget
    • Addon is replacing this functionality
  • removed textScaleFactors property from Widgetbook Widget
    • Addon is replacing this functionality
  • removed name property from Widgetbook Widget

Background

To support features such as #363, the Widgetbook API needed to be refactored to allow for the generic implementation of the properties. The Addon implementation now allows developers to fully customize which properties are available. In addition, the builder functions have been refactored as these have been hard to understand. All builder functions have been combined with the appBuilder function. The selected properties from the Addons are now accessed via the single BuildContext parameter which further simplifies the usage of the builder function. Furthermore, the refactoring of the API allowed us to fix the existing MediaQuery issues.

Feedback

Please let us know via Discord or on GitHub how we can further improve this migration guide.

Migration Plan

The migration plan features documentation for using widgetbook_generator and the manual approach.

Removed AppInfo

The AppInfo model that was used to display the name of the Widgetbook in the upper right corner has been removed

The existing app:

@WidgetbookApp.material(
  name: 'Widgetbook Name',
  ...
)
class App extends StatelessWidget { ... }

After migration:

@WidgetbookApp.material(
  ...
)
class App extends StatelessWidget { ... }

Removed themes property from WidgetbookApp

No migration necessary.

Removed frames property from WidgetbookApp

No migration necessary.

Removed supportedLocales and localizationsDelegates properties from WidgetbookApp

No migration necessary.

Changes on how Widgets are cataloged

No migration necessary.

Removed builder functions

All builder functions have been combined into the appBuilder function. For more information read the documentation regarding the function.