Create Appbar Components #155

Merged
hugo merged 11 commits from ui_kit-ui_components/feat/create-appbar-components into master 2023-02-22 16:48:26 +00:00
8 changed files with 91 additions and 75 deletions
Showing only changes of commit b9dac32143 - Show all commits

View File

@ -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});
@override

View File

@ -6,10 +6,14 @@ 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) =>
@ -51,20 +55,18 @@ class $CustomAppBarCWProxyImpl implements $AppBarComponentCWProxy {
CustomAppBar leadingWidth(double? leadingWidth) =>
this(leadingWidth: leadingWidth);
@override
CustomAppBar title(TextWrapper? title) => this(title: title);
@override
CustomAppBar leading(Widget? leading) => this(leading: leading);
@override
CustomAppBar actions(List<Widget>? actions) => this(actions: actions);
@override
CustomAppBar centerTitle(bool? centerTitle) => this(centerTitle: centerTitle);
@override
CustomAppBar expandedWidget(List<Widget>? 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,
@ -80,10 +82,8 @@ class $CustomAppBarCWProxyImpl implements $AppBarComponentCWProxy {
bool? excludeHeaderSemantics,
double? toolbarHeight,
double? leadingWidth,
TextWrapper? title,
Widget? leading,
List<Widget>? actions,
bool? centerTitle,
List<Widget>? expandedWidget,
Key? key,
}) =>
@ -94,6 +94,6 @@ class $CustomAppBarCWProxyImpl implements $AppBarComponentCWProxy {
}
mixin $CustomAppBarCWMixin on Component {
$AppBarComponentCWProxy get copyWith =>
$TopAppBarComponentCWProxy get copyWith =>
$CustomAppBarCWProxyImpl(this as CustomAppBar);
}

View File

@ -1,54 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'app_bar_component.dart';
// **************************************************************************
// ComponentProxyGenerator
// **************************************************************************
abstract class $AppBarComponentCWProxy {
AppBarComponent shape(ShapeBorder? shape);
AppBarComponent systemOverlayStyle(SystemUiOverlayStyle? systemOverlayStyle);
AppBarComponent automaticallyImplyLeading(bool? automaticallyImplyLeading);
AppBarComponent flexibleSpace(Widget? flexibleSpace);
AppBarComponent bottom(PreferredSizeWidget? bottom);
AppBarComponent elevation(double? elevation);
AppBarComponent scrolledUnderElevation(double? scrolledUnderElevation);
AppBarComponent shadowColor(Color? shadowColor);
AppBarComponent surfaceTintColor(Color? surfaceTintColor);
AppBarComponent backgroundColor(MultiColor? backgroundColor);
AppBarComponent iconTheme(IconThemeData? iconTheme);
AppBarComponent primary(bool? primary);
AppBarComponent excludeHeaderSemantics(bool? excludeHeaderSemantics);
AppBarComponent toolbarHeight(double? toolbarHeight);
AppBarComponent leadingWidth(double? leadingWidth);
AppBarComponent title(TextWrapper? title);
AppBarComponent leading(Widget? leading);
AppBarComponent actions(List<Widget>? actions);
AppBarComponent centerTitle(bool? centerTitle);
AppBarComponent expandedWidget(List<Widget>? expandedWidget);
AppBarComponent key(Key? key);
AppBarComponent call({
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,
TextWrapper? title,
Widget? leading,
List<Widget>? actions,
bool? centerTitle,
List<Widget>? expandedWidget,
Key? key,
});
}

View File

@ -14,6 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
export './app_bar_component.dart';
export 'top_app_bar_component.dart';
export './bottom_navigation_bar_component.dart';
export './top_navigation_bar_component.dart';

View File

@ -20,12 +20,12 @@ import 'package:wyatt_component_copy_with_extension/component_copy_with_extensio
import 'package:wyatt_ui_components/src/domain/entities/bars/top_bar_component.dart';
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
part 'app_bar_component.g.dart';
part 'top_app_bar_component.g.dart';
@ComponentProxyExtension()
abstract class AppBarComponent extends TopBarComponent
with CopyWithMixin<$AppBarComponentCWProxy> {
const AppBarComponent({
abstract class TopAppBarComponent extends TopBarComponent
with CopyWithMixin<$TopAppBarComponentCWProxy> {
const TopAppBarComponent({
this.title,
this.centerTitle,
super.shape,

View File

@ -0,0 +1,55 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'top_app_bar_component.dart';
// **************************************************************************
// ComponentProxyGenerator
// **************************************************************************
abstract class $TopAppBarComponentCWProxy {
TopAppBarComponent title(TextWrapper? title);
TopAppBarComponent centerTitle(bool? centerTitle);
TopAppBarComponent shape(ShapeBorder? shape);
TopAppBarComponent systemOverlayStyle(
SystemUiOverlayStyle? systemOverlayStyle);
TopAppBarComponent automaticallyImplyLeading(bool? automaticallyImplyLeading);
TopAppBarComponent flexibleSpace(Widget? flexibleSpace);
TopAppBarComponent bottom(PreferredSizeWidget? bottom);
TopAppBarComponent elevation(double? elevation);
TopAppBarComponent scrolledUnderElevation(double? scrolledUnderElevation);
TopAppBarComponent shadowColor(Color? shadowColor);
TopAppBarComponent surfaceTintColor(Color? surfaceTintColor);
TopAppBarComponent backgroundColor(MultiColor? backgroundColor);
TopAppBarComponent iconTheme(IconThemeData? iconTheme);
TopAppBarComponent primary(bool? primary);
TopAppBarComponent excludeHeaderSemantics(bool? excludeHeaderSemantics);
TopAppBarComponent toolbarHeight(double? toolbarHeight);
TopAppBarComponent leadingWidth(double? leadingWidth);
TopAppBarComponent leading(Widget? leading);
TopAppBarComponent actions(List<Widget>? actions);
TopAppBarComponent expandedWidget(List<Widget>? expandedWidget);
TopAppBarComponent key(Key? key);
TopAppBarComponent 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,
});
}

View File

@ -17,22 +17,37 @@
import 'package:flutter/material.dart';
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
import 'package:wyatt_ui_components/src/core/mixins/copy_with_mixin.dart';
import 'package:wyatt_ui_components/src/domain/entities/component.dart';
import 'package:wyatt_ui_components/src/domain/entities/bars/top_bar_component.dart';
part 'top_navigation_bar_component.g.dart';
@ComponentProxyExtension()
abstract class TopNavigationBarComponent extends Component
abstract class TopNavigationBarComponent extends TopBarComponent
with CopyWithMixin<$TopNavigationBarComponentCWProxy> {
const TopNavigationBarComponent({
this.leading,
this.actions,
this.onTap,
this.currentIndex = 0,
super.shape,
super.systemOverlayStyle,
super.automaticallyImplyLeading,
super.flexibleSpace,
super.bottom,
super.elevation,
super.scrolledUnderElevation,
super.shadowColor,
super.surfaceTintColor,
super.backgroundColor,
super.iconTheme,
super.primary,
super.excludeHeaderSemantics,
super.toolbarHeight,
super.leadingWidth,
super.leading,
super.actions,
super.expandedWidget,
super.key,
});
final int currentIndex;
final void Function(BuildContext, int)? onTap;
final Widget? leading;
final List<Widget>? actions;
}

View File

@ -35,7 +35,7 @@ class ComponentThemeData {
this.quoteCardComponent,
this.skillCardComponent,
});
final AppBarComponent? appBar;
final TopAppBarComponent? appBar;
final TopNavigationBarComponent? topNavigationBarComponent;
final BottomNavigationBarComponent? bottomNavigationBar;