feat(ui): add colors and rework ComponentThemeData
Some checks failed
continuous-integration/drone/pr Build is failing
Some checks failed
continuous-integration/drone/pr Build is failing
This commit is contained in:
parent
a024b7e70a
commit
abd5e1b558
@ -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?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -91,11 +91,6 @@ class PortfolioCardHeader extends StatelessWidget {
|
||||
ThemeHelper.maybeGetElement<MultiColor, Gradient>(
|
||||
[
|
||||
keywordsBackgroundColors,
|
||||
Theme.of(context)
|
||||
.extension<CardThemeExtension>()
|
||||
?.borderColors,
|
||||
CardThemeExtensionDefault.from(Theme.of(context))
|
||||
.borderColors,
|
||||
],
|
||||
valueValidator: (multiColor) => multiColor?.isGradient,
|
||||
transform: (multiColor) =>
|
||||
|
@ -22,8 +22,7 @@ part 'gradient_icon.g.dart';
|
||||
|
||||
@ComponentCopyWithExtension()
|
||||
class GradientIcon extends GradientIconComponent with $GradientIconCWMixin {
|
||||
GradientIcon(
|
||||
{
|
||||
GradientIcon({
|
||||
required super.icon,
|
||||
required super.gradientColors,
|
||||
super.key,
|
||||
|
202
packages/wyatt_ui_kit/lib/src/core/design_system/colors.dart
Normal file
202
packages/wyatt_ui_kit/lib/src/core/design_system/colors.dart
Normal file
@ -0,0 +1,202 @@
|
||||
// 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/painting.dart';
|
||||
import 'package:wyatt_ui_components/wyatt_ui_components.dart';
|
||||
|
||||
class WyattColors {
|
||||
WyattColors._();
|
||||
|
||||
/// Color: #24262A
|
||||
static const Color black = Color(0xFF24262A);
|
||||
|
||||
/// Color: #3D92FA
|
||||
static const Color blue1 = Color(0xFF3D92FA);
|
||||
|
||||
/// Color: #3C97FB
|
||||
static const Color blue1Btn = Color(0xFF3C97FB);
|
||||
|
||||
/// Color: #83BEFF
|
||||
static const Color blue1BtnFocus = Color(0xFF83BEFF);
|
||||
|
||||
/// Color: #4190E8
|
||||
static const Color blue1BtnHover = Color(0xFF4190E8);
|
||||
|
||||
/// Color: #436EF4
|
||||
static const Color blue2 = Color(0xFF436EF4);
|
||||
|
||||
/// Color: #446DF4
|
||||
static const Color blue2Btn = Color(0xFF446DF4);
|
||||
|
||||
/// Color: #7897FF
|
||||
static const Color blue2BtnFocus = Color(0xFF7897FF);
|
||||
|
||||
/// Color: #2D54D3
|
||||
static const Color blue2BtnHover = Color(0xFF2D54D3);
|
||||
|
||||
/// Color: #4B68FF
|
||||
static const Color darkBlue1 = Color(0xFF4B68FF);
|
||||
|
||||
/// Color: #3531F5
|
||||
static const Color darkBlue2 = Color(0xFF3531F5);
|
||||
|
||||
/// Color: #60656A
|
||||
static const Color gray1 = Color(0xFF60656A);
|
||||
|
||||
/// Color: #16191D
|
||||
static const Color gray1Bg = Color(0xFF16191D);
|
||||
|
||||
/// Color: #26292D
|
||||
static const Color gray1BgOpacity = Color(0xFF26292D);
|
||||
|
||||
/// Color: #2C3238
|
||||
static const Color gray1Navbar = Color(0xFF2C3238);
|
||||
|
||||
/// Color: #383C40
|
||||
static const Color gray2 = Color(0xFF383C40);
|
||||
|
||||
/// Color: #33373E
|
||||
static const Color gray2Bg = Color(0xFF33373E);
|
||||
|
||||
/// Color: #202327
|
||||
static const Color gray2BgOpacity = Color(0xFF202327);
|
||||
|
||||
/// Color: #272F3D
|
||||
static const Color gray2Navbar = Color(0xFF272F3D);
|
||||
|
||||
/// Color: #2C3238
|
||||
static const Color gray3Navbar = Color(0xFF2C3238);
|
||||
|
||||
/// Color: #50CE99
|
||||
static const Color green1 = Color(0xFF50CE99);
|
||||
|
||||
/// Color: #339572
|
||||
static const Color green2 = Color(0xFF339572);
|
||||
|
||||
/// Color: #F6F6F6
|
||||
static const Color light = Color(0xFFF6F6F6);
|
||||
|
||||
/// Color: #DDE0E3
|
||||
static const Color light1 = Color(0xFFDDE0E3);
|
||||
|
||||
/// Color: #CACCD4
|
||||
static const Color light2 = Color(0xFFCACCD4);
|
||||
|
||||
/// Color: #E4EEF8
|
||||
static const Color lightGray1 = Color(0xFFE4EEF8);
|
||||
|
||||
/// Color: #DADEE2
|
||||
static const Color lightGray2 = Color(0xFFDADEE2);
|
||||
|
||||
/// Color: #B79EFF
|
||||
static const Color purple1 = Color(0xFFB79EFF);
|
||||
|
||||
/// Color: #6865F2
|
||||
static const Color purple2 = Color(0xFF6865F2);
|
||||
|
||||
/// Color: #FB5E3C
|
||||
static const Color red1 = Color(0xFFFB5E3C);
|
||||
|
||||
/// Color: #F44464
|
||||
static const Color red2 = Color(0xFFF44464);
|
||||
|
||||
/// Color: #FBAF3C
|
||||
static const Color yellow1 = Color(0xFFFBAF3C);
|
||||
|
||||
/// Color: #F48344
|
||||
static const Color yellow2 = Color(0xFFF48344);
|
||||
|
||||
static const MultiColor blueGradient = MultiColor([
|
||||
WyattColors.blue1,
|
||||
WyattColors.blue2,
|
||||
]);
|
||||
|
||||
static const MultiColor blueBtnGradient = MultiColor([
|
||||
WyattColors.blue1Btn,
|
||||
WyattColors.blue2Btn,
|
||||
]);
|
||||
|
||||
static const MultiColor blueBtnFocusGradient = MultiColor([
|
||||
WyattColors.blue1BtnFocus,
|
||||
WyattColors.blue2BtnFocus,
|
||||
]);
|
||||
|
||||
static const MultiColor blueBtnHoverGradient = MultiColor([
|
||||
WyattColors.blue1BtnHover,
|
||||
WyattColors.blue2BtnHover,
|
||||
]);
|
||||
|
||||
static const MultiColor darkBlueGradient = MultiColor([
|
||||
WyattColors.darkBlue1,
|
||||
WyattColors.darkBlue2,
|
||||
]);
|
||||
|
||||
static const MultiColor grayNavbarGradient = MultiColor([
|
||||
WyattColors.gray1Navbar,
|
||||
WyattColors.gray2Navbar,
|
||||
WyattColors.gray3Navbar,
|
||||
]);
|
||||
|
||||
static const MultiColor lightGrayNavbarGradient = MultiColor([
|
||||
WyattColors.gray1Navbar,
|
||||
WyattColors.gray2Navbar,
|
||||
]);
|
||||
|
||||
static const MultiColor grayGradient = MultiColor([
|
||||
WyattColors.gray1,
|
||||
WyattColors.gray2,
|
||||
]);
|
||||
|
||||
static const MultiColor grayBgGradient = MultiColor([
|
||||
WyattColors.gray1Bg,
|
||||
WyattColors.gray2Bg,
|
||||
]);
|
||||
|
||||
static const MultiColor grayBgOpacityGradient = MultiColor([
|
||||
WyattColors.gray1BgOpacity,
|
||||
WyattColors.gray2BgOpacity,
|
||||
]);
|
||||
|
||||
static const MultiColor lightGrayGradient = MultiColor([
|
||||
WyattColors.lightGray1,
|
||||
WyattColors.lightGray2,
|
||||
]);
|
||||
|
||||
static const MultiColor lightGradient = MultiColor([
|
||||
WyattColors.light1,
|
||||
WyattColors.light2,
|
||||
]);
|
||||
|
||||
static const MultiColor purpleGradient = MultiColor([
|
||||
WyattColors.purple1,
|
||||
WyattColors.purple2,
|
||||
]);
|
||||
|
||||
static const MultiColor redGradient = MultiColor([
|
||||
WyattColors.red1,
|
||||
WyattColors.red2,
|
||||
]);
|
||||
|
||||
static const MultiColor yellowGradient = MultiColor([
|
||||
WyattColors.yellow1,
|
||||
WyattColors.yellow2,
|
||||
]);
|
||||
|
||||
static const MultiColor greenGradient = MultiColor([
|
||||
WyattColors.green1,
|
||||
WyattColors.green2,
|
||||
]);
|
||||
}
|
@ -1,16 +1,16 @@
|
||||
// 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/>.
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:wyatt_ui_components/wyatt_ui_components.dart';
|
||||
import 'package:wyatt_ui_kit/src/core/design_system/colors.dart';
|
||||
|
||||
/// {@template card_theme_extension_impl}
|
||||
/// Card theme extension that implements Wyatt Theme.
|
||||
@ -47,18 +48,15 @@ class CardThemeExtensionImpl extends CardThemeExtension {
|
||||
radius: const BorderRadius.all(Radius.circular(12)),
|
||||
padding: const EdgeInsets.all(25),
|
||||
stroke: 1,
|
||||
backgroundColors: const MultiColor.single(Color(0xFFF6F6F6)),
|
||||
borderColors: const MultiColor([
|
||||
Color(0xFFDDE0E3),
|
||||
Color(0xFFCACCD4),
|
||||
]),
|
||||
backgroundColors: const MultiColor.single(WyattColors.light),
|
||||
borderColors: WyattColors.lightGradient,
|
||||
titleStyle: theme.textTheme.titleLarge,
|
||||
subtitleStyle: theme.textTheme.titleMedium,
|
||||
bodyStyle: theme.textTheme.bodyMedium,
|
||||
minSize: const Size(330, 0),
|
||||
maxSize: const Size(390, double.infinity),
|
||||
shadow: BoxShadow(
|
||||
color: const Color(0xFF24262A).withOpacity(0.05),
|
||||
color: WyattColors.black.withOpacity(0.05),
|
||||
blurRadius: 30,
|
||||
offset: const Offset(0, 5),
|
||||
),
|
||||
@ -74,19 +72,15 @@ class CardThemeExtensionImpl extends CardThemeExtension {
|
||||
radius: const BorderRadius.all(Radius.circular(12)),
|
||||
padding: const EdgeInsets.all(25),
|
||||
stroke: 1,
|
||||
backgroundColors:
|
||||
const MultiColor([Color(0xFF26292D), Color(0xFF202327)]),
|
||||
borderColors: const MultiColor([
|
||||
Color(0xFF60656A),
|
||||
Color(0xFF383C40),
|
||||
]),
|
||||
backgroundColors: WyattColors.grayBgOpacityGradient,
|
||||
borderColors: WyattColors.grayGradient,
|
||||
titleStyle: theme.textTheme.titleLarge,
|
||||
subtitleStyle: theme.textTheme.titleMedium,
|
||||
bodyStyle: theme.textTheme.bodyMedium,
|
||||
minSize: const Size(330, 0),
|
||||
maxSize: const Size(390, double.infinity),
|
||||
shadow: BoxShadow(
|
||||
color: const Color(0xFF24262A).withOpacity(0.15),
|
||||
color: WyattColors.black.withOpacity(0.15),
|
||||
blurRadius: 30,
|
||||
offset: const Offset(0, 5),
|
||||
),
|
||||
|
@ -22,19 +22,22 @@ import 'package:wyatt_ui_kit/wyatt_ui_kit.dart';
|
||||
/// {@endtemplate}
|
||||
abstract class WyattComponentThemeData {
|
||||
/// {@macro wyatt_component_theme_data}
|
||||
static ComponentThemeData get wyattComponentThemeData => ComponentThemeData(
|
||||
appBar: const TopAppBar(),
|
||||
topNavigationBarComponent: const TopNavigationBar(),
|
||||
loaderComponent: const Loader(),
|
||||
richTextBuilderComponent: const RichTextBuilder(),
|
||||
textInputComponent: const TextInput(),
|
||||
fileSelectionButtonComponent: const FileSelectionButton(),
|
||||
flatButtonComponent: const FlatButton(),
|
||||
simpleIconButtonComponent: const SimpleIconButton(),
|
||||
symbolButtonComponent: const SymbolButton(),
|
||||
informationCardComponent: const InformationCard(),
|
||||
portfolioCardComponent: const PortfolioCard(),
|
||||
quoteCardComponent: const QuoteCard(),
|
||||
skillCardComponent: const SkillCard(),
|
||||
);
|
||||
static const ComponentThemeData wyattComponentThemeData =
|
||||
ComponentThemeData.raw(
|
||||
topAppBar: TopAppBar(),
|
||||
topNavigationBar: TopNavigationBar(),
|
||||
// bottomNavigationBar: ,
|
||||
// error: ,
|
||||
loader: Loader(),
|
||||
richTextBuilder: RichTextBuilder(),
|
||||
textInput: TextInput(),
|
||||
fileSelectionButton: FileSelectionButton(),
|
||||
flatButton: FlatButton(),
|
||||
simpleIconButton: SimpleIconButton(),
|
||||
symbolButton: SymbolButton(),
|
||||
informationCard: InformationCard(),
|
||||
portfolioCard: PortfolioCard(),
|
||||
quoteCard: QuoteCard(),
|
||||
skillCard: SkillCard(),
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user