From 8064c953e36589c42be2e79e8590eb8f307784bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malo=20L=C3=A9on?= Date: Wed, 22 Feb 2023 11:23:08 +0100 Subject: [PATCH] feat(ui_components): add Top Navigation Bar Component --- .../top_navigation_bar_component.dart | 38 +++++++++++++++++++ .../top_navigation_bar_component.g.dart | 22 +++++++++++ 2 files changed, 60 insertions(+) create mode 100644 packages/wyatt_ui_components/lib/src/domain/entities/top_navigation_bar_component.dart create mode 100644 packages/wyatt_ui_components/lib/src/domain/entities/top_navigation_bar_component.g.dart diff --git a/packages/wyatt_ui_components/lib/src/domain/entities/top_navigation_bar_component.dart b/packages/wyatt_ui_components/lib/src/domain/entities/top_navigation_bar_component.dart new file mode 100644 index 00000000..cb23bf07 --- /dev/null +++ b/packages/wyatt_ui_components/lib/src/domain/entities/top_navigation_bar_component.dart @@ -0,0 +1,38 @@ +// 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 . + +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'; + +part 'top_navigation_bar_component.g.dart'; + +@ComponentProxyExtension() +abstract class TopNavigationBarComponent extends Component + with CopyWithMixin<$TopNavigationBarComponentCWProxy> { + const TopNavigationBarComponent({ + this.leading, + this.actions, + this.onTap, + this.currentIndex = 0, + super.key, + }); + final int currentIndex; + final void Function(BuildContext, int)? onTap; + final Widget? leading; + final List? actions; +} diff --git a/packages/wyatt_ui_components/lib/src/domain/entities/top_navigation_bar_component.g.dart b/packages/wyatt_ui_components/lib/src/domain/entities/top_navigation_bar_component.g.dart new file mode 100644 index 00000000..591c9a6e --- /dev/null +++ b/packages/wyatt_ui_components/lib/src/domain/entities/top_navigation_bar_component.g.dart @@ -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? actions); + TopNavigationBarComponent onTap(void Function(BuildContext, int)? onTap); + TopNavigationBarComponent currentIndex(int? currentIndex); + TopNavigationBarComponent key(Key? key); + TopNavigationBarComponent call({ + Widget? leading, + List? actions, + void Function(BuildContext, int)? onTap, + int? currentIndex, + Key? key, + }); +}