feat: Custom global properties
Last active 1 months ago
4 replies
7 views
- AL
Description
Currently, a set of pre-defined properties is available :It would be awesome to add the possibility to create additional properties.
In addition to theme brightness, my app has different variants: sound enabled/disabled, haptic feedback mode, visual animation enabled/disabled…
Proposal
Something like the knobs would be perfect:
return Widgetbook(
appInfo: AppInfo(
name: 'Clickup | Flutter UI',
),
appBuilder: (context, child) => AppSoundEnabled(
enabled: context.properties.boolean(label: 'Sound'),
child: child,
),
/// …
); - JE
Hey Aloïs, thanks for opening this feature request. Since we've been unhappy about the whole property implementation, we are currently working on a fully customizable properties panel.
We will likely provide so-called Add-ons that allow for theming, text scales, locales, etc.
For instance, themes will be accessible via context.materialTheme or context.theme() (for custom themes e.g. the theme used in your Asgard shop app).
Since we are already in the middle of implementing this feature, you can expect a release soon 🎉 - AL
That's awesome! Thank you
- JE
Sorry that this took way longer than expected. We completely refactored our architecture to support
AddOn
s. This enables developers to inject their own global properties into Widgetbook. The implementation is almost done we just have to refine the API a bit to make it easier to use.Looking forward to ship this feature soon!
Last active 1 months ago
4 replies
7 views