ui_components/feat/cards-components #127
@ -10,6 +10,8 @@ class CustomAppBar extends AppBarComponent with $CustomAppBarCWMixin {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => AppBar(
|
||||
title: Text(super.title ?? ''),
|
||||
title: Text(
|
||||
super.title?.text ?? '',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ class $CustomAppBarCWProxyImpl implements $AppBarComponentCWProxy {
|
||||
const $CustomAppBarCWProxyImpl(this._value);
|
||||
final CustomAppBar _value;
|
||||
@override
|
||||
CustomAppBar title(String? title) => this(title: title);
|
||||
CustomAppBar title(TextWrapper? title) => this(title: title);
|
||||
@override
|
||||
CustomAppBar leading(Widget? leading) => this(leading: leading);
|
||||
@override
|
||||
@ -19,7 +19,7 @@ class $CustomAppBarCWProxyImpl implements $AppBarComponentCWProxy {
|
||||
CustomAppBar key(Key? key) => this(key: key);
|
||||
@override
|
||||
CustomAppBar call({
|
||||
String? title,
|
||||
TextWrapper? title,
|
||||
Widget? leading,
|
||||
List<Widget>? actions,
|
||||
Key? key,
|
||||
|
@ -12,6 +12,6 @@ class CustomErrorWidget extends ErrorWidgetComponent
|
||||
@override
|
||||
Widget build(BuildContext context) => ColoredBox(
|
||||
color: Colors.red,
|
||||
child: Center(child: Text(error ?? 'Error')),
|
||||
child: Center(child: Text(error?.text ?? 'Error')),
|
||||
);
|
||||
}
|
||||
|
@ -10,12 +10,12 @@ class $CustomErrorWidgetCWProxyImpl implements $ErrorWidgetComponentCWProxy {
|
||||
const $CustomErrorWidgetCWProxyImpl(this._value);
|
||||
final CustomErrorWidget _value;
|
||||
@override
|
||||
CustomErrorWidget error(String? error) => this(error: error);
|
||||
CustomErrorWidget error(TextWrapper? error) => this(error: error);
|
||||
@override
|
||||
CustomErrorWidget key(Key? key) => this(key: key);
|
||||
@override
|
||||
CustomErrorWidget call({
|
||||
String? error,
|
||||
TextWrapper? error,
|
||||
Key? key,
|
||||
}) =>
|
||||
CustomErrorWidget(
|
||||
|
@ -15,3 +15,5 @@
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
export 'extensions/build_context_extensions.dart';
|
||||
export 'mixins/copy_with_mixin.dart';
|
||||
export 'utils/text_wrapper.dart';
|
||||
|
@ -0,0 +1,26 @@
|
||||
// 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/material.dart';
|
||||
|
||||
class TextWrapper {
|
||||
TextWrapper(this.text, {this.style});
|
||||
|
||||
factory TextWrapper.text(String text) => TextWrapper(text);
|
||||
|
||||
final String text;
|
||||
final TextStyle? style;
|
||||
}
|
@ -16,8 +16,7 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
||||
import 'package:wyatt_ui_components/src/core/mixins/copy_with_mixin.dart';
|
||||
import 'package:wyatt_ui_components/src/domain/entities/component.dart';
|
||||
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||
|
||||
part 'app_bar_component.g.dart';
|
||||
|
||||
@ -30,7 +29,7 @@ abstract class AppBarComponent extends Component
|
||||
this.actions,
|
||||
super.key,
|
||||
});
|
||||
final String? title;
|
||||
final TextWrapper? title;
|
||||
final Widget? leading;
|
||||
final List<Widget>? actions;
|
||||
}
|
||||
|
@ -7,12 +7,12 @@ part of 'app_bar_component.dart';
|
||||
// **************************************************************************
|
||||
|
||||
abstract class $AppBarComponentCWProxy {
|
||||
AppBarComponent title(String? title);
|
||||
AppBarComponent title(TextWrapper? title);
|
||||
AppBarComponent leading(Widget? leading);
|
||||
AppBarComponent actions(List<Widget>? actions);
|
||||
AppBarComponent key(Key? key);
|
||||
AppBarComponent call({
|
||||
String? title,
|
||||
TextWrapper? title,
|
||||
Widget? leading,
|
||||
List<Widget>? actions,
|
||||
Key? key,
|
||||
|
@ -16,8 +16,8 @@
|
||||
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
||||
import 'package:wyatt_ui_components/src/core/mixins/copy_with_mixin.dart';
|
||||
import 'package:wyatt_ui_components/src/domain/entities/cards/card_component.dart';
|
||||
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||
|
||||
part 'information_card_component.g.dart';
|
||||
|
||||
@ -32,8 +32,8 @@ abstract class InformationCardComponent extends CardComponent
|
||||
this.axis = Axis.vertical,
|
||||
super.radius = 12,
|
||||
super.padding = 25,
|
||||
super.borderColors = const [Color(0xFFDDE0E3), Color(0xFFCACCD4)],
|
||||
super.backgroundColor = const Color(0xFFF6F6F6),
|
||||
super.borderColors,
|
||||
super.backgroundColor,
|
||||
super.minSize = const Size(330, 230),
|
||||
super.maxSize = const Size(330, 530),
|
||||
super.shadow = const BoxShadow(
|
||||
@ -47,7 +47,7 @@ abstract class InformationCardComponent extends CardComponent
|
||||
|
||||
final Axis? axis;
|
||||
final List<Widget>? icons;
|
||||
final Widget? title;
|
||||
final Widget? subtitle;
|
||||
final Widget? body;
|
||||
final TextWrapper? title;
|
||||
final TextWrapper? subtitle;
|
||||
final TextWrapper? body;
|
||||
}
|
||||
|
@ -8,9 +8,9 @@ part of 'information_card_component.dart';
|
||||
|
||||
abstract class $InformationCardComponentCWProxy {
|
||||
InformationCardComponent icons(List<Widget>? icons);
|
||||
InformationCardComponent title(Widget? title);
|
||||
InformationCardComponent subtitle(Widget? subtitle);
|
||||
InformationCardComponent body(Widget? body);
|
||||
InformationCardComponent title(TextWrapper? title);
|
||||
InformationCardComponent subtitle(TextWrapper? subtitle);
|
||||
InformationCardComponent body(TextWrapper? body);
|
||||
InformationCardComponent axis(Axis? axis);
|
||||
InformationCardComponent radius(double? radius);
|
||||
InformationCardComponent padding(double? padding);
|
||||
@ -23,9 +23,9 @@ abstract class $InformationCardComponentCWProxy {
|
||||
InformationCardComponent key(Key? key);
|
||||
InformationCardComponent call({
|
||||
List<Widget>? icons,
|
||||
Widget? title,
|
||||
Widget? subtitle,
|
||||
Widget? body,
|
||||
TextWrapper? title,
|
||||
TextWrapper? subtitle,
|
||||
TextWrapper? body,
|
||||
Axis? axis,
|
||||
double? radius,
|
||||
double? padding,
|
||||
|
@ -16,8 +16,8 @@
|
||||
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
||||
import 'package:wyatt_ui_components/src/core/mixins/copy_with_mixin.dart';
|
||||
import 'package:wyatt_ui_components/src/domain/entities/cards/card_component.dart';
|
||||
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||
|
||||
part 'quote_card_component.g.dart';
|
||||
|
||||
@ -34,8 +34,8 @@ abstract class QuoteCardComponent extends CardComponent
|
||||
this.rightQuote,
|
||||
super.radius = 12,
|
||||
super.padding = 25,
|
||||
super.borderColors = const [Color(0xFFDDE0E3), Color(0xFFCACCD4)],
|
||||
super.backgroundColor = const Color(0xFFF6F6F6),
|
||||
super.borderColors,
|
||||
super.backgroundColor,
|
||||
super.minSize = const Size(330, 230),
|
||||
super.maxSize = const Size(330, 530),
|
||||
super.shadow = const BoxShadow(
|
||||
@ -48,11 +48,11 @@ abstract class QuoteCardComponent extends CardComponent
|
||||
});
|
||||
|
||||
final Widget? avatar;
|
||||
final Widget? name;
|
||||
final Text? subtitle;
|
||||
final Gradient? gradient;
|
||||
final Widget? quote;
|
||||
final TextWrapper? name;
|
||||
final TextWrapper? subtitle;
|
||||
final TextWrapper? quote;
|
||||
|
||||
final Gradient? gradient;
|
||||
final Widget? leftQuote;
|
||||
final Widget? rightQuote;
|
||||
}
|
||||
|
@ -8,10 +8,10 @@ part of 'quote_card_component.dart';
|
||||
|
||||
abstract class $QuoteCardComponentCWProxy {
|
||||
QuoteCardComponent avatar(Widget? avatar);
|
||||
QuoteCardComponent name(Widget? name);
|
||||
QuoteCardComponent subtitle(Text? subtitle);
|
||||
QuoteCardComponent name(TextWrapper? name);
|
||||
QuoteCardComponent subtitle(TextWrapper? subtitle);
|
||||
QuoteCardComponent gradient(Gradient? gradient);
|
||||
QuoteCardComponent quote(Widget? quote);
|
||||
QuoteCardComponent quote(TextWrapper? quote);
|
||||
QuoteCardComponent leftQuote(Widget? leftQuote);
|
||||
QuoteCardComponent rightQuote(Widget? rightQuote);
|
||||
QuoteCardComponent radius(double? radius);
|
||||
@ -25,10 +25,10 @@ abstract class $QuoteCardComponentCWProxy {
|
||||
QuoteCardComponent key(Key? key);
|
||||
QuoteCardComponent call({
|
||||
Widget? avatar,
|
||||
Widget? name,
|
||||
Text? subtitle,
|
||||
TextWrapper? name,
|
||||
TextWrapper? subtitle,
|
||||
Gradient? gradient,
|
||||
Widget? quote,
|
||||
TextWrapper? quote,
|
||||
Widget? leftQuote,
|
||||
Widget? rightQuote,
|
||||
double? radius,
|
||||
|
@ -16,8 +16,7 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
||||
import 'package:wyatt_ui_components/src/core/mixins/copy_with_mixin.dart';
|
||||
import 'package:wyatt_ui_components/src/domain/entities/component.dart';
|
||||
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||
|
||||
part 'error_widget_component.g.dart';
|
||||
|
||||
@ -25,5 +24,5 @@ part 'error_widget_component.g.dart';
|
||||
abstract class ErrorWidgetComponent extends Component
|
||||
with CopyWithMixin<$ErrorWidgetComponentCWProxy> {
|
||||
const ErrorWidgetComponent({required this.error, super.key});
|
||||
final String? error;
|
||||
final TextWrapper? error;
|
||||
}
|
||||
|
@ -7,10 +7,10 @@ part of 'error_widget_component.dart';
|
||||
// **************************************************************************
|
||||
|
||||
abstract class $ErrorWidgetComponentCWProxy {
|
||||
ErrorWidgetComponent error(String? error);
|
||||
ErrorWidgetComponent error(TextWrapper? error);
|
||||
ErrorWidgetComponent key(Key? key);
|
||||
ErrorWidgetComponent call({
|
||||
String? error,
|
||||
TextWrapper? error,
|
||||
Key? key,
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user