UI Module
Widget
The widget component represents a reusable fraction of the UI. It can have an associated theme that allows easy styling and a scalable design system. The themes are realized using ThemeExtensions
via theme_tailor.
// button.dart
class MyAppButton extends StatelessWidget {
const MyAppButton({
super.key,
this.theme,
});
final MyAppButtonTheme? theme;
@override
Widget build(BuildContext context) {
final theme = this.theme ?? context.myAppButtonTheme;
final backgroundColor = theme.backgroundColor;
// implement the button
}
}
// button_theme.dart (optional)
@Tailor(themeGetter: ThemeGetter.onBuildContext)
class _$MyAppButtonTheme {
static List<Color> backgroundColor = [
const Color(0xFFFFFFFF),
const Color(0xFF000000),
];
}
More information about testing the UI Package can be found here.
Components
See UI Package.
More information about testing a Platform UI Package can be found here.