master #81

Closed
malo wants to merge 322 commits from master into feat/bloc_layout/new-package
8 changed files with 250 additions and 52 deletions
Showing only changes of commit 881cbc5bef - Show all commits

View File

@ -1,14 +1,15 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart'; import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart'; import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
part 'custom_app_bar.g.dart'; part 'custom_app_bar.g.dart';
@ComponentCopyWithExtension() @ComponentCopyWithExtension()
class CustomAppBar extends AppBarComponent with $CustomAppBarCWMixin { class CustomAppBar extends TopAppBarComponent with $CustomAppBarCWMixin {
const CustomAppBar({super.title}); const CustomAppBar({super.title});
@override @override
Widget build(BuildContext context) => AppBar( Widget build(BuildContext context) => AppBar(
title: Text(title?.text ?? 'Title'), title: Text(title?.data ?? 'Title'),
); );
} }

View File

@ -6,22 +6,85 @@ part of 'custom_app_bar.dart';
// ComponentCopyWithGenerator // ComponentCopyWithGenerator
// ************************************************************************** // **************************************************************************
class $CustomAppBarCWProxyImpl implements $AppBarComponentCWProxy { class $CustomAppBarCWProxyImpl implements $TopAppBarComponentCWProxy {
const $CustomAppBarCWProxyImpl(this._value); const $CustomAppBarCWProxyImpl(this._value);
final CustomAppBar _value; final CustomAppBar _value;
@override @override
CustomAppBar title(TextWrapper? title) => this(title: title); CustomAppBar title(TextWrapper? title) => this(title: title);
@override @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); CustomAppBar leading(Widget? leading) => this(leading: leading);
@override @override
CustomAppBar actions(List<Widget>? actions) => this(actions: actions); CustomAppBar actions(List<Widget>? actions) => this(actions: actions);
@override @override
CustomAppBar expandedWidget(List<Widget>? expandedWidget) =>
this(expandedWidget: expandedWidget);
@override
CustomAppBar key(Key? key) => this(key: key); CustomAppBar key(Key? key) => this(key: key);
@override @override
CustomAppBar call({ CustomAppBar call({
TextWrapper? 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, Widget? leading,
List<Widget>? actions, List<Widget>? actions,
List<Widget>? expandedWidget,
Key? key, Key? key,
}) => }) =>
CustomAppBar( CustomAppBar(
@ -30,6 +93,6 @@ class $CustomAppBarCWProxyImpl implements $AppBarComponentCWProxy {
} }
mixin $CustomAppBarCWMixin on Component { mixin $CustomAppBarCWMixin on Component {
$AppBarComponentCWProxy get copyWith => $TopAppBarComponentCWProxy get copyWith =>
$CustomAppBarCWProxyImpl(this as CustomAppBar); $CustomAppBarCWProxyImpl(this as CustomAppBar);
} }

View File

@ -12,6 +12,6 @@ class CustomErrorWidget extends ErrorWidgetComponent
@override @override
Widget build(BuildContext context) => ColoredBox( Widget build(BuildContext context) => ColoredBox(
color: Colors.red, color: Colors.red,
child: Center(child: Text(error?.text ?? 'Error')), child: Center(child: Text(error?.data ?? 'Error')),
); );
} }

View File

@ -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<Widget>? actions) => this(actions: actions);
@override
CustomAppBarExample key(Key? key) => this(key: key);
@override
CustomAppBarExample call({
String? title,
Widget? leading,
List<Widget>? actions,
Key? key,
}) =>
CustomAppBarExample(
title: title ?? _value.title,
key: key ?? _value.key,
);
}
mixin $CustomAppBarExampleCWMixin on Component {
$AppBarComponentCWProxy get copyWith =>
$CustomAppBarExampleCWProxyImpl(this as CustomAppBarExample);
}

View File

@ -15,18 +15,19 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>. // along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/material.dart'; 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_component_copy_with_extension/component_copy_with_extension.dart';
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.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() @ComponentCopyWithExtension()
class CustomAppBarExample extends AppBarComponent class CustomTopAppBarExample extends TopAppBarComponent
with $CustomAppBarExampleCWMixin { with $CustomTopAppBarExampleCWMixin {
const CustomAppBarExample({super.title, super.key}); const CustomTopAppBarExample({super.title, super.key});
@override @override
Widget build(BuildContext context) => AppBar( Widget build(BuildContext context) => AppBar(
title: Text(super.title?.text ?? ''), title: Text(super.title?.data ?? ''),
); );
} }

View File

@ -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<Widget>? actions) =>
this(actions: actions);
@override
CustomTopAppBarExample expandedWidget(List<Widget>? 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<Widget>? actions,
List<Widget>? expandedWidget,
Key? key,
}) =>
CustomTopAppBarExample(
title: title ?? _value.title,
key: key ?? _value.key,
);
}
mixin $CustomTopAppBarExampleCWMixin on Component {
$TopAppBarComponentCWProxy get copyWith =>
$CustomTopAppBarExampleCWProxyImpl(this as CustomTopAppBarExample);
}

View File

@ -5,7 +5,7 @@ import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
part 'custom_app_bar.g.dart'; part 'custom_app_bar.g.dart';
@ComponentCopyWithExtension() @ComponentCopyWithExtension()
class CustomAppBar extends AppBarComponent with $CustomAppBarCWMixin { class CustomAppBar extends TopAppBarComponent with $CustomAppBarCWMixin {
const CustomAppBar({ const CustomAppBar({
super.title, super.title,
super.key, super.key,
@ -13,6 +13,6 @@ class CustomAppBar extends AppBarComponent with $CustomAppBarCWMixin {
@override @override
Widget build(BuildContext context) => AppBar( Widget build(BuildContext context) => AppBar(
title: Text(title?.text ?? ''), title: Text(title?.data ?? ''),
); );
} }

View File

@ -6,22 +6,85 @@ part of 'custom_app_bar.dart';
// ComponentCopyWithGenerator // ComponentCopyWithGenerator
// ************************************************************************** // **************************************************************************
class $CustomAppBarCWProxyImpl implements $AppBarComponentCWProxy { class $CustomAppBarCWProxyImpl implements $TopAppBarComponentCWProxy {
const $CustomAppBarCWProxyImpl(this._value); const $CustomAppBarCWProxyImpl(this._value);
final CustomAppBar _value; final CustomAppBar _value;
@override @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 @override
CustomAppBar leading(Widget? leading) => this(leading: leading); CustomAppBar leading(Widget? leading) => this(leading: leading);
@override @override
CustomAppBar actions(List<Widget>? actions) => this(actions: actions); CustomAppBar actions(List<Widget>? actions) => this(actions: actions);
@override @override
CustomAppBar expandedWidget(List<Widget>? expandedWidget) =>
this(expandedWidget: expandedWidget);
@override
CustomAppBar key(Key? key) => this(key: key); CustomAppBar key(Key? key) => this(key: key);
@override @override
CustomAppBar call({ 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, Widget? leading,
List<Widget>? actions, List<Widget>? actions,
List<Widget>? expandedWidget,
Key? key, Key? key,
}) => }) =>
CustomAppBar( CustomAppBar(
@ -31,6 +94,6 @@ class $CustomAppBarCWProxyImpl implements $AppBarComponentCWProxy {
} }
mixin $CustomAppBarCWMixin on Component { mixin $CustomAppBarCWMixin on Component {
$AppBarComponentCWProxy get copyWith => $TopAppBarComponentCWProxy get copyWith =>
$CustomAppBarCWProxyImpl(this as CustomAppBar); $CustomAppBarCWProxyImpl(this as CustomAppBar);
} }