diff --git a/packages/wyatt_bloc_layout/example/lib/components/custom_app_bar.dart b/packages/wyatt_bloc_layout/example/lib/components/custom_app_bar.dart index 0cb81c93..8d57fb2b 100644 --- a/packages/wyatt_bloc_layout/example/lib/components/custom_app_bar.dart +++ b/packages/wyatt_bloc_layout/example/lib/components/custom_app_bar.dart @@ -1,14 +1,15 @@ import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart'; import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart'; part 'custom_app_bar.g.dart'; @ComponentCopyWithExtension() -class CustomAppBar extends AppBarComponent with $CustomAppBarCWMixin { +class CustomAppBar extends TopAppBarComponent with $CustomAppBarCWMixin { const CustomAppBar({super.title}); @override Widget build(BuildContext context) => AppBar( - title: Text(title?.text ?? 'Title'), + title: Text(title?.data ?? 'Title'), ); } diff --git a/packages/wyatt_bloc_layout/example/lib/components/custom_app_bar.g.dart b/packages/wyatt_bloc_layout/example/lib/components/custom_app_bar.g.dart index f64c8fee..ca934616 100644 --- a/packages/wyatt_bloc_layout/example/lib/components/custom_app_bar.g.dart +++ b/packages/wyatt_bloc_layout/example/lib/components/custom_app_bar.g.dart @@ -6,22 +6,85 @@ part of 'custom_app_bar.dart'; // ComponentCopyWithGenerator // ************************************************************************** -class $CustomAppBarCWProxyImpl implements $AppBarComponentCWProxy { +class $CustomAppBarCWProxyImpl implements $TopAppBarComponentCWProxy { const $CustomAppBarCWProxyImpl(this._value); final CustomAppBar _value; @override CustomAppBar title(TextWrapper? title) => this(title: title); @override + CustomAppBar centerTitle(bool? centerTitle) => this(centerTitle: centerTitle); + @override + CustomAppBar shape(ShapeBorder? shape) => this(shape: shape); + @override + CustomAppBar systemOverlayStyle(SystemUiOverlayStyle? systemOverlayStyle) => + this(systemOverlayStyle: systemOverlayStyle); + @override + CustomAppBar automaticallyImplyLeading(bool? automaticallyImplyLeading) => + this(automaticallyImplyLeading: automaticallyImplyLeading); + @override + CustomAppBar flexibleSpace(Widget? flexibleSpace) => + this(flexibleSpace: flexibleSpace); + @override + CustomAppBar bottom(PreferredSizeWidget? bottom) => this(bottom: bottom); + @override + CustomAppBar elevation(double? elevation) => this(elevation: elevation); + @override + CustomAppBar scrolledUnderElevation(double? scrolledUnderElevation) => + this(scrolledUnderElevation: scrolledUnderElevation); + @override + CustomAppBar shadowColor(Color? shadowColor) => + this(shadowColor: shadowColor); + @override + CustomAppBar surfaceTintColor(Color? surfaceTintColor) => + this(surfaceTintColor: surfaceTintColor); + @override + CustomAppBar backgroundColor(MultiColor? backgroundColor) => + this(backgroundColor: backgroundColor); + @override + CustomAppBar iconTheme(IconThemeData? iconTheme) => + this(iconTheme: iconTheme); + @override + CustomAppBar primary(bool? primary) => this(primary: primary); + @override + CustomAppBar excludeHeaderSemantics(bool? excludeHeaderSemantics) => + this(excludeHeaderSemantics: excludeHeaderSemantics); + @override + CustomAppBar toolbarHeight(double? toolbarHeight) => + this(toolbarHeight: toolbarHeight); + @override + CustomAppBar leadingWidth(double? leadingWidth) => + this(leadingWidth: leadingWidth); + @override CustomAppBar leading(Widget? leading) => this(leading: leading); @override CustomAppBar actions(List? actions) => this(actions: actions); @override + CustomAppBar expandedWidget(List? expandedWidget) => + this(expandedWidget: expandedWidget); + @override CustomAppBar key(Key? key) => this(key: key); @override CustomAppBar call({ TextWrapper? title, + bool? centerTitle, + ShapeBorder? shape, + SystemUiOverlayStyle? systemOverlayStyle, + bool? automaticallyImplyLeading, + Widget? flexibleSpace, + PreferredSizeWidget? bottom, + double? elevation, + double? scrolledUnderElevation, + Color? shadowColor, + Color? surfaceTintColor, + MultiColor? backgroundColor, + IconThemeData? iconTheme, + bool? primary, + bool? excludeHeaderSemantics, + double? toolbarHeight, + double? leadingWidth, Widget? leading, List? actions, + List? expandedWidget, Key? key, }) => CustomAppBar( @@ -30,6 +93,6 @@ class $CustomAppBarCWProxyImpl implements $AppBarComponentCWProxy { } mixin $CustomAppBarCWMixin on Component { - $AppBarComponentCWProxy get copyWith => + $TopAppBarComponentCWProxy get copyWith => $CustomAppBarCWProxyImpl(this as CustomAppBar); } diff --git a/packages/wyatt_bloc_layout/example/lib/components/custom_error_widget.dart b/packages/wyatt_bloc_layout/example/lib/components/custom_error_widget.dart index 8890f785..57447de2 100644 --- a/packages/wyatt_bloc_layout/example/lib/components/custom_error_widget.dart +++ b/packages/wyatt_bloc_layout/example/lib/components/custom_error_widget.dart @@ -12,6 +12,6 @@ class CustomErrorWidget extends ErrorWidgetComponent @override Widget build(BuildContext context) => ColoredBox( color: Colors.red, - child: Center(child: Text(error?.text ?? 'Error')), + child: Center(child: Text(error?.data ?? 'Error')), ); } diff --git a/packages/wyatt_component_copy_with_gen/example/lib/custom_app_bar_example.g.dart b/packages/wyatt_component_copy_with_gen/example/lib/custom_app_bar_example.g.dart deleted file mode 100644 index 95d56868..00000000 --- a/packages/wyatt_component_copy_with_gen/example/lib/custom_app_bar_example.g.dart +++ /dev/null @@ -1,36 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'custom_app_bar_example.dart'; - -// ************************************************************************** -// ComponentCopyWithGenerator -// ************************************************************************** - -class $CustomAppBarExampleCWProxyImpl implements $AppBarComponentCWProxy { - const $CustomAppBarExampleCWProxyImpl(this._value); - final CustomAppBarExample _value; - @override - CustomAppBarExample title(String? title) => this(title: title); - @override - CustomAppBarExample leading(Widget? leading) => this(leading: leading); - @override - CustomAppBarExample actions(List? actions) => this(actions: actions); - @override - CustomAppBarExample key(Key? key) => this(key: key); - @override - CustomAppBarExample call({ - String? title, - Widget? leading, - List? actions, - Key? key, - }) => - CustomAppBarExample( - title: title ?? _value.title, - key: key ?? _value.key, - ); -} - -mixin $CustomAppBarExampleCWMixin on Component { - $AppBarComponentCWProxy get copyWith => - $CustomAppBarExampleCWProxyImpl(this as CustomAppBarExample); -} diff --git a/packages/wyatt_component_copy_with_gen/example/lib/custom_app_bar_example.dart b/packages/wyatt_component_copy_with_gen/example/lib/custom_top_bar_example.dart similarity index 78% rename from packages/wyatt_component_copy_with_gen/example/lib/custom_app_bar_example.dart rename to packages/wyatt_component_copy_with_gen/example/lib/custom_top_bar_example.dart index 870222a6..6ac4ade7 100644 --- a/packages/wyatt_component_copy_with_gen/example/lib/custom_app_bar_example.dart +++ b/packages/wyatt_component_copy_with_gen/example/lib/custom_top_bar_example.dart @@ -15,18 +15,19 @@ // along with this program. If not, see . import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart'; import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart'; -part 'custom_app_bar_example.g.dart'; +part 'custom_top_bar_example.g.dart'; @ComponentCopyWithExtension() -class CustomAppBarExample extends AppBarComponent - with $CustomAppBarExampleCWMixin { - const CustomAppBarExample({super.title, super.key}); +class CustomTopAppBarExample extends TopAppBarComponent + with $CustomTopAppBarExampleCWMixin { + const CustomTopAppBarExample({super.title, super.key}); @override Widget build(BuildContext context) => AppBar( - title: Text(super.title?.text ?? ''), + title: Text(super.title?.data ?? ''), ); } diff --git a/packages/wyatt_component_copy_with_gen/example/lib/custom_top_bar_example.g.dart b/packages/wyatt_component_copy_with_gen/example/lib/custom_top_bar_example.g.dart new file mode 100644 index 00000000..ac4e015b --- /dev/null +++ b/packages/wyatt_component_copy_with_gen/example/lib/custom_top_bar_example.g.dart @@ -0,0 +1,106 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'custom_top_bar_example.dart'; + +// ************************************************************************** +// ComponentCopyWithGenerator +// ************************************************************************** + +class $CustomTopAppBarExampleCWProxyImpl implements $TopAppBarComponentCWProxy { + const $CustomTopAppBarExampleCWProxyImpl(this._value); + final CustomTopAppBarExample _value; + @override + CustomTopAppBarExample title(TextWrapper? title) => this(title: title); + @override + CustomTopAppBarExample centerTitle(bool? centerTitle) => + this(centerTitle: centerTitle); + @override + CustomTopAppBarExample shape(ShapeBorder? shape) => this(shape: shape); + @override + CustomTopAppBarExample systemOverlayStyle( + SystemUiOverlayStyle? systemOverlayStyle) => + this(systemOverlayStyle: systemOverlayStyle); + @override + CustomTopAppBarExample automaticallyImplyLeading( + bool? automaticallyImplyLeading) => + this(automaticallyImplyLeading: automaticallyImplyLeading); + @override + CustomTopAppBarExample flexibleSpace(Widget? flexibleSpace) => + this(flexibleSpace: flexibleSpace); + @override + CustomTopAppBarExample bottom(PreferredSizeWidget? bottom) => + this(bottom: bottom); + @override + CustomTopAppBarExample elevation(double? elevation) => + this(elevation: elevation); + @override + CustomTopAppBarExample scrolledUnderElevation( + double? scrolledUnderElevation) => + this(scrolledUnderElevation: scrolledUnderElevation); + @override + CustomTopAppBarExample shadowColor(Color? shadowColor) => + this(shadowColor: shadowColor); + @override + CustomTopAppBarExample surfaceTintColor(Color? surfaceTintColor) => + this(surfaceTintColor: surfaceTintColor); + @override + CustomTopAppBarExample backgroundColor(MultiColor? backgroundColor) => + this(backgroundColor: backgroundColor); + @override + CustomTopAppBarExample iconTheme(IconThemeData? iconTheme) => + this(iconTheme: iconTheme); + @override + CustomTopAppBarExample primary(bool? primary) => this(primary: primary); + @override + CustomTopAppBarExample excludeHeaderSemantics(bool? excludeHeaderSemantics) => + this(excludeHeaderSemantics: excludeHeaderSemantics); + @override + CustomTopAppBarExample toolbarHeight(double? toolbarHeight) => + this(toolbarHeight: toolbarHeight); + @override + CustomTopAppBarExample leadingWidth(double? leadingWidth) => + this(leadingWidth: leadingWidth); + @override + CustomTopAppBarExample leading(Widget? leading) => this(leading: leading); + @override + CustomTopAppBarExample actions(List? actions) => + this(actions: actions); + @override + CustomTopAppBarExample expandedWidget(List? expandedWidget) => + this(expandedWidget: expandedWidget); + @override + CustomTopAppBarExample key(Key? key) => this(key: key); + @override + CustomTopAppBarExample call({ + TextWrapper? title, + bool? centerTitle, + ShapeBorder? shape, + SystemUiOverlayStyle? systemOverlayStyle, + bool? automaticallyImplyLeading, + Widget? flexibleSpace, + PreferredSizeWidget? bottom, + double? elevation, + double? scrolledUnderElevation, + Color? shadowColor, + Color? surfaceTintColor, + MultiColor? backgroundColor, + IconThemeData? iconTheme, + bool? primary, + bool? excludeHeaderSemantics, + double? toolbarHeight, + double? leadingWidth, + Widget? leading, + List? actions, + List? expandedWidget, + Key? key, + }) => + CustomTopAppBarExample( + title: title ?? _value.title, + key: key ?? _value.key, + ); +} + +mixin $CustomTopAppBarExampleCWMixin on Component { + $TopAppBarComponentCWProxy get copyWith => + $CustomTopAppBarExampleCWProxyImpl(this as CustomTopAppBarExample); +} diff --git a/packages/wyatt_ui_layout/example/lib/components/custom_app_bar.dart b/packages/wyatt_ui_layout/example/lib/components/custom_app_bar.dart index 5943737e..94bafe9d 100644 --- a/packages/wyatt_ui_layout/example/lib/components/custom_app_bar.dart +++ b/packages/wyatt_ui_layout/example/lib/components/custom_app_bar.dart @@ -5,7 +5,7 @@ import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart'; part 'custom_app_bar.g.dart'; @ComponentCopyWithExtension() -class CustomAppBar extends AppBarComponent with $CustomAppBarCWMixin { +class CustomAppBar extends TopAppBarComponent with $CustomAppBarCWMixin { const CustomAppBar({ super.title, super.key, @@ -13,6 +13,6 @@ class CustomAppBar extends AppBarComponent with $CustomAppBarCWMixin { @override Widget build(BuildContext context) => AppBar( - title: Text(title?.text ?? ''), + title: Text(title?.data ?? ''), ); } diff --git a/packages/wyatt_ui_layout/example/lib/components/custom_app_bar.g.dart b/packages/wyatt_ui_layout/example/lib/components/custom_app_bar.g.dart index 89c78122..125680d9 100644 --- a/packages/wyatt_ui_layout/example/lib/components/custom_app_bar.g.dart +++ b/packages/wyatt_ui_layout/example/lib/components/custom_app_bar.g.dart @@ -6,22 +6,85 @@ part of 'custom_app_bar.dart'; // ComponentCopyWithGenerator // ************************************************************************** -class $CustomAppBarCWProxyImpl implements $AppBarComponentCWProxy { +class $CustomAppBarCWProxyImpl implements $TopAppBarComponentCWProxy { const $CustomAppBarCWProxyImpl(this._value); final CustomAppBar _value; @override - CustomAppBar title(String? title) => this(title: title); + CustomAppBar title(TextWrapper? title) => this(title: title); + @override + CustomAppBar centerTitle(bool? centerTitle) => this(centerTitle: centerTitle); + @override + CustomAppBar shape(ShapeBorder? shape) => this(shape: shape); + @override + CustomAppBar systemOverlayStyle(SystemUiOverlayStyle? systemOverlayStyle) => + this(systemOverlayStyle: systemOverlayStyle); + @override + CustomAppBar automaticallyImplyLeading(bool? automaticallyImplyLeading) => + this(automaticallyImplyLeading: automaticallyImplyLeading); + @override + CustomAppBar flexibleSpace(Widget? flexibleSpace) => + this(flexibleSpace: flexibleSpace); + @override + CustomAppBar bottom(PreferredSizeWidget? bottom) => this(bottom: bottom); + @override + CustomAppBar elevation(double? elevation) => this(elevation: elevation); + @override + CustomAppBar scrolledUnderElevation(double? scrolledUnderElevation) => + this(scrolledUnderElevation: scrolledUnderElevation); + @override + CustomAppBar shadowColor(Color? shadowColor) => + this(shadowColor: shadowColor); + @override + CustomAppBar surfaceTintColor(Color? surfaceTintColor) => + this(surfaceTintColor: surfaceTintColor); + @override + CustomAppBar backgroundColor(MultiColor? backgroundColor) => + this(backgroundColor: backgroundColor); + @override + CustomAppBar iconTheme(IconThemeData? iconTheme) => + this(iconTheme: iconTheme); + @override + CustomAppBar primary(bool? primary) => this(primary: primary); + @override + CustomAppBar excludeHeaderSemantics(bool? excludeHeaderSemantics) => + this(excludeHeaderSemantics: excludeHeaderSemantics); + @override + CustomAppBar toolbarHeight(double? toolbarHeight) => + this(toolbarHeight: toolbarHeight); + @override + CustomAppBar leadingWidth(double? leadingWidth) => + this(leadingWidth: leadingWidth); @override CustomAppBar leading(Widget? leading) => this(leading: leading); @override CustomAppBar actions(List? actions) => this(actions: actions); @override + CustomAppBar expandedWidget(List? expandedWidget) => + this(expandedWidget: expandedWidget); + @override CustomAppBar key(Key? key) => this(key: key); @override CustomAppBar call({ - String? title, + TextWrapper? title, + bool? centerTitle, + ShapeBorder? shape, + SystemUiOverlayStyle? systemOverlayStyle, + bool? automaticallyImplyLeading, + Widget? flexibleSpace, + PreferredSizeWidget? bottom, + double? elevation, + double? scrolledUnderElevation, + Color? shadowColor, + Color? surfaceTintColor, + MultiColor? backgroundColor, + IconThemeData? iconTheme, + bool? primary, + bool? excludeHeaderSemantics, + double? toolbarHeight, + double? leadingWidth, Widget? leading, List? actions, + List? expandedWidget, Key? key, }) => CustomAppBar( @@ -31,6 +94,6 @@ class $CustomAppBarCWProxyImpl implements $AppBarComponentCWProxy { } mixin $CustomAppBarCWMixin on Component { - $AppBarComponentCWProxy get copyWith => + $TopAppBarComponentCWProxy get copyWith => $CustomAppBarCWProxyImpl(this as CustomAppBar); }