refactor(ui_kit): adapt ui_kit

This commit is contained in:
Malo Léon 2023-02-22 16:13:07 +01:00
parent b9dac32143
commit 317eb56d66
3 changed files with 76 additions and 15 deletions

View File

@ -22,7 +22,7 @@ import 'package:wyatt_ui_kit/wyatt_ui_kit.dart';
part 'top_app_bar.g.dart'; part 'top_app_bar.g.dart';
@ComponentCopyWithExtension() @ComponentCopyWithExtension()
class TopAppBar extends AppBarComponent with $TopAppBarCWMixin { class TopAppBar extends TopAppBarComponent with $TopAppBarCWMixin {
const TopAppBar({ const TopAppBar({
super.systemOverlayStyle, super.systemOverlayStyle,
super.automaticallyImplyLeading, super.automaticallyImplyLeading,

View File

@ -6,10 +6,14 @@ part of 'top_app_bar.dart';
// ComponentCopyWithGenerator // ComponentCopyWithGenerator
// ************************************************************************** // **************************************************************************
class $TopAppBarCWProxyImpl implements $AppBarComponentCWProxy { class $TopAppBarCWProxyImpl implements $TopAppBarComponentCWProxy {
const $TopAppBarCWProxyImpl(this._value); const $TopAppBarCWProxyImpl(this._value);
final TopAppBar _value; final TopAppBar _value;
@override @override
TopAppBar title(TextWrapper? title) => this(title: title);
@override
TopAppBar centerTitle(bool? centerTitle) => this(centerTitle: centerTitle);
@override
TopAppBar shape(ShapeBorder? shape) => this(shape: shape); TopAppBar shape(ShapeBorder? shape) => this(shape: shape);
@override @override
TopAppBar systemOverlayStyle(SystemUiOverlayStyle? systemOverlayStyle) => TopAppBar systemOverlayStyle(SystemUiOverlayStyle? systemOverlayStyle) =>
@ -49,20 +53,18 @@ class $TopAppBarCWProxyImpl implements $AppBarComponentCWProxy {
TopAppBar leadingWidth(double? leadingWidth) => TopAppBar leadingWidth(double? leadingWidth) =>
this(leadingWidth: leadingWidth); this(leadingWidth: leadingWidth);
@override @override
TopAppBar title(TextWrapper? title) => this(title: title);
@override
TopAppBar leading(Widget? leading) => this(leading: leading); TopAppBar leading(Widget? leading) => this(leading: leading);
@override @override
TopAppBar actions(List<Widget>? actions) => this(actions: actions); TopAppBar actions(List<Widget>? actions) => this(actions: actions);
@override @override
TopAppBar centerTitle(bool? centerTitle) => this(centerTitle: centerTitle);
@override
TopAppBar expandedWidget(List<Widget>? expandedWidget) => TopAppBar expandedWidget(List<Widget>? expandedWidget) =>
this(expandedWidget: expandedWidget); this(expandedWidget: expandedWidget);
@override @override
TopAppBar key(Key? key) => this(key: key); TopAppBar key(Key? key) => this(key: key);
@override @override
TopAppBar call({ TopAppBar call({
TextWrapper? title,
bool? centerTitle,
ShapeBorder? shape, ShapeBorder? shape,
SystemUiOverlayStyle? systemOverlayStyle, SystemUiOverlayStyle? systemOverlayStyle,
bool? automaticallyImplyLeading, bool? automaticallyImplyLeading,
@ -78,10 +80,8 @@ class $TopAppBarCWProxyImpl implements $AppBarComponentCWProxy {
bool? excludeHeaderSemantics, bool? excludeHeaderSemantics,
double? toolbarHeight, double? toolbarHeight,
double? leadingWidth, double? leadingWidth,
TextWrapper? title,
Widget? leading, Widget? leading,
List<Widget>? actions, List<Widget>? actions,
bool? centerTitle,
List<Widget>? expandedWidget, List<Widget>? expandedWidget,
Key? key, Key? key,
}) => }) =>
@ -114,6 +114,6 @@ class $TopAppBarCWProxyImpl implements $AppBarComponentCWProxy {
} }
mixin $TopAppBarCWMixin on Component { mixin $TopAppBarCWMixin on Component {
$AppBarComponentCWProxy get copyWith => $TopAppBarComponentCWProxy get copyWith =>
$TopAppBarCWProxyImpl(this as TopAppBar); $TopAppBarCWProxyImpl(this as TopAppBar);
} }

View File

@ -11,23 +11,84 @@ class $TopNavigationBarCWProxyImpl
const $TopNavigationBarCWProxyImpl(this._value); const $TopNavigationBarCWProxyImpl(this._value);
final TopNavigationBar _value; final TopNavigationBar _value;
@override @override
TopNavigationBar leading(Widget? leading) => this(leading: leading);
@override
TopNavigationBar actions(List<Widget>? actions) => this(actions: actions);
@override
TopNavigationBar onTap(void Function(BuildContext, int)? onTap) => TopNavigationBar onTap(void Function(BuildContext, int)? onTap) =>
this(onTap: onTap); this(onTap: onTap);
@override @override
TopNavigationBar currentIndex(int? currentIndex) => TopNavigationBar currentIndex(int? currentIndex) =>
this(currentIndex: currentIndex); this(currentIndex: currentIndex);
@override @override
TopNavigationBar shape(ShapeBorder? shape) => this(shape: shape);
@override
TopNavigationBar systemOverlayStyle(
SystemUiOverlayStyle? systemOverlayStyle) =>
this(systemOverlayStyle: systemOverlayStyle);
@override
TopNavigationBar automaticallyImplyLeading(bool? automaticallyImplyLeading) =>
this(automaticallyImplyLeading: automaticallyImplyLeading);
@override
TopNavigationBar flexibleSpace(Widget? flexibleSpace) =>
this(flexibleSpace: flexibleSpace);
@override
TopNavigationBar bottom(PreferredSizeWidget? bottom) => this(bottom: bottom);
@override
TopNavigationBar elevation(double? elevation) => this(elevation: elevation);
@override
TopNavigationBar scrolledUnderElevation(double? scrolledUnderElevation) =>
this(scrolledUnderElevation: scrolledUnderElevation);
@override
TopNavigationBar shadowColor(Color? shadowColor) =>
this(shadowColor: shadowColor);
@override
TopNavigationBar surfaceTintColor(Color? surfaceTintColor) =>
this(surfaceTintColor: surfaceTintColor);
@override
TopNavigationBar backgroundColor(MultiColor? backgroundColor) =>
this(backgroundColor: backgroundColor);
@override
TopNavigationBar iconTheme(IconThemeData? iconTheme) =>
this(iconTheme: iconTheme);
@override
TopNavigationBar primary(bool? primary) => this(primary: primary);
@override
TopNavigationBar excludeHeaderSemantics(bool? excludeHeaderSemantics) =>
this(excludeHeaderSemantics: excludeHeaderSemantics);
@override
TopNavigationBar toolbarHeight(double? toolbarHeight) =>
this(toolbarHeight: toolbarHeight);
@override
TopNavigationBar leadingWidth(double? leadingWidth) =>
this(leadingWidth: leadingWidth);
@override
TopNavigationBar leading(Widget? leading) => this(leading: leading);
@override
TopNavigationBar actions(List<Widget>? actions) => this(actions: actions);
@override
TopNavigationBar expandedWidget(List<Widget>? expandedWidget) =>
this(expandedWidget: expandedWidget);
@override
TopNavigationBar key(Key? key) => this(key: key); TopNavigationBar key(Key? key) => this(key: key);
@override @override
TopNavigationBar call({ TopNavigationBar call({
Widget? leading,
List<Widget>? actions,
void Function(BuildContext, int)? onTap, void Function(BuildContext, int)? onTap,
int? currentIndex, int? currentIndex,
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, Key? key,
}) => }) =>
TopNavigationBar( TopNavigationBar(