refactor(ui_layouts): Refactored block using the UI components package, introducing breaking changes
This commit is contained in:
@@ -17,11 +17,15 @@ class $CustomBottomNavigationBarCWProxyImpl
|
||||
CustomBottomNavigationBar currentIndex(int? currentIndex) =>
|
||||
this(currentIndex: currentIndex);
|
||||
@override
|
||||
CustomBottomNavigationBar items(List<BottomNavigationBarItem>? items) =>
|
||||
this(items: items);
|
||||
@override
|
||||
CustomBottomNavigationBar key(Key? key) => this(key: key);
|
||||
@override
|
||||
CustomBottomNavigationBar call({
|
||||
void Function(BuildContext, int)? onTap,
|
||||
int? currentIndex,
|
||||
List<BottomNavigationBarItem>? items,
|
||||
Key? key,
|
||||
}) =>
|
||||
CustomBottomNavigationBar(
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:wyatt_component_copy_with_extension/wyatt_component_copy_with_extension.dart';
|
||||
import 'package:wyatt_ui_components/wyatt_ui_components.dart';
|
||||
|
||||
part 'custom_desktop_app_bar.g.dart';
|
||||
|
||||
@ComponentCopyWithExtension()
|
||||
class CustomDesktopAppBar extends TopAppBarComponent
|
||||
with $CustomDesktopAppBarCWMixin {
|
||||
const CustomDesktopAppBar({
|
||||
super.title,
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => AppBar(
|
||||
backgroundColor: Colors.green,
|
||||
title: Text(title?.data ?? ''),
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'custom_desktop_app_bar.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// ComponentCopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
class $CustomDesktopAppBarCWProxyImpl implements $TopAppBarComponentCWProxy {
|
||||
const $CustomDesktopAppBarCWProxyImpl(this._value);
|
||||
final CustomDesktopAppBar _value;
|
||||
@override
|
||||
CustomDesktopAppBar title(TextWrapper? title) => this(title: title);
|
||||
@override
|
||||
CustomDesktopAppBar centerTitle(bool? centerTitle) =>
|
||||
this(centerTitle: centerTitle);
|
||||
@override
|
||||
CustomDesktopAppBar shape(ShapeBorder? shape) => this(shape: shape);
|
||||
@override
|
||||
CustomDesktopAppBar systemOverlayStyle(
|
||||
SystemUiOverlayStyle? systemOverlayStyle) =>
|
||||
this(systemOverlayStyle: systemOverlayStyle);
|
||||
@override
|
||||
CustomDesktopAppBar automaticallyImplyLeading(
|
||||
bool? automaticallyImplyLeading) =>
|
||||
this(automaticallyImplyLeading: automaticallyImplyLeading);
|
||||
@override
|
||||
CustomDesktopAppBar flexibleSpace(Widget? flexibleSpace) =>
|
||||
this(flexibleSpace: flexibleSpace);
|
||||
@override
|
||||
CustomDesktopAppBar bottom(PreferredSizeWidget? bottom) =>
|
||||
this(bottom: bottom);
|
||||
@override
|
||||
CustomDesktopAppBar elevation(double? elevation) =>
|
||||
this(elevation: elevation);
|
||||
@override
|
||||
CustomDesktopAppBar scrolledUnderElevation(double? scrolledUnderElevation) =>
|
||||
this(scrolledUnderElevation: scrolledUnderElevation);
|
||||
@override
|
||||
CustomDesktopAppBar shadowColor(Color? shadowColor) =>
|
||||
this(shadowColor: shadowColor);
|
||||
@override
|
||||
CustomDesktopAppBar surfaceTintColor(Color? surfaceTintColor) =>
|
||||
this(surfaceTintColor: surfaceTintColor);
|
||||
@override
|
||||
CustomDesktopAppBar backgroundColor(MultiColor? backgroundColor) =>
|
||||
this(backgroundColor: backgroundColor);
|
||||
@override
|
||||
CustomDesktopAppBar iconTheme(IconThemeData? iconTheme) =>
|
||||
this(iconTheme: iconTheme);
|
||||
@override
|
||||
CustomDesktopAppBar primary(bool? primary) => this(primary: primary);
|
||||
@override
|
||||
CustomDesktopAppBar excludeHeaderSemantics(bool? excludeHeaderSemantics) =>
|
||||
this(excludeHeaderSemantics: excludeHeaderSemantics);
|
||||
@override
|
||||
CustomDesktopAppBar toolbarHeight(double? toolbarHeight) =>
|
||||
this(toolbarHeight: toolbarHeight);
|
||||
@override
|
||||
CustomDesktopAppBar leadingWidth(double? leadingWidth) =>
|
||||
this(leadingWidth: leadingWidth);
|
||||
@override
|
||||
CustomDesktopAppBar leading(Widget? leading) => this(leading: leading);
|
||||
@override
|
||||
CustomDesktopAppBar actions(List<Widget>? actions) => this(actions: actions);
|
||||
@override
|
||||
CustomDesktopAppBar expandedWidget(List<Widget>? expandedWidget) =>
|
||||
this(expandedWidget: expandedWidget);
|
||||
@override
|
||||
CustomDesktopAppBar key(Key? key) => this(key: key);
|
||||
@override
|
||||
CustomDesktopAppBar 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,
|
||||
}) =>
|
||||
CustomDesktopAppBar(
|
||||
title: title ?? _value.title,
|
||||
key: key ?? _value.key,
|
||||
);
|
||||
}
|
||||
|
||||
mixin $CustomDesktopAppBarCWMixin on Component {
|
||||
$TopAppBarComponentCWProxy get copyWith =>
|
||||
$CustomDesktopAppBarCWProxyImpl(this as CustomDesktopAppBar);
|
||||
}
|
||||
+5
-3
@@ -3,17 +3,19 @@ import 'package:flutter/services.dart';
|
||||
import 'package:wyatt_component_copy_with_extension/wyatt_component_copy_with_extension.dart';
|
||||
import 'package:wyatt_ui_components/wyatt_ui_components.dart';
|
||||
|
||||
part 'custom_app_bar.g.dart';
|
||||
part 'custom_mobile_app_bar.g.dart';
|
||||
|
||||
@ComponentCopyWithExtension()
|
||||
class CustomAppBar extends TopAppBarComponent with $CustomAppBarCWMixin {
|
||||
const CustomAppBar({
|
||||
class CustomMobileAppBar extends TopAppBarComponent
|
||||
with $CustomMobileAppBarCWMixin {
|
||||
const CustomMobileAppBar({
|
||||
super.title,
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => AppBar(
|
||||
backgroundColor: Colors.red,
|
||||
title: Text(title?.data ?? ''),
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'custom_mobile_app_bar.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// ComponentCopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
class $CustomMobileAppBarCWProxyImpl implements $TopAppBarComponentCWProxy {
|
||||
const $CustomMobileAppBarCWProxyImpl(this._value);
|
||||
final CustomMobileAppBar _value;
|
||||
@override
|
||||
CustomMobileAppBar title(TextWrapper? title) => this(title: title);
|
||||
@override
|
||||
CustomMobileAppBar centerTitle(bool? centerTitle) =>
|
||||
this(centerTitle: centerTitle);
|
||||
@override
|
||||
CustomMobileAppBar shape(ShapeBorder? shape) => this(shape: shape);
|
||||
@override
|
||||
CustomMobileAppBar systemOverlayStyle(
|
||||
SystemUiOverlayStyle? systemOverlayStyle) =>
|
||||
this(systemOverlayStyle: systemOverlayStyle);
|
||||
@override
|
||||
CustomMobileAppBar automaticallyImplyLeading(
|
||||
bool? automaticallyImplyLeading) =>
|
||||
this(automaticallyImplyLeading: automaticallyImplyLeading);
|
||||
@override
|
||||
CustomMobileAppBar flexibleSpace(Widget? flexibleSpace) =>
|
||||
this(flexibleSpace: flexibleSpace);
|
||||
@override
|
||||
CustomMobileAppBar bottom(PreferredSizeWidget? bottom) =>
|
||||
this(bottom: bottom);
|
||||
@override
|
||||
CustomMobileAppBar elevation(double? elevation) => this(elevation: elevation);
|
||||
@override
|
||||
CustomMobileAppBar scrolledUnderElevation(double? scrolledUnderElevation) =>
|
||||
this(scrolledUnderElevation: scrolledUnderElevation);
|
||||
@override
|
||||
CustomMobileAppBar shadowColor(Color? shadowColor) =>
|
||||
this(shadowColor: shadowColor);
|
||||
@override
|
||||
CustomMobileAppBar surfaceTintColor(Color? surfaceTintColor) =>
|
||||
this(surfaceTintColor: surfaceTintColor);
|
||||
@override
|
||||
CustomMobileAppBar backgroundColor(MultiColor? backgroundColor) =>
|
||||
this(backgroundColor: backgroundColor);
|
||||
@override
|
||||
CustomMobileAppBar iconTheme(IconThemeData? iconTheme) =>
|
||||
this(iconTheme: iconTheme);
|
||||
@override
|
||||
CustomMobileAppBar primary(bool? primary) => this(primary: primary);
|
||||
@override
|
||||
CustomMobileAppBar excludeHeaderSemantics(bool? excludeHeaderSemantics) =>
|
||||
this(excludeHeaderSemantics: excludeHeaderSemantics);
|
||||
@override
|
||||
CustomMobileAppBar toolbarHeight(double? toolbarHeight) =>
|
||||
this(toolbarHeight: toolbarHeight);
|
||||
@override
|
||||
CustomMobileAppBar leadingWidth(double? leadingWidth) =>
|
||||
this(leadingWidth: leadingWidth);
|
||||
@override
|
||||
CustomMobileAppBar leading(Widget? leading) => this(leading: leading);
|
||||
@override
|
||||
CustomMobileAppBar actions(List<Widget>? actions) => this(actions: actions);
|
||||
@override
|
||||
CustomMobileAppBar expandedWidget(List<Widget>? expandedWidget) =>
|
||||
this(expandedWidget: expandedWidget);
|
||||
@override
|
||||
CustomMobileAppBar key(Key? key) => this(key: key);
|
||||
@override
|
||||
CustomMobileAppBar 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,
|
||||
}) =>
|
||||
CustomMobileAppBar(
|
||||
title: title ?? _value.title,
|
||||
key: key ?? _value.key,
|
||||
);
|
||||
}
|
||||
|
||||
mixin $CustomMobileAppBarCWMixin on Component {
|
||||
$TopAppBarComponentCWProxy get copyWith =>
|
||||
$CustomMobileAppBarCWProxyImpl(this as CustomMobileAppBar);
|
||||
}
|
||||
Reference in New Issue
Block a user