ui_components/feat/cards-components #127

Merged
hugo merged 10 commits from ui_components/feat/cards-components into master 2023-02-09 16:50:48 +00:00
14 changed files with 69 additions and 41 deletions
Showing only changes of commit 47773872eb - Show all commits

View File

@ -10,6 +10,8 @@ class CustomAppBar extends AppBarComponent with $CustomAppBarCWMixin {
@override @override
Widget build(BuildContext context) => AppBar( Widget build(BuildContext context) => AppBar(
title: Text(super.title ?? ''), title: Text(
super.title?.text ?? '',
),
); );
} }

View File

@ -10,7 +10,7 @@ class $CustomAppBarCWProxyImpl implements $AppBarComponentCWProxy {
const $CustomAppBarCWProxyImpl(this._value); const $CustomAppBarCWProxyImpl(this._value);
final CustomAppBar _value; final CustomAppBar _value;
@override @override
CustomAppBar title(String? title) => this(title: title); CustomAppBar title(TextWrapper? title) => this(title: title);
@override @override
CustomAppBar leading(Widget? leading) => this(leading: leading); CustomAppBar leading(Widget? leading) => this(leading: leading);
@override @override
@ -19,7 +19,7 @@ class $CustomAppBarCWProxyImpl implements $AppBarComponentCWProxy {
CustomAppBar key(Key? key) => this(key: key); CustomAppBar key(Key? key) => this(key: key);
@override @override
CustomAppBar call({ CustomAppBar call({
String? title, TextWrapper? title,
Widget? leading, Widget? leading,
List<Widget>? actions, List<Widget>? actions,
Key? key, Key? key,

View File

@ -12,6 +12,6 @@ class CustomErrorWidget extends ErrorWidgetComponent
@override @override
Widget build(BuildContext context) => ColoredBox( Widget build(BuildContext context) => ColoredBox(
color: Colors.red, color: Colors.red,
child: Center(child: Text(error ?? 'Error')), child: Center(child: Text(error?.text ?? 'Error')),
); );
} }

View File

@ -10,12 +10,12 @@ class $CustomErrorWidgetCWProxyImpl implements $ErrorWidgetComponentCWProxy {
const $CustomErrorWidgetCWProxyImpl(this._value); const $CustomErrorWidgetCWProxyImpl(this._value);
final CustomErrorWidget _value; final CustomErrorWidget _value;
@override @override
CustomErrorWidget error(String? error) => this(error: error); CustomErrorWidget error(TextWrapper? error) => this(error: error);
@override @override
CustomErrorWidget key(Key? key) => this(key: key); CustomErrorWidget key(Key? key) => this(key: key);
@override @override
CustomErrorWidget call({ CustomErrorWidget call({
String? error, TextWrapper? error,
Key? key, Key? key,
}) => }) =>
CustomErrorWidget( CustomErrorWidget(

View File

@ -15,3 +15,5 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>. // along with this program. If not, see <https://www.gnu.org/licenses/>.
export 'extensions/build_context_extensions.dart'; export 'extensions/build_context_extensions.dart';
export 'mixins/copy_with_mixin.dart';
export 'utils/text_wrapper.dart';

View File

@ -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;
}

View File

@ -16,8 +16,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.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/wyatt_wyatt_ui_components.dart';
import 'package:wyatt_ui_components/src/domain/entities/component.dart';
part 'app_bar_component.g.dart'; part 'app_bar_component.g.dart';
@ -30,7 +29,7 @@ abstract class AppBarComponent extends Component
this.actions, this.actions,
super.key, super.key,
}); });
final String? title; final TextWrapper? title;
final Widget? leading; final Widget? leading;
final List<Widget>? actions; final List<Widget>? actions;
} }

View File

