From b2d97623b7ef5c236b5b7843c6cb8524a9c9871c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malo=20L=C3=A9on?= Date: Mon, 28 Aug 2023 17:18:40 +0200 Subject: [PATCH] fix(ui_components): rollback private fileds in component theme data --- .../src/features/component_theme_data.dart | 166 ++++++++---------- 1 file changed, 75 insertions(+), 91 deletions(-) diff --git a/packages/wyatt_ui_components/lib/src/features/component_theme_data.dart b/packages/wyatt_ui_components/lib/src/features/component_theme_data.dart index c085f226..fedbd98d 100644 --- a/packages/wyatt_ui_components/lib/src/features/component_theme_data.dart +++ b/packages/wyatt_ui_components/lib/src/features/component_theme_data.dart @@ -68,23 +68,23 @@ class ComponentThemeData { // /// {@macro component_theme_data} factory ComponentThemeData.fromOther(ComponentThemeData other) => ComponentThemeData( - topAppBars: other._topAppBars, - topNavigationBars: other._topNavigationBars, - bottomNavigationBars: other._bottomNavigationBars, - errors: other._errors, - loaders: other._loaders, - richTextBuilders: other._richTextBuilders, - textInputs: other._textInputs, - fileSelectionButtons: other._fileSelectionButtons, - flatButtons: other._flatButtons, - simpleIconButtons: other._simpleIconButtons, - symbolButtons: other._symbolButtons, - informationCards: other._informationCards, - portfolioCards: other._portfolioCards, - quoteCards: other._quoteCards, - skillCards: other._skillCards, - pricingCards: other._pricingCards, - floatingActionButtons: other._floatingActionButtons, + topAppBars: other.topAppBars, + topNavigationBars: other.topNavigationBars, + bottomNavigationBars: other.bottomNavigationBars, + errors: other.errors, + loaders: other.loaders, + richTextBuilders: other.richTextBuilders, + textInputs: other.textInputs, + fileSelectionButtons: other.fileSelectionButtons, + flatButtons: other.flatButtons, + simpleIconButtons: other.simpleIconButtons, + symbolButtons: other.symbolButtons, + informationCards: other.informationCards, + portfolioCards: other.portfolioCards, + quoteCards: other.quoteCards, + skillCards: other.skillCards, + pricingCards: other.pricingCards, + floatingActionButtons: other.floatingActionButtons, ); /// Create a [ComponentThemeData] given a set of exact values. Most values @@ -94,40 +94,24 @@ class ComponentThemeData { /// create intermediate themes based on two themes created with the /// [ComponentThemeData] constructor. const ComponentThemeData.raw({ - ComponentRegistry? topAppBars, - ComponentRegistry? topNavigationBars, - ComponentRegistry? bottomNavigationBars, - ComponentRegistry? errors, - ComponentRegistry? loaders, - ComponentRegistry? richTextBuilders, - ComponentRegistry? textInputs, - ComponentRegistry? fileSelectionButtons, - ComponentRegistry? flatButtons, - ComponentRegistry? simpleIconButtons, - ComponentRegistry? symbolButtons, - ComponentRegistry? informationCards, - ComponentRegistry? portfolioCards, - ComponentRegistry? quoteCards, - ComponentRegistry? skillCards, - ComponentRegistry? pricingCards, - ComponentRegistry? floatingActionButtons, - }) : _floatingActionButtons = floatingActionButtons, - _symbolButtons = symbolButtons, - _simpleIconButtons = simpleIconButtons, - _flatButtons = flatButtons, - _fileSelectionButtons = fileSelectionButtons, - _textInputs = textInputs, - _richTextBuilders = richTextBuilders, - _pricingCards = pricingCards, - _skillCards = skillCards, - _quoteCards = quoteCards, - _portfolioCards = portfolioCards, - _informationCards = informationCards, - _loaders = loaders, - _errors = errors, - _bottomNavigationBars = bottomNavigationBars, - _topNavigationBars = topNavigationBars, - _topAppBars = topAppBars; + this.topAppBars, + this.topNavigationBars, + this.bottomNavigationBars, + this.errors, + this.loaders, + this.richTextBuilders, + this.textInputs, + this.fileSelectionButtons, + this.flatButtons, + this.simpleIconButtons, + this.symbolButtons, + this.informationCards, + this.portfolioCards, + this.quoteCards, + this.skillCards, + this.pricingCards, + this.floatingActionButtons, + }); R _get(T? component, R? returned) { if (component == null) { @@ -145,97 +129,97 @@ class ComponentThemeData { } // Bars - final ComponentRegistry? _topAppBars; + final ComponentRegistry? topAppBars; $TopAppBarComponentCWProxy topAppBarComponent([String? id]) => - _get(_topAppBars?.call(id), _topAppBars?.call(id)?.copyWith); + _get(topAppBars?.call(id), topAppBars?.call(id)?.copyWith); - final ComponentRegistry? _topNavigationBars; + final ComponentRegistry? topNavigationBars; $TopNavigationBarComponentCWProxy topNavigationBarComponent([String? id]) => _get( - _topNavigationBars?.call(id), - _topNavigationBars?.call(id)?.copyWith, + topNavigationBars?.call(id), + topNavigationBars?.call(id)?.copyWith, ); - final ComponentRegistry? _bottomNavigationBars; + final ComponentRegistry? bottomNavigationBars; $BottomNavigationBarComponentCWProxy bottomNavigationBarComponent([ String? id, ]) => _get( - _bottomNavigationBars?.call(id), - _bottomNavigationBars?.call(id)?.copyWith, + bottomNavigationBars?.call(id), + bottomNavigationBars?.call(id)?.copyWith, ); // CRUD Widgets - final ComponentRegistry? _errors; + final ComponentRegistry? errors; $ErrorComponentCWProxy errorComponent([String? id]) => - _get(_errors?.call(id), _errors?.call(id)?.copyWith); + _get(errors?.call(id), errors?.call(id)?.copyWith); - final ComponentRegistry? _loaders; + final ComponentRegistry? loaders; $LoaderComponentCWProxy loaderComponent([String? id]) => - _get(_loaders?.call(id), _loaders?.call(id)?.copyWith); + _get(loaders?.call(id), loaders?.call(id)?.copyWith); // Cards - final ComponentRegistry? _informationCards; + final ComponentRegistry? informationCards; $InformationCardComponentCWProxy informationCardComponent([String? id]) => - _get(_informationCards?.call(id), _informationCards?.call(id)?.copyWith); + _get(informationCards?.call(id), informationCards?.call(id)?.copyWith); - final ComponentRegistry? _portfolioCards; + final ComponentRegistry? portfolioCards; $PortfolioCardComponentCWProxy portfolioCardComponent([String? id]) => - _get(_portfolioCards?.call(id), _portfolioCards?.call(id)?.copyWith); + _get(portfolioCards?.call(id), portfolioCards?.call(id)?.copyWith); - final ComponentRegistry? _quoteCards; + final ComponentRegistry? quoteCards; $QuoteCardComponentCWProxy quoteCardComponent([String? id]) => - _get(_quoteCards?.call(id), _quoteCards?.call(id)?.copyWith); + _get(quoteCards?.call(id), quoteCards?.call(id)?.copyWith); - final ComponentRegistry? _skillCards; + final ComponentRegistry? skillCards; $SkillCardComponentCWProxy skillCardComponent([String? id]) => - _get(_skillCards?.call(id), _skillCards?.call(id)?.copyWith); - final ComponentRegistry? _pricingCards; + _get(skillCards?.call(id), skillCards?.call(id)?.copyWith); + + final ComponentRegistry? pricingCards; $PricingCardComponentCWProxy pricingCardComponent([String? id]) => - _get(_pricingCards?.call(id), _pricingCards?.call(id)?.copyWith); + _get(pricingCards?.call(id), pricingCards?.call(id)?.copyWith); // Rich Text - final ComponentRegistry? _richTextBuilders; + final ComponentRegistry? richTextBuilders; $RichTextBuilderComponentCWProxy richTextBuilderComponent([String? id]) => - _get(_richTextBuilders?.call(id), _richTextBuilders?.call(id)?.copyWith); + _get(richTextBuilders?.call(id), richTextBuilders?.call(id)?.copyWith); // Text Inputs - final ComponentRegistry? _textInputs; + final ComponentRegistry? textInputs; $TextInputComponentCWProxy textInputComponent([String? id]) => - _get(_textInputs?.call(id), _textInputs?.call(id)?.copyWith); + _get(textInputs?.call(id), textInputs?.call(id)?.copyWith); // Buttons - final ComponentRegistry? _fileSelectionButtons; + final ComponentRegistry? fileSelectionButtons; $FileSelectionButtonComponentCWProxy fileSelectionButtonComponent([ String? id, ]) => _get( - _fileSelectionButtons?.call(id), - _fileSelectionButtons?.call(id)?.copyWith, + fileSelectionButtons?.call(id), + fileSelectionButtons?.call(id)?.copyWith, ); - final ComponentRegistry? _flatButtons; + final ComponentRegistry? flatButtons; $FlatButtonComponentCWProxy flatButtonComponent([String? id]) => - _get(_flatButtons?.call(id), _flatButtons?.call(id)?.copyWith); + _get(flatButtons?.call(id), flatButtons?.call(id)?.copyWith); - final ComponentRegistry? _simpleIconButtons; + final ComponentRegistry? simpleIconButtons; $SimpleIconButtonComponentCWProxy simpleIconButtonComponent([String? id]) => _get( - _simpleIconButtons?.call(id), - _simpleIconButtons?.call(id)?.copyWith, + simpleIconButtons?.call(id), + simpleIconButtons?.call(id)?.copyWith, ); - final ComponentRegistry? _symbolButtons; + final ComponentRegistry? symbolButtons; $SymbolButtonComponentCWProxy symbolButtonComponent([String? id]) => - _get(_symbolButtons?.call(id), _symbolButtons?.call(id)?.copyWith); + _get(symbolButtons?.call(id), symbolButtons?.call(id)?.copyWith); - final ComponentRegistry? - _floatingActionButtons; + final ComponentRegistry? floatingActionButtons; $FloatingActionButtonComponentCWProxy floatingActionButtonComponent([ String? id, ]) => _get( - _floatingActionButtons?.call(id), - _floatingActionButtons?.call(id)?.copyWith, + floatingActionButtons?.call(id), + floatingActionButtons?.call(id)?.copyWith, ); } -- 2.47.2