From d6312271ec558f365197ec9ffb59dc6d55f83fc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malo=20L=C3=A9on?= Date: Thu, 23 Feb 2023 09:30:11 +0100 Subject: [PATCH] feat(ui_kit): export ui kit as component theme data --- .../bars/widgets/navigation_item.dart | 2 +- .../components/text_inputs/text_input.dart | 2 +- .../features/wyatt_component_theme_data.dart | 37 +++++++++++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 packages/wyatt_ui_kit/lib/src/features/wyatt_component_theme_data.dart diff --git a/packages/wyatt_ui_kit/lib/src/components/bars/widgets/navigation_item.dart b/packages/wyatt_ui_kit/lib/src/components/bars/widgets/navigation_item.dart index f5a4a2aa..9e1578e9 100644 --- a/packages/wyatt_ui_kit/lib/src/components/bars/widgets/navigation_item.dart +++ b/packages/wyatt_ui_kit/lib/src/components/bars/widgets/navigation_item.dart @@ -42,7 +42,7 @@ class NavigationItem extends StatelessWidget { context .themeExtension() ?.secondaryColor, - Theme.of(context).primaryColor, + context.colorScheme.primary ], valueValidator: (value) => value != null, transform: (value) => value, diff --git a/packages/wyatt_ui_kit/lib/src/components/text_inputs/text_input.dart b/packages/wyatt_ui_kit/lib/src/components/text_inputs/text_input.dart index 8e5139c7..e64b1b41 100644 --- a/packages/wyatt_ui_kit/lib/src/components/text_inputs/text_input.dart +++ b/packages/wyatt_ui_kit/lib/src/components/text_inputs/text_input.dart @@ -25,7 +25,7 @@ part 'text_input.g.dart'; @ComponentCopyWithExtension() class TextInput extends TextInputComponent with $TextInputCWMixin { - TextInput({ + const TextInput({ super.expand, super.validator, super.key, diff --git a/packages/wyatt_ui_kit/lib/src/features/wyatt_component_theme_data.dart b/packages/wyatt_ui_kit/lib/src/features/wyatt_component_theme_data.dart new file mode 100644 index 00000000..d6e44fe2 --- /dev/null +++ b/packages/wyatt_ui_kit/lib/src/features/wyatt_component_theme_data.dart @@ -0,0 +1,37 @@ +// 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:wyatt_ui_components/wyatt_wyatt_ui_components.dart'; +import 'package:wyatt_ui_kit/wyatt_ui_kit.dart'; + +class WyattComponentThemeData { + static ComponentThemeData get wyattComponentThemeData => + ComponentThemeData.raw( + appBar: const TopAppBar(), + topNavigationBarComponent: const TopNavigationBar(), + loaderComponent: const Loader(), + richTextBuilderComponent: const RichTextBuilder(), + textInputComponent: const TextInput(), + fileSelectionButtonComponent: FileSelectionButton(), + flatButtonComponent: FlatButton(), + simpleIconButtonComponent: SimpleIconButton(), + symbolButtonComponent: SymbolButton(), + informationCardComponent: const InformationCard(), + portfolioCardComponent: const PortfolioCard(), + quoteCardComponent: const QuoteCard(), + skillCardComponent: const SkillCard(), + ); +}