feat(ui_components): add text wrapper instead of String/Widget for Texts

This commit is contained in:
2023-02-08 17:42:33 +01:00
parent 82a643cbb4
commit 47773872eb
14 changed files with 69 additions and 41 deletions
@@ -10,6 +10,8 @@ class CustomAppBar extends AppBarComponent with $CustomAppBarCWMixin {
@override
Widget build(BuildContext context) => AppBar(
title: Text(super.title ?? ''),
title: Text(
super.title?.text ?? '',
),
);
}
@@ -10,7 +10,7 @@ class $CustomAppBarCWProxyImpl implements $AppBarComponentCWProxy {
const $CustomAppBarCWProxyImpl(this._value);
final CustomAppBar _value;
@override
CustomAppBar title(String? title) => this(title: title);
CustomAppBar title(TextWrapper? title) => this(title: title);
@override
CustomAppBar leading(Widget? leading) => this(leading: leading);
@override
@@ -19,7 +19,7 @@ class $CustomAppBarCWProxyImpl implements $AppBarComponentCWProxy {
CustomAppBar key(Key? key) => this(key: key);
@override
CustomAppBar call({
String? title,
TextWrapper? title,
Widget? leading,
List<Widget>? actions,
Key? key,
@@ -12,6 +12,6 @@ class CustomErrorWidget extends ErrorWidgetComponent
@override
Widget build(BuildContext context) => ColoredBox(
color: Colors.red,
child: Center(child: Text(error ?? 'Error')),
child: Center(child: Text(error?.text ?? 'Error')),
);
}
@@ -10,12 +10,12 @@ class $CustomErrorWidgetCWProxyImpl implements $ErrorWidgetComponentCWProxy {
const $CustomErrorWidgetCWProxyImpl(this._value);
final CustomErrorWidget _value;
@override
CustomErrorWidget error(String? error) => this(error: error);
CustomErrorWidget error(TextWrapper? error) => this(error: error);
@override
CustomErrorWidget key(Key? key) => this(key: key);
@override
CustomErrorWidget call({
String? error,
TextWrapper? error,
Key? key,
}) =>
CustomErrorWidget(