@ -7,12 +7,12 @@ part of 'app_bar_component.dart';
// ************************************************************************** // **************************************************************************
abstract class $AppBarComponentCWProxy { abstract class $AppBarComponentCWProxy {
AppBarComponent title(String? title); AppBarComponent title(TextWrapper? title);
AppBarComponent leading(Widget? leading); AppBarComponent leading(Widget? leading);
AppBarComponent actions(List<Widget>? actions); AppBarComponent actions(List<Widget>? actions);
AppBarComponent key(Key? key); AppBarComponent key(Key? key);
AppBarComponent call({ AppBarComponent call({
String? title, TextWrapper? title,
Widget? leading, Widget? leading,
List<Widget>? actions, List<Widget>? actions,
Key? key, Key? key,

View File

@ -16,8 +16,8 @@
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.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/src/domain/entities/cards/card_component.dart';
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
part 'information_card_component.g.dart'; part 'information_card_component.g.dart';
@ -32,8 +32,8 @@ abstract class InformationCardComponent extends CardComponent
this.axis = Axis.vertical, this.axis = Axis.vertical,
super.radius = 12, super.radius = 12,
super.padding = 25, super.padding = 25,
super.borderColors = const [Color(0xFFDDE0E3), Color(0xFFCACCD4)], super.borderColors,
super.backgroundColor = const Color(0xFFF6F6F6), super.backgroundColor,
super.minSize = const Size(330, 230), super.minSize = const Size(330, 230),
super.maxSize = const Size(330, 530), super.maxSize = const Size(330, 530),
super.shadow = const BoxShadow( super.shadow = const BoxShadow(
@ -47,7 +47,7 @@ abstract class InformationCardComponent extends CardComponent
final Axis? axis; final Axis? axis;
final List<Widget>? icons; final List<Widget>? icons;
final Widget? title; final TextWrapper? title;
final Widget? subtitle; final TextWrapper? subtitle;
final Widget? body; final TextWrapper? body;
} }

View File

@ -8,9 +8,9 @@ part of 'information_card_component.dart';
abstract class $InformationCardComponentCWProxy { abstract class $InformationCardComponentCWProxy {
InformationCardComponent icons(List<Widget>? icons); InformationCardComponent icons(List<Widget>? icons);
InformationCardComponent title(Widget? title); InformationCardComponent title(TextWrapper? title);
InformationCardComponent subtitle(Widget? subtitle); InformationCardComponent subtitle(TextWrapper? subtitle);
InformationCardComponent body(Widget? body); InformationCardComponent body(TextWrapper? body);
InformationCardComponent axis(Axis? axis); InformationCardComponent axis(Axis? axis);
InformationCardComponent radius(double? radius); InformationCardComponent radius(double? radius);
InformationCardComponent padding(double? padding); InformationCardComponent padding(double? padding);
@ -23,9 +23,9 @@ abstract class $InformationCardComponentCWProxy {
InformationCardComponent key(Key? key); InformationCardComponent key(Key? key);
InformationCardComponent call({ InformationCardComponent call({
List<Widget>? icons, List<Widget>? icons,
Widget? title, TextWrapper? title,
Widget? subtitle, TextWrapper? subtitle,
Widget? body, TextWrapper? body,
Axis? axis, Axis? axis,
double? radius, double? radius,
double? padding, double? padding,

View File

@ -16,8 +16,8 @@
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.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/src/domain/entities/cards/card_component.dart';
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
part 'quote_card_component.g.dart'; part 'quote_card_component.g.dart';
@ -34,8 +34,8 @@ abstract class QuoteCardComponent extends CardComponent
this.rightQuote, this.rightQuote,
super.radius = 12, super.radius = 12,
super.padding = 25, super.padding = 25,
super.borderColors = const [Color(0xFFDDE0E3), Color(0xFFCACCD4)], super.borderColors,
super.backgroundColor = const Color(0xFFF6F6F6), super.backgroundColor,
super.minSize = const Size(330, 230), super.minSize = const Size(330, 230),
super.maxSize = const Size(330, 530), super.maxSize = const Size(330, 530),
super.shadow = const BoxShadow( super.shadow = const BoxShadow(
@ -48,11 +48,11 @@ abstract class QuoteCardComponent extends CardComponent
}); });
final Widget? avatar; final Widget? avatar;
final Widget? name; final TextWrapper? name;
final Text? subtitle; final TextWrapper? subtitle;
final Gradient? gradient; final TextWrapper? quote;
final Widget? quote;
final Gradient? gradient;
final Widget? leftQuote; final Widget? leftQuote;
final Widget? rightQuote; final Widget? rightQuote;
} }

View File

@ -8,10 +8,10 @@ part of 'quote_card_component.dart';
abstract class $QuoteCardComponentCWProxy { abstract class $QuoteCardComponentCWProxy {
QuoteCardComponent avatar(Widget? avatar); QuoteCardComponent avatar(Widget? avatar);
QuoteCardComponent name(Widget? name); QuoteCardComponent name(TextWrapper? name);
QuoteCardComponent subtitle(Text? subtitle); QuoteCardComponent subtitle(TextWrapper? subtitle);
QuoteCardComponent gradient(Gradient? gradient); QuoteCardComponent gradient(Gradient? gradient);
QuoteCardComponent quote(Widget? quote); QuoteCardComponent quote(TextWrapper? quote);
QuoteCardComponent leftQuote(Widget? leftQuote); QuoteCardComponent leftQuote(Widget? leftQuote);
QuoteCardComponent rightQuote(Widget? rightQuote); QuoteCardComponent rightQuote(Widget? rightQuote);
QuoteCardComponent radius(double? radius); QuoteCardComponent radius(double? radius);
@ -25,10 +25,10 @@ abstract class $QuoteCardComponentCWProxy {
QuoteCardComponent key(Key? key); QuoteCardComponent key(Key? key);
QuoteCardComponent call({ QuoteCardComponent call({
Widget? avatar, Widget? avatar,
Widget? name, TextWrapper? name,
Text? subtitle, TextWrapper? subtitle,
Gradient? gradient, Gradient? gradient,
Widget? quote, TextWrapper? quote,
Widget? leftQuote, Widget? leftQuote,
Widget? rightQuote, Widget? rightQuote,
double? radius, double? radius,

View File

@ -16,8 +16,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.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/wyatt_wyatt_ui_components.dart';
import 'package:wyatt_ui_components/src/domain/entities/component.dart';
part 'error_widget_component.g.dart'; part 'error_widget_component.g.dart';
@ -25,5 +24,5 @@ part 'error_widget_component.g.dart';
abstract class ErrorWidgetComponent extends Component abstract class ErrorWidgetComponent extends Component
with CopyWithMixin<$ErrorWidgetComponentCWProxy> { with CopyWithMixin<$ErrorWidgetComponentCWProxy> {
const ErrorWidgetComponent({required this.error, super.key}); const ErrorWidgetComponent({required this.error, super.key});
final String? error; final TextWrapper? error;
} }

View File

@ -7,10 +7,10 @@ part of 'error_widget_component.dart';
// ************************************************************************** // **************************************************************************
abstract class $ErrorWidgetComponentCWProxy { abstract class $ErrorWidgetComponentCWProxy {
ErrorWidgetComponent error(String? error); ErrorWidgetComponent error(TextWrapper? error);
ErrorWidgetComponent key(Key? key); ErrorWidgetComponent key(Key? key);
ErrorWidgetComponent call({ ErrorWidgetComponent call({
String? error, TextWrapper? error,
Key? key, Key? key,
}); });
} }