Compare commits

..

No commits in common. "4a3fde3a1ec3e71ec4d12320ce92622dd2498451" and "ad0f1ec1c58b860f2df6962c7fe83ecf33bd3d89" have entirely different histories.

28 changed files with 221 additions and 628 deletions

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 TopAppBarComponent with $CustomAppBarCWMixin {
class CustomAppBar extends AppBarComponent with $CustomAppBarCWMixin {
const CustomAppBar({super.title, super.key});
@override

View File

@ -6,14 +6,10 @@ part of 'custom_app_bar.dart';
// ComponentCopyWithGenerator
// **************************************************************************
class $CustomAppBarCWProxyImpl implements $TopAppBarComponentCWProxy {
class $CustomAppBarCWProxyImpl implements $AppBarComponentCWProxy {
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) =>
@ -55,18 +51,20 @@ class $CustomAppBarCWProxyImpl implements $TopAppBarComponentCWProxy {
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,
@ -82,8 +80,10 @@ class $CustomAppBarCWProxyImpl implements $TopAppBarComponentCWProxy {
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 $TopAppBarComponentCWProxy {
}
mixin $CustomAppBarCWMixin on Component {
$TopAppBarComponentCWProxy get copyWith =>
$AppBarComponentCWProxy get copyWith =>
$CustomAppBarCWProxyImpl(this as CustomAppBar);
}

View File

@ -16,12 +16,17 @@
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';
abstract class TopBarComponent extends Component {
const TopBarComponent({
this.leading,
this.actions,
part 'app_bar_component.g.dart';
@ComponentProxyExtension()
abstract class AppBarComponent extends Component
with CopyWithMixin<$AppBarComponentCWProxy> {
const AppBarComponent({
this.shape,
this.systemOverlayStyle,
this.automaticallyImplyLeading,
this.flexibleSpace,
this.bottom,
@ -35,12 +40,15 @@ abstract class TopBarComponent extends Component {
this.excludeHeaderSemantics,
this.toolbarHeight,
this.leadingWidth,
this.systemOverlayStyle,
this.shape,
this.title,
this.leading,
this.actions,
this.centerTitle,
this.expandedWidget,
super.key,
});
final TextWrapper? title;
final bool? centerTitle;
final Widget? leading;
final List<Widget>? actions;
final bool? automaticallyImplyLeading;

View File

@ -0,0 +1,54 @@
// 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

@ -1,53 +0,0 @@
// Copyright (C) 2023 WYATT GROUP
// Please see the AUTHORS file for details.
//
// super program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// super program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with super program. If not, see <https://www.gnu.org/licenses/>.
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/src/domain/entities/bars/top_bar_component.dart';
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
part 'top_app_bar_component.g.dart';
@ComponentProxyExtension()
abstract class TopAppBarComponent extends TopBarComponent
with CopyWithMixin<$TopAppBarComponentCWProxy> {
const TopAppBarComponent({
this.title,
this.centerTitle,
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 TextWrapper? title;
final bool? centerTitle;
}

View File

@ -1,55 +0,0 @@
// 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

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

View File

@ -14,7 +14,8 @@
// 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 './bars/bars.dart';
export './app_bar_component.dart';
export './bottom_navigation_bar_component.dart';
export './buttons/buttons.dart';
export './cards/cards.dart';
export './component.dart';
@ -25,3 +26,4 @@ export './loading_widget_component.dart';
export './rich_text_builder/rich_text_builder.dart';
export './text_inputs/text_inputs.dart';
export './theme_style.dart';
export './top_navigation_bar_component.dart';

View File

@ -15,42 +15,24 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
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/src/domain/entities/bars/top_bar_component.dart';
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
import 'package:wyatt_ui_components/src/core/mixins/copy_with_mixin.dart';
import 'package:wyatt_ui_components/src/domain/entities/component.dart';
part 'top_navigation_bar_component.g.dart';
@ComponentProxyExtension()
abstract class TopNavigationBarComponent extends TopBarComponent
abstract class TopNavigationBarComponent extends Component
with CopyWithMixin<$TopNavigationBarComponentCWProxy> {
const TopNavigationBarComponent({
this.navigationItems,
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 List<TextWrapper>? navigationItems;
final int currentIndex;
final void Function(BuildContext, int)? onTap;
final Widget? leading;
final List<Widget>? actions;
}

View File

@ -0,0 +1,22 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'top_navigation_bar_component.dart';
// **************************************************************************
// ComponentProxyGenerator
// **************************************************************************
abstract class $TopNavigationBarComponentCWProxy {
TopNavigationBarComponent leading(Widget? leading);
TopNavigationBarComponent actions(List<Widget>? actions);
TopNavigationBarComponent onTap(void Function(BuildContext, int)? onTap);
TopNavigationBarComponent currentIndex(int? currentIndex);
TopNavigationBarComponent key(Key? key);
TopNavigationBarComponent call({
Widget? leading,
List<Widget>? actions,
void Function(BuildContext, int)? onTap,
int? currentIndex,
Key? key,
});
}

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

View File

@ -61,28 +61,6 @@ class Bars extends DemoPage {
)
],
),
const Gap(20),
TopNavigationBar(
leading: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Image.asset('assets/images/studio_long_logo.png'),
),
actions: [
Padding(
padding:
const EdgeInsets.symmetric(horizontal: 20, vertical: 25),
child: FlatButton(
label: 'Estimer mon projet'.wrap(),
),
),
],
navigationItems: [
'ACCEUIL'.wrap(),
'VOTRE PROGRAMME'.wrap(),
'LE STUDIO'.wrap(),
'SAVOIR FAIRE'.wrap()
].whereType<TextWrapper>().toList(),
),
],
);

View File

@ -25,7 +25,7 @@ import 'package:wyatt_ui_kit_example/theme/rich_text_builder_theme.dart';
import 'package:wyatt_ui_kit_example/theme/simple_icon_button_theme.dart';
import 'package:wyatt_ui_kit_example/theme/symbol_button_theme.dart';
import 'package:wyatt_ui_kit_example/theme/text_input_theme.dart';
import 'package:wyatt_ui_kit_example/theme/top_bar_theme.dart';
import 'package:wyatt_ui_kit_example/theme/top_app_bar_theme.dart';
/// Easely switch between Material and Studio themes.
abstract class Themes {

View File

@ -3,31 +3,24 @@ import 'package:google_fonts/google_fonts.dart';
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
import 'package:wyatt_ui_kit/wyatt_ui_kit.dart';
class TopAppBarTheme extends TopBarThemeExtension {
class TopAppBarTheme extends TopAppBarThemeExtension {
const TopAppBarTheme({
super.iconTheme,
super.backgroundColors,
super.secondaryColor,
super.expandedDividerStyle,
super.titleStyle,
super.subTitleStyle,
});
factory TopAppBarTheme.light() => TopAppBarTheme(
backgroundColors: const MultiColor.single(
Color.fromRGBO(246, 246, 246, 1),
),
secondaryColor: const Color.fromRGBO(36, 38, 42, 1),
expandedDividerStyle: Colors.black.withOpacity(0.1),
titleStyle: GoogleFonts.montserrat(
fontWeight: FontWeight.bold,
color: const Color.fromRGBO(36, 38, 42, 1),
fontSize: 18,
),
subTitleStyle: GoogleFonts.montserrat(
fontWeight: FontWeight.w400,
color: const Color.fromRGBO(36, 38, 42, 1),
fontSize: 18,
),
iconTheme: const IconThemeData(color: Color.fromRGBO(36, 38, 42, 1)),
iconTheme: const IconThemeData(color: Colors.black),
);
factory TopAppBarTheme.dark() => TopAppBarTheme(
@ -36,35 +29,31 @@ class TopAppBarTheme extends TopBarThemeExtension {
Color.fromRGBO(39, 47, 61, 1),
Color.fromRGBO(44, 50, 56, 1),
]),
secondaryColor: Colors.white,
expandedDividerStyle: Colors.white.withOpacity(0.1),
titleStyle: GoogleFonts.montserrat(
fontWeight: FontWeight.bold,
fontSize: 18,
),
subTitleStyle: GoogleFonts.montserrat(
fontWeight: FontWeight.w400,
fontSize: 18,
),
iconTheme: const IconThemeData(color: Colors.white),
);
@override
ThemeExtension<TopBarThemeExtension> copyWith({
ThemeExtension<TopAppBarThemeExtension> copyWith({
IconThemeData? iconTheme,
MultiColor? backgroundColors,
Color? secondaryColor,
Color? expandedDividerStyle,
TextStyle? titleStyle,
}) =>
TopAppBarTheme(
iconTheme: iconTheme ?? this.iconTheme,
backgroundColors: backgroundColors ?? this.backgroundColors,
secondaryColor: secondaryColor ?? this.secondaryColor,
expandedDividerStyle: expandedDividerStyle ?? this.expandedDividerStyle,
titleStyle: titleStyle ?? this.titleStyle,
);
@override
ThemeExtension<TopBarThemeExtension> lerp(
covariant ThemeExtension<TopBarThemeExtension>? other,
ThemeExtension<TopAppBarThemeExtension> lerp(
covariant ThemeExtension<TopAppBarThemeExtension>? other,
double t,
) {
if (other is! TopAppBarTheme) {
@ -74,7 +63,8 @@ class TopAppBarTheme extends TopBarThemeExtension {
iconTheme: IconThemeData.lerp(iconTheme, other.iconTheme, t),
backgroundColors:
MultiColor.lerp(backgroundColors, other.backgroundColors, t),
secondaryColor: Color.lerp(secondaryColor, other.secondaryColor, t),
expandedDividerStyle:
Color.lerp(expandedDividerStyle, other.expandedDividerStyle, t),
titleStyle: TextStyle.lerp(titleStyle, other.titleStyle, t),
);
}

View File

@ -14,5 +14,4 @@
// You should have received a copy of the GNU General Public License
// along with super program. If not, see <https://www.gnu.org/licenses/>.
export './top_app_bar.dart';
export './top_navigation_bar.dart';
export 'top_app_bar.dart';

View File

@ -22,10 +22,8 @@ import 'package:wyatt_ui_kit/wyatt_ui_kit.dart';
part 'top_app_bar.g.dart';
@ComponentCopyWithExtension()
class TopAppBar extends TopAppBarComponent with $TopAppBarCWMixin {
class TopAppBar extends AppBarComponent with $TopAppBarCWMixin {
const TopAppBar({
super.title,
super.centerTitle,
super.systemOverlayStyle,
super.automaticallyImplyLeading,
super.flexibleSpace,
@ -40,8 +38,10 @@ class TopAppBar extends TopAppBarComponent with $TopAppBarCWMixin {
super.excludeHeaderSemantics,
super.toolbarHeight,
super.leadingWidth,
super.title,
super.leading,
super.actions,
super.centerTitle,
super.shape,
super.expandedWidget,
super.key,
@ -53,7 +53,9 @@ class TopAppBar extends TopAppBarComponent with $TopAppBarCWMixin {
gradient: ThemeHelper.getThemeElement<MultiColor, Gradient>(
[
backgroundColor,
context.themeExtension<TopBarThemeExtension>()?.backgroundColors,
context
.themeExtension<TopAppBarThemeExtension>()
?.backgroundColors,
],
valueValidator: (value) => value?.isGradient,
transform: (value) =>
@ -63,7 +65,9 @@ class TopAppBar extends TopAppBarComponent with $TopAppBarCWMixin {
color: ThemeHelper.getThemeElement<MultiColor, Color>(
[
backgroundColor,
context.themeExtension<TopBarThemeExtension>()?.backgroundColors,
context
.themeExtension<TopAppBarThemeExtension>()
?.backgroundColors,
],
valueValidator: (value) => value?.isColor,
transform: (value) => value?.color,
@ -87,7 +91,7 @@ class TopAppBar extends TopAppBarComponent with $TopAppBarCWMixin {
ThemeHelper.getThemeElement<IconThemeData, IconThemeData>(
[
iconTheme,
context.themeExtension<TopBarThemeExtension>()?.iconTheme,
context.themeExtension<TopAppBarThemeExtension>()?.iconTheme,
],
valueValidator: (value) => value != null,
transform: (value) => value,
@ -101,7 +105,9 @@ class TopAppBar extends TopAppBarComponent with $TopAppBarCWMixin {
style: ThemeHelper.getThemeElement<TextStyle, TextStyle>(
[
title?.style,
context.themeExtension<TopBarThemeExtension>()?.titleStyle
context
.themeExtension<TopAppBarThemeExtension>()
?.titleStyle
],
valueValidator: (value) => value != null,
transform: (value) => value,
@ -117,9 +123,8 @@ class TopAppBar extends TopAppBarComponent with $TopAppBarCWMixin {
color: ThemeHelper.getThemeElement<Color, Color>(
[
context
.themeExtension<TopBarThemeExtension>()
?.secondaryColor
?.withOpacity(0.1),
.themeExtension<TopAppBarThemeExtension>()
?.expandedDividerStyle,
],
valueValidator: (value) => value != null,
transform: (value) => value,

View File

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

View File

@ -1,135 +0,0 @@
// Copyright (C) 2023 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
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';
import 'package:wyatt_ui_kit/src/components/bars/widgets/navigation_item.dart';
import 'package:wyatt_ui_kit/wyatt_ui_kit.dart';
part 'top_navigation_bar.g.dart';
@ComponentCopyWithExtension()
class TopNavigationBar extends TopNavigationBarComponent
with $TopNavigationBarCWMixin {
const TopNavigationBar({
super.navigationItems,
super.onTap,
super.currentIndex = 0,
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.shape,
super.expandedWidget,
super.key,
});
@override
Widget build(BuildContext context) => DecoratedBox(
decoration: BoxDecoration(
gradient: ThemeHelper.getThemeElement<MultiColor, Gradient>(
[
backgroundColor,
context.themeExtension<TopBarThemeExtension>()?.backgroundColors,
],
valueValidator: (value) => value?.isGradient,
transform: (value) =>
LinearGradientHelper.fromNullableColors(value?.colors),
defaultValue: null,
),
color: ThemeHelper.getThemeElement<MultiColor, Color>(
[
backgroundColor,
context.themeExtension<TopBarThemeExtension>()?.backgroundColors,
],
valueValidator: (value) => value?.isColor,
transform: (value) => value?.color,
defaultValue: Theme.of(context).appBarTheme.backgroundColor,
),
),
child: AppBar(
toolbarHeight: 100,
titleSpacing: 0,
backgroundColor: Colors.transparent,
systemOverlayStyle: systemOverlayStyle,
automaticallyImplyLeading: automaticallyImplyLeading ?? true,
flexibleSpace: flexibleSpace,
bottom: bottom,
elevation: elevation ?? 0,
scrolledUnderElevation: scrolledUnderElevation,
shadowColor: shadowColor,
surfaceTintColor: surfaceTintColor,
iconTheme: ThemeHelper.getThemeElement<IconThemeData, IconThemeData>(
[
iconTheme,
context.themeExtension<TopBarThemeExtension>()?.iconTheme,
],
valueValidator: (value) => value != null,
transform: (value) => value,
defaultValue: Theme.of(context).iconTheme,
),
primary: primary ?? true,
excludeHeaderSemantics: excludeHeaderSemantics ?? false,
leadingWidth: 200,
title: Row(
mainAxisSize: MainAxisSize.min,
children: navigationItems != null
? navigationItems!
.asMap()
.map<int, Widget>(
(key, value) => MapEntry(
key,
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: MouseRegion(
cursor: SystemMouseCursors.click,
child: GestureDetector(
onTap: () {
onTap?.call(context, key);
},
child: NavigationItem(
item: value,
selected: key == currentIndex,
),
),
),
),
),
)
.values
.toList()
: [],
),
leading: leading,
actions: actions,
centerTitle: true,
),
);
}

View File

@ -1,130 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'top_navigation_bar.dart';
// **************************************************************************
// ComponentCopyWithGenerator
// **************************************************************************
class $TopNavigationBarCWProxyImpl
implements $TopNavigationBarComponentCWProxy {
const $TopNavigationBarCWProxyImpl(this._value);
final TopNavigationBar _value;
@override
TopNavigationBar navigationItems(List<TextWrapper>? navigationItems) =>
this(navigationItems: navigationItems);
@override
TopNavigationBar onTap(void Function(BuildContext, int)? onTap) =>
this(onTap: onTap);
@override
TopNavigationBar currentIndex(int? currentIndex) =>
this(currentIndex: currentIndex);
@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);
@override
TopNavigationBar call({
List<TextWrapper>? navigationItems,
void Function(BuildContext, int)? onTap,
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,
}) =>
TopNavigationBar(
navigationItems: navigationItems ?? _value.navigationItems,
onTap: onTap ?? _value.onTap,
currentIndex: currentIndex ?? _value.currentIndex,
systemOverlayStyle: systemOverlayStyle ?? _value.systemOverlayStyle,
automaticallyImplyLeading:
automaticallyImplyLeading ?? _value.automaticallyImplyLeading,
flexibleSpace: flexibleSpace ?? _value.flexibleSpace,
bottom: bottom ?? _value.bottom,
elevation: elevation ?? _value.elevation,
scrolledUnderElevation:
scrolledUnderElevation ?? _value.scrolledUnderElevation,
shadowColor: shadowColor ?? _value.shadowColor,
surfaceTintColor: surfaceTintColor ?? _value.surfaceTintColor,
backgroundColor: backgroundColor ?? _value.backgroundColor,
iconTheme: iconTheme ?? _value.iconTheme,
primary: primary ?? _value.primary,
excludeHeaderSemantics:
excludeHeaderSemantics ?? _value.excludeHeaderSemantics,
toolbarHeight: toolbarHeight ?? _value.toolbarHeight,
leadingWidth: leadingWidth ?? _value.leadingWidth,
leading: leading ?? _value.leading,
actions: actions ?? _value.actions,
shape: shape ?? _value.shape,
expandedWidget: expandedWidget ?? _value.expandedWidget,
key: key ?? _value.key,
);
}
mixin $TopNavigationBarCWMixin on Component {
$TopNavigationBarComponentCWProxy get copyWith =>
$TopNavigationBarCWProxyImpl(this as TopNavigationBar);
}

View File

@ -1,73 +0,0 @@
// Copyright (C) 2023 WYATT GROUP
// Please see the AUTHORS file for details.
//
// super program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// super program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with super program. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/material.dart';
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
import 'package:wyatt_ui_kit/wyatt_ui_kit.dart';
class NavigationItem extends StatelessWidget {
const NavigationItem({
required this.item,
required this.selected,
super.key,
});
final TextWrapper item;
final bool selected;
@override
Widget build(BuildContext context) => Stack(
alignment: Alignment.bottomCenter,
children: [
if (selected)
Container(
height: 5,
width: 70,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
color: ThemeHelper.getThemeElement<Color, Color>(
[
context
.themeExtension<TopBarThemeExtension>()
?.secondaryColor
],
valueValidator: (value) => value != null,
transform: (value) => value,
defaultValue: Theme.of(context).primaryColor,
),
),
),
SizedBox(
height: 50,
child: Center(
child: Text(
item.data,
style: ThemeHelper.getThemeElement<TextStyle, TextStyle>(
[
item.style,
context
.themeExtension<TopBarThemeExtension>()
?.subTitleStyle
],
valueValidator: (value) => value != null,
transform: (value) => value,
defaultValue: context.textTheme.titleMedium,
),
),
),
),
],
);
}

View File

@ -14,10 +14,10 @@
// 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_bars/app_bars.dart';
export './buttons/buttons.dart';
export './cards/cards.dart';
export './gradients/gradients.dart';
export './loader/loader.dart';
export './rich_text_builder/rich_text_builder.dart';
export './text_inputs/text_input.dart';
export 'bars/bars.dart';

View File

@ -14,6 +14,22 @@
// 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 './bottom_navigation_bar_component.dart';
export './top_navigation_bar_component.dart';
export 'top_app_bar_component.dart';
import 'package:flutter/material.dart';
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
part 'top_navigation_bar.g.dart';
@ComponentCopyWithExtension()
class TopNavigationBar extends TopNavigationBarComponent
with $TopNavigationBarCWMixin {
const TopNavigationBar({
super.leading,
super.actions,
super.onTap,
super.currentIndex = 0,
super.key,
});
@override
Widget build(BuildContext context) => const Placeholder();
}

View File

@ -0,0 +1,45 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'top_navigation_bar.dart';
// **************************************************************************
// ComponentCopyWithGenerator
// **************************************************************************
class $TopNavigationBarCWProxyImpl
implements $TopNavigationBarComponentCWProxy {
const $TopNavigationBarCWProxyImpl(this._value);
final TopNavigationBar _value;
@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) =>
this(onTap: onTap);
@override
TopNavigationBar currentIndex(int? currentIndex) =>
this(currentIndex: currentIndex);
@override
TopNavigationBar key(Key? key) => this(key: key);
@override
TopNavigationBar call({
Widget? leading,
List<Widget>? actions,
void Function(BuildContext, int)? onTap,
int? currentIndex,
Key? key,
}) =>
TopNavigationBar(
leading: leading ?? _value.leading,
actions: actions ?? _value.actions,
onTap: onTap ?? _value.onTap,
currentIndex: currentIndex ?? _value.currentIndex,
key: key ?? _value.key,
);
}
mixin $TopNavigationBarCWMixin on Component {
$TopNavigationBarComponentCWProxy get copyWith =>
$TopNavigationBarCWProxyImpl(this as TopNavigationBar);
}

View File

@ -19,4 +19,4 @@ export './card_theme_extension.dart';
export './loader_theme_extension.dart';
export './rich_text_builder_theme_extension.dart';
export './text_input_theme_extension.dart';
export 'top_bar_theme_extension.dart';
export './top_app_bar_extension.dart';

View File

@ -17,20 +17,18 @@
import 'package:flutter/material.dart';
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
abstract class TopBarThemeExtension
extends ThemeExtension<TopBarThemeExtension> {
const TopBarThemeExtension({
abstract class TopAppBarThemeExtension
extends ThemeExtension<TopAppBarThemeExtension> {
const TopAppBarThemeExtension({
this.iconTheme,
this.backgroundColors,
this.secondaryColor,
this.expandedDividerStyle,
this.titleStyle,
this.subTitleStyle,
});
final MultiColor? backgroundColors;
final IconThemeData? iconTheme;
final Color? secondaryColor;
final Color? expandedDividerStyle;
final TextStyle? titleStyle;
final TextStyle? subTitleStyle;
}