feat(ui): add colors and rework ComponentThemeData
continuous-integration/drone/pr Build is failing

This commit is contained in:
2023-04-28 14:04:55 +02:00
parent a024b7e70a
commit abd5e1b558
28 changed files with 650 additions and 387 deletions
@@ -2,13 +2,13 @@ import 'package:wyatt_ui_components/wyatt_ui_components.dart';
import 'package:wyatt_ui_components_example/components/custom_app_bar.dart';
import 'package:wyatt_ui_components_example/components/custom_bottom_bar.dart';
import 'package:wyatt_ui_components_example/components/custom_error_widget.dart';
import 'package:wyatt_ui_components_example/components/custom_loading_widget.dart';
import 'package:wyatt_ui_components_example/components/custom_loader_widget.dart';
class AppThemeComponent {
static ComponentThemeData get components => const ComponentThemeData.raw(
appBar: CustomAppBar(),
topAppBar: CustomAppBar(),
bottomNavigationBar: CustomBottomNavigationBar(),
errorWidget: CustomErrorWidget(),
loadingWidget: CustomLoadingWidget(),
error: CustomErrorWidget(),
loader: CustomLoaderWidget(),
);
}
@@ -5,13 +5,17 @@ import 'package:wyatt_ui_components/wyatt_ui_components.dart';
part 'custom_error_widget.g.dart';
@ComponentCopyWithExtension()
class CustomErrorWidget extends ErrorWidgetComponent
with $CustomErrorWidgetCWMixin {
const CustomErrorWidget({super.error, super.key});
class CustomErrorWidget extends ErrorComponent with $CustomErrorWidgetCWMixin {
const CustomErrorWidget({
super.colors,
super.message,
super.details,
super.key,
});
@override
Widget build(BuildContext context) => ColoredBox(
color: Colors.red,
child: Center(child: Text(error?.data ?? 'Error')),
color: colors?.color ?? Colors.red,
child: Center(child: Text(message?.data ?? 'Error')),
);
}
@@ -6,25 +6,38 @@ part of 'custom_error_widget.dart';
// ComponentCopyWithGenerator
// **************************************************************************
class $CustomErrorWidgetCWProxyImpl implements $ErrorWidgetComponentCWProxy {
class $CustomErrorWidgetCWProxyImpl implements $ErrorComponentCWProxy {
const $CustomErrorWidgetCWProxyImpl(this._value);
final CustomErrorWidget _value;
@override
CustomErrorWidget error(TextWrapper? error) => this(error: error);
CustomErrorWidget colors(MultiColor? colors) => this(colors: colors);
@override
CustomErrorWidget message(TextWrapper? message) => this(message: message);
@override
CustomErrorWidget details(TextWrapper? details) => this(details: details);
@override
CustomErrorWidget themeResolver(
ThemeResolver<dynamic, dynamic, dynamic>? themeResolver) =>
this(themeResolver: themeResolver);
@override
CustomErrorWidget key(Key? key) => this(key: key);
@override
CustomErrorWidget call({
TextWrapper? error,
MultiColor? colors,
TextWrapper? message,
TextWrapper? details,
ThemeResolver<dynamic, dynamic, dynamic>? themeResolver,
Key? key,
}) =>
CustomErrorWidget(
error: error ?? _value.error,
colors: colors ?? _value.colors,
message: message ?? _value.message,
details: details ?? _value.details,
key: key ?? _value.key,
);
}
mixin $CustomErrorWidgetCWMixin on Component {
$ErrorWidgetComponentCWProxy get copyWith =>
$ErrorComponentCWProxy get copyWith =>
$CustomErrorWidgetCWProxyImpl(this as CustomErrorWidget);
}
@@ -2,17 +2,24 @@ import 'package:flutter/material.dart';
import 'package:wyatt_component_copy_with_extension/wyatt_component_copy_with_extension.dart';
import 'package:wyatt_ui_components/wyatt_ui_components.dart';
part 'custom_loading_widget.g.dart';
part 'custom_loader_widget.g.dart';
@ComponentCopyWithExtension()
class CustomLoadingWidget extends LoadingWidgetComponent
with $CustomLoadingWidgetCWMixin {
const CustomLoadingWidget({super.color, super.key});
class CustomLoaderWidget extends LoaderComponent
with $CustomLoaderWidgetCWMixin {
const CustomLoaderWidget({
super.colors,
super.duration,
super.flip,
super.radius,
super.stroke,
super.key,
});
@override
Widget build(BuildContext context) => Center(
child: CircularProgressIndicator(
color: color,
color: colors?.color ?? Colors.blue,
),
);
}
@@ -0,0 +1,51 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'custom_loader_widget.dart';
// **************************************************************************
// ComponentCopyWithGenerator
// **************************************************************************
class $CustomLoaderWidgetCWProxyImpl implements $LoaderComponentCWProxy {
const $CustomLoaderWidgetCWProxyImpl(this._value);
final CustomLoaderWidget _value;
@override
CustomLoaderWidget colors(MultiColor? colors) => this(colors: colors);
@override
CustomLoaderWidget radius(double? radius) => this(radius: radius);
@override
CustomLoaderWidget stroke(double? stroke) => this(stroke: stroke);
@override
CustomLoaderWidget duration(Duration? duration) => this(duration: duration);
@override
CustomLoaderWidget flip(bool? flip) => this(flip: flip);
@override
CustomLoaderWidget themeResolver(
ThemeResolver<dynamic, dynamic, dynamic>? themeResolver) =>
this(themeResolver: themeResolver);
@override
CustomLoaderWidget key(Key? key) => this(key: key);
@override
CustomLoaderWidget call({
MultiColor? colors,
double? radius,
double? stroke,
Duration? duration,
bool? flip,
ThemeResolver<dynamic, dynamic, dynamic>? themeResolver,
Key? key,
}) =>
CustomLoaderWidget(
colors: colors ?? _value.colors,
duration: duration ?? _value.duration,
flip: flip ?? _value.flip,
radius: radius ?? _value.radius,
stroke: stroke ?? _value.stroke,
key: key ?? _value.key,
);
}
mixin $CustomLoaderWidgetCWMixin on Component {
$LoaderComponentCWProxy get copyWith =>
$CustomLoaderWidgetCWProxyImpl(this as CustomLoaderWidget);
}
@@ -1,31 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'custom_loading_widget.dart';
// **************************************************************************
// ComponentCopyWithGenerator
// **************************************************************************
class $CustomLoadingWidgetCWProxyImpl
implements $LoadingWidgetComponentCWProxy {
const $CustomLoadingWidgetCWProxyImpl(this._value);
final CustomLoadingWidget _value;
@override
CustomLoadingWidget color(Color? color) => this(color: color);
@override
CustomLoadingWidget key(Key? key) => this(key: key);
@override
CustomLoadingWidget call({
Color? color,
Key? key,
}) =>
CustomLoadingWidget(
color: color ?? _value.color,
key: key ?? _value.key,
);
}
mixin $CustomLoadingWidgetCWMixin on Component {
$LoadingWidgetComponentCWProxy get copyWith =>
$CustomLoadingWidgetCWProxyImpl(this as CustomLoadingWidget);
}
@@ -48,24 +48,23 @@ class Home extends StatelessWidget {
Widget build(BuildContext context) => Scaffold(
appBar: PreferredSize(
preferredSize: const Size.fromHeight(60),
child: context.components.appBar?.copyWith
.title(const TextWrapper('Example title')) ??
const SizedBox.shrink(),
child: context.components.topAppBarComponent
.title(const TextWrapper('Example title')),
),
body: Column(
children: [
Expanded(
child: context.components.errorWidget
?.copyWith(error: const TextWrapper('Example erreur')) ??
const SizedBox.shrink(),
child: context.components.errorComponent.call(
message: const TextWrapper('Example error'),
),
),
const SizedBox(
height: 10,
),
Expanded(
child: context.components.loadingWidget
?.copyWith(color: Colors.green) ??
const SizedBox.shrink(),
child: context.components.loaderComponent.call(
colors: const MultiColor.single(Colors.green),
),
),
],
),
@@ -22,7 +22,7 @@ import 'package:wyatt_ui_components/src/domain/entities/buttons/button_style.dar
/// {@template file_selection_button_style}
/// File selection button style.
///
///
/// This style is used for the FileSelectionButton widget.
/// {@endtemplate}
class FileSelectionButtonStyle extends ButtonStyle<FileSelectionButtonStyle> {
@@ -22,7 +22,7 @@ import 'package:wyatt_ui_components/src/domain/entities/buttons/button_style.dar
/// {@template flat_button_style}
/// Flat button style.
///
///
/// This style is used for the FlatButton widget.
/// {@endtemplate}
class FlatButtonStyle extends ButtonStyle<FlatButtonStyle> {
@@ -22,7 +22,7 @@ import 'package:wyatt_ui_components/src/domain/entities/buttons/button_style.dar
/// {@template simple_icon_button_style}
/// Simple icon button style.
///
///
/// This style is used for the SimpleIconButton widget.
/// {@endtemplate}
class SimpleIconButtonStyle extends ButtonStyle<SimpleIconButtonStyle> {
@@ -22,7 +22,7 @@ import 'package:wyatt_ui_components/src/domain/entities/buttons/button_style.dar
/// {@template symbol_button_style}
/// Symbol button style.
///
///
/// This style is used for the SymbolButton widget.
/// {@endtemplate}
class SymbolButtonStyle extends ButtonStyle<SymbolButtonStyle> {
@@ -18,10 +18,9 @@ export './bars/bars.dart';
export './buttons/buttons.dart';
export './cards/cards.dart';
export './component.dart';
export './error_widget_component.dart';
export './error/error.dart';
export './gradients/gradients.dart';
export './loader/loader.dart';
export './loading_widget_component.dart';
export './rich_text_builder/rich_text_builder.dart';
export './text_inputs/text_inputs.dart';
export './theme_style.dart';
@@ -14,16 +14,4 @@
// 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:wyatt_component_copy_with_extension/wyatt_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 'loading_widget_component.g.dart';
@ComponentProxyExtension()
abstract class LoadingWidgetComponent extends Component
with CopyWithMixin<$LoadingWidgetComponentCWProxy> {
const LoadingWidgetComponent({required this.color, super.key});
final Color? color;
}
export './error_component.dart';
@@ -14,15 +14,29 @@
// 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/widgets.dart';
import 'package:wyatt_component_copy_with_extension/wyatt_component_copy_with_extension.dart';
import 'package:wyatt_ui_components/wyatt_ui_components.dart';
part 'error_widget_component.g.dart';
part 'error_component.g.dart';
@ComponentProxyExtension()
abstract class ErrorWidgetComponent extends Component
with CopyWithMixin<$ErrorWidgetComponentCWProxy> {
const ErrorWidgetComponent({required this.error, super.key});
final TextWrapper? error;
abstract class ErrorComponent extends Component
with CopyWithMixin<$ErrorComponentCWProxy> {
const ErrorComponent({
this.colors,
this.message,
this.details,
super.themeResolver,
super.key,
});
/// Error message
final TextWrapper? message;
/// Details for the error component
final TextWrapper? details;
/// Colors for the error component
final MultiColor? colors;
}
@@ -0,0 +1,23 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'error_component.dart';
// **************************************************************************
// ComponentProxyGenerator
// **************************************************************************
abstract class $ErrorComponentCWProxy {
ErrorComponent colors(MultiColor? colors);
ErrorComponent message(TextWrapper? message);
ErrorComponent details(TextWrapper? details);
ErrorComponent themeResolver(
ThemeResolver<dynamic, dynamic, dynamic>? themeResolver);
ErrorComponent key(Key? key);
ErrorComponent call({
MultiColor? colors,
TextWrapper? message,
TextWrapper? details,
ThemeResolver<dynamic, dynamic, dynamic>? themeResolver,
Key? key,
});
}
@@ -1,16 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'error_widget_component.dart';
// **************************************************************************
// ComponentProxyGenerator
// **************************************************************************
abstract class $ErrorWidgetComponentCWProxy {
ErrorWidgetComponent error(TextWrapper? error);
ErrorWidgetComponent key(Key? key);
ErrorWidgetComponent call({
TextWrapper? error,
Key? key,
});
}
@@ -1,16 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'loading_widget_component.dart';
// **************************************************************************
// ComponentProxyGenerator
// **************************************************************************
abstract class $LoadingWidgetComponentCWProxy {
LoadingWidgetComponent color(Color? color);
LoadingWidgetComponent key(Key? key);
LoadingWidgetComponent call({
Color? color,
Key? key,
});
}
@@ -153,7 +153,7 @@ class RichTextNode {
/// Returns an InlineSpan from the given RichTextNode.
/// The given RichTextParser is used to convert the RichTextNode to an
/// InlineSpan.
///
///
/// InlineSpan is used to display text in the RichText widget.
InlineSpan toInlineSpan(RichTextParser parser) {
final children = <InlineSpan>[];
@@ -192,7 +192,7 @@ class RichTextParser {
/// Returns a default RichTextParser.
/// The default RichTextParser uses the given nodeBuilder to convert a
/// RichTextNode to an InlineSpan.
///
///
/// By default, the nodeBuilder returns a TextSpan with the given content
/// and style.
factory RichTextParser.defaultBuilder() => RichTextParser(
@@ -201,7 +201,7 @@ class RichTextParser {
style: style,
),
);
/// Converts the given RichTextNode to an InlineSpan.
final InlineSpan Function(String content, TextStyle style) nodeBuilder;
}
@@ -84,7 +84,10 @@ class TopBarThemeExtension extends ThemeExtension<TopBarThemeExtension> {
backgroundColors:
MultiColor.lerp(backgroundColors, other.backgroundColors, t),
selectedIndicatorColors: MultiColor.lerp(
selectedIndicatorColors, other.selectedIndicatorColors, t,),
selectedIndicatorColors,
other.selectedIndicatorColors,
t,
),
dividerColor: Color.lerp(dividerColor, other.dividerColor, t),
titleStyle: TextStyle.lerp(titleStyle, other.titleStyle, t),
subtitleStyle: TextStyle.lerp(subtitleStyle, other.subtitleStyle, t),
@@ -26,7 +26,6 @@ class ComponentTheme extends StatelessWidget {
const ComponentTheme({
required this.child,
required this.data,
this.themeExtensionProvider = const DefaultThemeExtensionProvider(),
super.key,
});
@@ -35,10 +34,6 @@ class ComponentTheme extends StatelessWidget {
/// This contains all components instances of the theme.
final ComponentThemeData data;
/// The [ThemeExtensionProvider] that provides the extensions for the
/// current theme.
final ThemeExtensionProvider themeExtensionProvider;
/// The widget below this widget in the tree.
final Widget child;
@@ -66,13 +61,9 @@ class ComponentTheme extends StatelessWidget {
}
@override
Widget build(BuildContext context) => Theme(
// Injections of the default extensions for the current brightness
data: themeExtensionProvider.applyExtensionsTo(Theme.of(context)),
child: _InheritedComponentTheme(
this,
child: child,
),
Widget build(BuildContext context) => _InheritedComponentTheme(
this,
child: child,
);
}
@@ -15,6 +15,7 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:flutter/material.dart';
import 'package:wyatt_ui_components/src/domain/entities/entities.dart';
part 'component_theme_data.g.dart';
@@ -23,82 +24,153 @@ part 'component_theme_data.g.dart';
/// {@endtemplate}
@CopyWith()
class ComponentThemeData {
/// {@macro component_theme_data}
factory ComponentThemeData({
TopAppBarComponent? appBar,
TopNavigationBarComponent? topNavigationBarComponent,
TopAppBarComponent? topAppBar,
TopNavigationBarComponent? topNavigationBar,
BottomNavigationBarComponent? bottomNavigationBar,
ErrorWidgetComponent? errorWidget,
LoadingWidgetComponent? loadingWidget,
LoaderComponent? loaderComponent,
RichTextBuilderComponent? richTextBuilderComponent,
TextInputComponent? textInputComponent,
FileSelectionButtonComponent? fileSelectionButtonComponent,
FlatButtonComponent? flatButtonComponent,
SimpleIconButtonComponent? simpleIconButtonComponent,
SymbolButtonComponent? symbolButtonComponent,
InformationCardComponent? informationCardComponent,
PortfolioCardComponent? portfolioCardComponent,
QuoteCardComponent? quoteCardComponent,
SkillCardComponent? skillCardComponent,
ErrorComponent? error,
LoaderComponent? loader,
RichTextBuilderComponent? richTextBuilder,
TextInputComponent? textInput,
FileSelectionButtonComponent? fileSelectionButton,
FlatButtonComponent? flatButton,
SimpleIconButtonComponent? simpleIconButton,
SymbolButtonComponent? symbolButton,
InformationCardComponent? informationCard,
PortfolioCardComponent? portfolioCard,
QuoteCardComponent? quoteCard,
SkillCardComponent? skillCard,
}) =>
ComponentThemeData.raw(
appBar: appBar,
topNavigationBarComponent: topNavigationBarComponent,
topAppBar: topAppBar,
topNavigationBar: topNavigationBar,
bottomNavigationBar: bottomNavigationBar,
errorWidget: errorWidget,
loadingWidget: loadingWidget,
loaderComponent: loaderComponent,
richTextBuilderComponent: richTextBuilderComponent,
textInputComponent: textInputComponent,
fileSelectionButtonComponent: fileSelectionButtonComponent,
flatButtonComponent: flatButtonComponent,
simpleIconButtonComponent: simpleIconButtonComponent,
symbolButtonComponent: symbolButtonComponent,
informationCardComponent: informationCardComponent,
portfolioCardComponent: portfolioCardComponent,
quoteCardComponent: quoteCardComponent,
skillCardComponent: skillCardComponent,
error: error,
loader: loader,
richTextBuilder: richTextBuilder,
textInput: textInput,
fileSelectionButton: fileSelectionButton,
flatButton: flatButton,
simpleIconButton: simpleIconButton,
symbolButton: symbolButton,
informationCard: informationCard,
portfolioCard: portfolioCard,
quoteCard: quoteCard,
skillCard: skillCard,
);
/// {@macro component_theme_data}
factory ComponentThemeData.fromOther(ComponentThemeData other) =>
ComponentThemeData(
topAppBar: other.topAppBar,
topNavigationBar: other.topNavigationBar,
bottomNavigationBar: other.bottomNavigationBar,
error: other.error,
loader: other.loader,
richTextBuilder: other.richTextBuilder,
textInput: other.textInput,
fileSelectionButton: other.fileSelectionButton,
flatButton: other.flatButton,
simpleIconButton: other.simpleIconButton,
symbolButton: other.symbolButton,
informationCard: other.informationCard,
portfolioCard: other.portfolioCard,
quoteCard: other.quoteCard,
skillCard: other.skillCard,
);
/// Create a [ComponentThemeData] given a set of exact values. Most values
/// must be specified.
///
/// This will rarely be used directly. It is used by lerp to
/// create intermediate themes based on two themes created with the
/// [ComponentThemeData] constructor.
const ComponentThemeData.raw({
this.appBar,
this.topNavigationBarComponent,
this.topAppBar,
this.topNavigationBar,
this.bottomNavigationBar,
this.errorWidget,
this.loadingWidget,
this.loaderComponent,
this.richTextBuilderComponent,
this.textInputComponent,
this.fileSelectionButtonComponent,
this.flatButtonComponent,
this.simpleIconButtonComponent,
this.symbolButtonComponent,
this.informationCardComponent,
this.portfolioCardComponent,
this.quoteCardComponent,
this.skillCardComponent,
this.error,
this.loader,
this.richTextBuilder,
this.textInput,
this.fileSelectionButton,
this.flatButton,
this.simpleIconButton,
this.symbolButton,
this.informationCard,
this.portfolioCard,
this.quoteCard,
this.skillCard,
});
final TopAppBarComponent? appBar;
R _get<T extends Component, R>(T? component, R? returned) {
if (component == null) {
throw FlutterError('No $T component provided.\n'
'Please provide a $T component in the ComponentThemeData.');
}
final TopNavigationBarComponent? topNavigationBarComponent;
if (returned == null) {
throw FlutterError('$T does not have a CopyWith method.\n'
'Please provide a $T component that implements CopyWith '
'in the ComponentThemeData.');
}
return returned;
}
// Bars
final TopAppBarComponent? topAppBar;
$TopAppBarComponentCWProxy get topAppBarComponent =>
_get(topAppBar, topAppBar?.copyWith);
final TopNavigationBarComponent? topNavigationBar;
$TopNavigationBarComponentCWProxy get topNavigationBarComponent =>
_get(topNavigationBar, topNavigationBar?.copyWith);
final BottomNavigationBarComponent? bottomNavigationBar;
final ErrorWidgetComponent? errorWidget;
final LoadingWidgetComponent? loadingWidget;
final LoaderComponent? loaderComponent;
$BottomNavigationBarComponentCWProxy get bottomNavigationBarComponent =>
_get(bottomNavigationBar, bottomNavigationBar?.copyWith);
final RichTextBuilderComponent? richTextBuilderComponent;
final TextInputComponent? textInputComponent;
// Buttons
final FileSelectionButtonComponent? fileSelectionButtonComponent;
final FlatButtonComponent? flatButtonComponent;
final SimpleIconButtonComponent? simpleIconButtonComponent;
final SymbolButtonComponent? symbolButtonComponent;
// CRUD Widgets
final ErrorComponent? error;
$ErrorComponentCWProxy get errorComponent => _get(error, error?.copyWith);
final LoaderComponent? loader;
$LoaderComponentCWProxy get loaderComponent => _get(loader, loader?.copyWith);
// Cards
final InformationCardComponent? informationCardComponent;
final PortfolioCardComponent? portfolioCardComponent;
final QuoteCardComponent? quoteCardComponent;
final SkillCardComponent? skillCardComponent;
final InformationCardComponent? informationCard;
$InformationCardComponentCWProxy get informationCardComponent =>
_get(informationCard, informationCard?.copyWith);
final PortfolioCardComponent? portfolioCard;
$PortfolioCardComponentCWProxy get portfolioCardComponent =>
_get(portfolioCard, portfolioCard?.copyWith);
final QuoteCardComponent? quoteCard;
$QuoteCardComponentCWProxy get quoteCardComponent =>
_get(quoteCard, quoteCard?.copyWith);
final SkillCardComponent? skillCard;
$SkillCardComponentCWProxy get skillCardComponent =>
_get(skillCard, skillCard?.copyWith);
// Rich Text
final RichTextBuilderComponent? richTextBuilder;
$RichTextBuilderComponentCWProxy get richTextBuilderComponent =>
_get(richTextBuilder, richTextBuilder?.copyWith);
// Text Inputs
final TextInputComponent? textInput;
$TextInputComponentCWProxy get textInputComponent =>
_get(textInput, textInput?.copyWith);
// Buttons
final FileSelectionButtonComponent? fileSelectionButton;
$FileSelectionButtonComponentCWProxy get fileSelectionButtonComponent =>
_get(fileSelectionButton, fileSelectionButton?.copyWith);
final FlatButtonComponent? flatButton;
$FlatButtonComponentCWProxy get flatButtonComponent =>
_get(flatButton, flatButton?.copyWith);
final SimpleIconButtonComponent? simpleIconButton;
$SimpleIconButtonComponentCWProxy get simpleIconButtonComponent =>
_get(simpleIconButton, simpleIconButton?.copyWith);
final SymbolButtonComponent? symbolButton;
$SymbolButtonComponentCWProxy get symbolButtonComponent =>
_get(symbolButton, symbolButton?.copyWith);
}
@@ -7,46 +7,39 @@ part of 'component_theme_data.dart';
// **************************************************************************
abstract class _$ComponentThemeDataCWProxy {
ComponentThemeData appBar(TopAppBarComponent? appBar);
ComponentThemeData topAppBar(TopAppBarComponent? topAppBar);
ComponentThemeData topNavigationBarComponent(
TopNavigationBarComponent? topNavigationBarComponent);
ComponentThemeData topNavigationBar(
TopNavigationBarComponent? topNavigationBar);
ComponentThemeData bottomNavigationBar(
BottomNavigationBarComponent? bottomNavigationBar);
ComponentThemeData errorWidget(ErrorWidgetComponent? errorWidget);
ComponentThemeData error(ErrorComponent? error);
ComponentThemeData loadingWidget(LoadingWidgetComponent? loadingWidget);
ComponentThemeData loader(LoaderComponent? loader);
ComponentThemeData loaderComponent(LoaderComponent? loaderComponent);
ComponentThemeData richTextBuilder(RichTextBuilderComponent? richTextBuilder);
ComponentThemeData richTextBuilderComponent(
RichTextBuilderComponent? richTextBuilderComponent);
ComponentThemeData textInput(TextInputComponent? textInput);
ComponentThemeData textInputComponent(TextInputComponent? textInputComponent);
ComponentThemeData fileSelectionButton(
FileSelectionButtonComponent? fileSelectionButton);
ComponentThemeData fileSelectionButtonComponent(
FileSelectionButtonComponent? fileSelectionButtonComponent);
ComponentThemeData flatButton(FlatButtonComponent? flatButton);
ComponentThemeData flatButtonComponent(
FlatButtonComponent? flatButtonComponent);
ComponentThemeData simpleIconButton(
SimpleIconButtonComponent? simpleIconButton);
ComponentThemeData simpleIconButtonComponent(
SimpleIconButtonComponent? simpleIconButtonComponent);
ComponentThemeData symbolButton(SymbolButtonComponent? symbolButton);
ComponentThemeData symbolButtonComponent(
SymbolButtonComponent? symbolButtonComponent);
ComponentThemeData informationCard(InformationCardComponent? informationCard);
ComponentThemeData informationCardComponent(
InformationCardComponent? informationCardComponent);
ComponentThemeData portfolioCard(PortfolioCardComponent? portfolioCard);
ComponentThemeData portfolioCardComponent(
PortfolioCardComponent? portfolioCardComponent);
ComponentThemeData quoteCard(QuoteCardComponent? quoteCard);
ComponentThemeData quoteCardComponent(QuoteCardComponent? quoteCardComponent);
ComponentThemeData skillCardComponent(SkillCardComponent? skillCardComponent);
ComponentThemeData skillCard(SkillCardComponent? skillCard);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ComponentThemeData(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
@@ -55,22 +48,21 @@ abstract class _$ComponentThemeDataCWProxy {
/// ComponentThemeData(...).copyWith(id: 12, name: "My name")
/// ````
ComponentThemeData call({
TopAppBarComponent? appBar,
TopNavigationBarComponent? topNavigationBarComponent,
TopAppBarComponent? topAppBar,
TopNavigationBarComponent? topNavigationBar,
BottomNavigationBarComponent? bottomNavigationBar,
ErrorWidgetComponent? errorWidget,
LoadingWidgetComponent? loadingWidget,
LoaderComponent? loaderComponent,
RichTextBuilderComponent? richTextBuilderComponent,
TextInputComponent? textInputComponent,
FileSelectionButtonComponent? fileSelectionButtonComponent,
FlatButtonComponent? flatButtonComponent,
SimpleIconButtonComponent? simpleIconButtonComponent,
SymbolButtonComponent? symbolButtonComponent,
InformationCardComponent? informationCardComponent,
PortfolioCardComponent? portfolioCardComponent,
QuoteCardComponent? quoteCardComponent,
SkillCardComponent? skillCardComponent,
ErrorComponent? error,
LoaderComponent? loader,
RichTextBuilderComponent? richTextBuilder,
TextInputComponent? textInput,
FileSelectionButtonComponent? fileSelectionButton,
FlatButtonComponent? flatButton,
SimpleIconButtonComponent? simpleIconButton,
SymbolButtonComponent? symbolButton,
InformationCardComponent? informationCard,
PortfolioCardComponent? portfolioCard,
QuoteCardComponent? quoteCard,
SkillCardComponent? skillCard,
});
}
@@ -81,12 +73,13 @@ class _$ComponentThemeDataCWProxyImpl implements _$ComponentThemeDataCWProxy {
final ComponentThemeData _value;
@override
ComponentThemeData appBar(TopAppBarComponent? appBar) => this(appBar: appBar);
ComponentThemeData topAppBar(TopAppBarComponent? topAppBar) =>
this(topAppBar: topAppBar);
@override
ComponentThemeData topNavigationBarComponent(
TopNavigationBarComponent? topNavigationBarComponent) =>
this(topNavigationBarComponent: topNavigationBarComponent);
ComponentThemeData topNavigationBar(
TopNavigationBarComponent? topNavigationBar) =>
this(topNavigationBar: topNavigationBar);
@override
ComponentThemeData bottomNavigationBar(
@@ -94,66 +87,54 @@ class _$ComponentThemeDataCWProxyImpl implements _$ComponentThemeDataCWProxy {
this(bottomNavigationBar: bottomNavigationBar);
@override
ComponentThemeData errorWidget(ErrorWidgetComponent? errorWidget) =>
this(errorWidget: errorWidget);
ComponentThemeData error(ErrorComponent? error) => this(error: error);
@override
ComponentThemeData loadingWidget(LoadingWidgetComponent? loadingWidget) =>
this(loadingWidget: loadingWidget);
ComponentThemeData loader(LoaderComponent? loader) => this(loader: loader);
@override
ComponentThemeData loaderComponent(LoaderComponent? loaderComponent) =>
this(loaderComponent: loaderComponent);
ComponentThemeData richTextBuilder(
RichTextBuilderComponent? richTextBuilder) =>
this(richTextBuilder: richTextBuilder);
@override
ComponentThemeData richTextBuilderComponent(
RichTextBuilderComponent? richTextBuilderComponent) =>
this(richTextBuilderComponent: richTextBuilderComponent);
ComponentThemeData textInput(TextInputComponent? textInput) =>
this(textInput: textInput);
@override
ComponentThemeData textInputComponent(
TextInputComponent? textInputComponent) =>
this(textInputComponent: textInputComponent);
ComponentThemeData fileSelectionButton(
FileSelectionButtonComponent? fileSelectionButton) =>
this(fileSelectionButton: fileSelectionButton);
@override
ComponentThemeData fileSelectionButtonComponent(
FileSelectionButtonComponent? fileSelectionButtonComponent) =>
this(fileSelectionButtonComponent: fileSelectionButtonComponent);
ComponentThemeData flatButton(FlatButtonComponent? flatButton) =>
this(flatButton: flatButton);
@override
ComponentThemeData flatButtonComponent(
FlatButtonComponent? flatButtonComponent) =>
this(flatButtonComponent: flatButtonComponent);
ComponentThemeData simpleIconButton(
SimpleIconButtonComponent? simpleIconButton) =>
this(simpleIconButton: simpleIconButton);
@override
ComponentThemeData simpleIconButtonComponent(
SimpleIconButtonComponent? simpleIconButtonComponent) =>
this(simpleIconButtonComponent: simpleIconButtonComponent);
ComponentThemeData symbolButton(SymbolButtonComponent? symbolButton) =>
this(symbolButton: symbolButton);
@override
ComponentThemeData symbolButtonComponent(
SymbolButtonComponent? symbolButtonComponent) =>
this(symbolButtonComponent: symbolButtonComponent);
ComponentThemeData informationCard(
InformationCardComponent? informationCard) =>
this(informationCard: informationCard);
@override
ComponentThemeData informationCardComponent(
InformationCardComponent? informationCardComponent) =>
this(informationCardComponent: informationCardComponent);
ComponentThemeData portfolioCard(PortfolioCardComponent? portfolioCard) =>
this(portfolioCard: portfolioCard);
@override
ComponentThemeData portfolioCardComponent(
PortfolioCardComponent? portfolioCardComponent) =>
this(portfolioCardComponent: portfolioCardComponent);
ComponentThemeData quoteCard(QuoteCardComponent? quoteCard) =>
this(quoteCard: quoteCard);
@override
ComponentThemeData quoteCardComponent(
QuoteCardComponent? quoteCardComponent) =>
this(quoteCardComponent: quoteCardComponent);
@override
ComponentThemeData skillCardComponent(
SkillCardComponent? skillCardComponent) =>
this(skillCardComponent: skillCardComponent);
ComponentThemeData skillCard(SkillCardComponent? skillCard) =>
this(skillCard: skillCard);
@override
@@ -164,95 +145,83 @@ class _$ComponentThemeDataCWProxyImpl implements _$ComponentThemeDataCWProxy {
/// ComponentThemeData(...).copyWith(id: 12, name: "My name")
/// ````
ComponentThemeData call({
Object? appBar = const $CopyWithPlaceholder(),
Object? topNavigationBarComponent = const $CopyWithPlaceholder(),
Object? topAppBar = const $CopyWithPlaceholder(),
Object? topNavigationBar = const $CopyWithPlaceholder(),
Object? bottomNavigationBar = const $CopyWithPlaceholder(),
Object? errorWidget = const $CopyWithPlaceholder(),
Object? loadingWidget = const $CopyWithPlaceholder(),
Object? loaderComponent = const $CopyWithPlaceholder(),
Object? richTextBuilderComponent = const $CopyWithPlaceholder(),
Object? textInputComponent = const $CopyWithPlaceholder(),
Object? fileSelectionButtonComponent = const $CopyWithPlaceholder(),
Object? flatButtonComponent = const $CopyWithPlaceholder(),
Object? simpleIconButtonComponent = const $CopyWithPlaceholder(),
Object? symbolButtonComponent = const $CopyWithPlaceholder(),
Object? informationCardComponent = const $CopyWithPlaceholder(),
Object? portfolioCardComponent = const $CopyWithPlaceholder(),
Object? quoteCardComponent = const $CopyWithPlaceholder(),
Object? skillCardComponent = const $CopyWithPlaceholder(),
Object? error = const $CopyWithPlaceholder(),
Object? loader = const $CopyWithPlaceholder(),
Object? richTextBuilder = const $CopyWithPlaceholder(),
Object? textInput = const $CopyWithPlaceholder(),
Object? fileSelectionButton = const $CopyWithPlaceholder(),
Object? flatButton = const $CopyWithPlaceholder(),
Object? simpleIconButton = const $CopyWithPlaceholder(),
Object? symbolButton = const $CopyWithPlaceholder(),
Object? informationCard = const $CopyWithPlaceholder(),
Object? portfolioCard = const $CopyWithPlaceholder(),
Object? quoteCard = const $CopyWithPlaceholder(),
Object? skillCard = const $CopyWithPlaceholder(),
}) {
return ComponentThemeData(
appBar: appBar == const $CopyWithPlaceholder()
? _value.appBar
topAppBar: topAppBar == const $CopyWithPlaceholder()
? _value.topAppBar
// ignore: cast_nullable_to_non_nullable
: appBar as TopAppBarComponent?,
topNavigationBarComponent:
topNavigationBarComponent == const $CopyWithPlaceholder()
? _value.topNavigationBarComponent
// ignore: cast_nullable_to_non_nullable
: topNavigationBarComponent as TopNavigationBarComponent?,
: topAppBar as TopAppBarComponent?,
topNavigationBar: topNavigationBar == const $CopyWithPlaceholder()
? _value.topNavigationBar
// ignore: cast_nullable_to_non_nullable
: topNavigationBar as TopNavigationBarComponent?,
bottomNavigationBar: bottomNavigationBar == const $CopyWithPlaceholder()
? _value.bottomNavigationBar
// ignore: cast_nullable_to_non_nullable
: bottomNavigationBar as BottomNavigationBarComponent?,
errorWidget: errorWidget == const $CopyWithPlaceholder()
? _value.errorWidget
error: error == const $CopyWithPlaceholder()
? _value.error
// ignore: cast_nullable_to_non_nullable
: errorWidget as ErrorWidgetComponent?,
loadingWidget: loadingWidget == const $CopyWithPlaceholder()
? _value.loadingWidget
: error as ErrorComponent?,
loader: loader == const $CopyWithPlaceholder()
? _value.loader
// ignore: cast_nullable_to_non_nullable
: loadingWidget as LoadingWidgetComponent?,
loaderComponent: loaderComponent == const $CopyWithPlaceholder()
? _value.loaderComponent
: loader as LoaderComponent?,
richTextBuilder: richTextBuilder == const $CopyWithPlaceholder()
? _value.richTextBuilder
// ignore: cast_nullable_to_non_nullable
: loaderComponent as LoaderComponent?,
richTextBuilderComponent:
richTextBuilderComponent == const $CopyWithPlaceholder()
? _value.richTextBuilderComponent
// ignore: cast_nullable_to_non_nullable
: richTextBuilderComponent as RichTextBuilderComponent?,
textInputComponent: textInputComponent == const $CopyWithPlaceholder()
? _value.textInputComponent
: richTextBuilder as RichTextBuilderComponent?,
textInput: textInput == const $CopyWithPlaceholder()
? _value.textInput
// ignore: cast_nullable_to_non_nullable
: textInputComponent as TextInputComponent?,
fileSelectionButtonComponent:
fileSelectionButtonComponent == const $CopyWithPlaceholder()
? _value.fileSelectionButtonComponent
// ignore: cast_nullable_to_non_nullable
: fileSelectionButtonComponent as FileSelectionButtonComponent?,
flatButtonComponent: flatButtonComponent == const $CopyWithPlaceholder()
? _value.flatButtonComponent
: textInput as TextInputComponent?,
fileSelectionButton: fileSelectionButton == const $CopyWithPlaceholder()
? _value.fileSelectionButton
// ignore: cast_nullable_to_non_nullable
: flatButtonComponent as FlatButtonComponent?,
simpleIconButtonComponent:
simpleIconButtonComponent == const $CopyWithPlaceholder()
? _value.simpleIconButtonComponent
// ignore: cast_nullable_to_non_nullable
: simpleIconButtonComponent as SimpleIconButtonComponent?,
symbolButtonComponent:
symbolButtonComponent == const $CopyWithPlaceholder()
? _value.symbolButtonComponent
// ignore: cast_nullable_to_non_nullable
: symbolButtonComponent as SymbolButtonComponent?,
informationCardComponent:
informationCardComponent == const $CopyWithPlaceholder()
? _value.informationCardComponent
// ignore: cast_nullable_to_non_nullable
: informationCardComponent as InformationCardComponent?,
portfolioCardComponent:
portfolioCardComponent == const $CopyWithPlaceholder()
? _value.portfolioCardComponent
// ignore: cast_nullable_to_non_nullable
: portfolioCardComponent as PortfolioCardComponent?,
quoteCardComponent: quoteCardComponent == const $CopyWithPlaceholder()
? _value.quoteCardComponent
: fileSelectionButton as FileSelectionButtonComponent?,
flatButton: flatButton == const $CopyWithPlaceholder()
? _value.flatButton
// ignore: cast_nullable_to_non_nullable
: quoteCardComponent as QuoteCardComponent?,
skillCardComponent: skillCardComponent == const $CopyWithPlaceholder()
? _value.skillCardComponent
: flatButton as FlatButtonComponent?,
simpleIconButton: simpleIconButton == const $CopyWithPlaceholder()
? _value.simpleIconButton
// ignore: cast_nullable_to_non_nullable
: skillCardComponent as SkillCardComponent?,
: simpleIconButton as SimpleIconButtonComponent?,
symbolButton: symbolButton == const $CopyWithPlaceholder()
? _value.symbolButton
// ignore: cast_nullable_to_non_nullable
: symbolButton as SymbolButtonComponent?,
informationCard: informationCard == const $CopyWithPlaceholder()
? _value.informationCard
// ignore: cast_nullable_to_non_nullable
: informationCard as InformationCardComponent?,
portfolioCard: portfolioCard == const $CopyWithPlaceholder()
? _value.portfolioCard
// ignore: cast_nullable_to_non_nullable
: portfolioCard as PortfolioCardComponent?,
quoteCard: quoteCard == const $CopyWithPlaceholder()
? _value.quoteCard
// ignore: cast_nullable_to_non_nullable
: quoteCard as QuoteCardComponent?,
skillCard: skillCard == const $CopyWithPlaceholder()
? _value.skillCard
// ignore: cast_nullable_to_non_nullable
: skillCard as SkillCardComponent?,
);
}
}