feat: add floating action button component (close #191) #193
| @ -0,0 +1,107 @@ | |||||||
|  | // 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'; | ||||||
|  | import 'package:wyatt_component_copy_with_extension/wyatt_component_copy_with_extension.dart'; | ||||||
|  | import 'package:wyatt_ui_components/wyatt_ui_components.dart'; | ||||||
|  | 
 | ||||||
|  | part 'floating_action_button_component.g.dart'; | ||||||
|  | 
 | ||||||
|  | @ComponentProxyExtension() | ||||||
|  | abstract class FloatingActionButtonComponent extends Component | ||||||
|  |     with CopyWithMixin<$FloatingActionButtonComponentCWProxy> { | ||||||
|  |   const FloatingActionButtonComponent({ | ||||||
|  |     this.child, | ||||||
|  |     this.tooltip, | ||||||
|  |     this.foregroundColor, | ||||||
|  |     this.backgroundColor, | ||||||
|  |     this.focusColor, | ||||||
|  |     this.hoverColor, | ||||||
|  |     this.splashColor, | ||||||
|  |     this.heroTag, | ||||||
|  |     this.onPressed, | ||||||
|  |     this.mouseCursor, | ||||||
|  |     this.elevation, | ||||||
|  |     this.focusElevation, | ||||||
|  |     this.hoverElevation, | ||||||
|  |     this.highlightElevation, | ||||||
|  |     this.disabledElevation, | ||||||
|  |     this.mini, | ||||||
|  |     this.shape, | ||||||
|  |     this.clipBehavior, | ||||||
|  |     this.isExtended, | ||||||
|  |     this.focusNode, | ||||||
|  |     this.autofocus, | ||||||
|  |     this.materialTapTargetSize, | ||||||
|  |     this.enableFeedback, | ||||||
|  |     this.extendedIconLabelSpacing, | ||||||
|  |     this.extendedPadding, | ||||||
|  |     this.extendedTextStyle, | ||||||
|  |     super.key, | ||||||
|  |   }); | ||||||
|  | 
 | ||||||
|  |   final Widget? child; | ||||||
|  | 
 | ||||||
|  |   final String? tooltip; | ||||||
|  | 
 | ||||||
|  |   final Color? foregroundColor; | ||||||
|  | 
 | ||||||
|  |   final Color? backgroundColor; | ||||||
|  | 
 | ||||||
|  |   final Color? focusColor; | ||||||
|  | 
 | ||||||
|  |   final Color? hoverColor; | ||||||
|  | 
 | ||||||
|  |   final Color? splashColor; | ||||||
|  | 
 | ||||||
|  |   final Object? heroTag; | ||||||
|  | 
 | ||||||
|  |   final VoidCallback? onPressed; | ||||||
|  | 
 | ||||||
|  |   final MouseCursor? mouseCursor; | ||||||
|  | 
 | ||||||
|  |   final double? elevation; | ||||||
|  | 
 | ||||||
|  |   final double? focusElevation; | ||||||
|  | 
 | ||||||
|  |   final double? hoverElevation; | ||||||
|  | 
 | ||||||
|  |   final double? highlightElevation; | ||||||
|  | 
 | ||||||
|  |   final double? disabledElevation; | ||||||
|  | 
 | ||||||
|  |   final bool? mini; | ||||||
|  | 
 | ||||||
|  |   final ShapeBorder? shape; | ||||||
|  | 
 | ||||||
|  |   final Clip? clipBehavior; | ||||||
|  | 
 | ||||||
|  |   final bool? isExtended; | ||||||
|  | 
 | ||||||
|  |   final FocusNode? focusNode; | ||||||
|  | 
 | ||||||
|  |   final bool? autofocus; | ||||||
|  | 
 | ||||||
|  |   final MaterialTapTargetSize? materialTapTargetSize; | ||||||
|  | 
 | ||||||
|  |   final bool? enableFeedback; | ||||||
|  | 
 | ||||||
|  |   final double? extendedIconLabelSpacing; | ||||||
|  | 
 | ||||||
|  |   final EdgeInsetsGeometry? extendedPadding; | ||||||
|  | 
 | ||||||
|  |   final TextStyle? extendedTextStyle; | ||||||
|  | } | ||||||
| @ -0,0 +1,69 @@ | |||||||
|  | // GENERATED CODE - DO NOT MODIFY BY HAND | ||||||
|  | 
 | ||||||
|  | part of 'floating_action_button_component.dart'; | ||||||
|  | 
 | ||||||
|  | // ************************************************************************** | ||||||
|  | // ComponentProxyGenerator | ||||||
|  | // ************************************************************************** | ||||||
|  | 
 | ||||||
|  | abstract class $FloatingActionButtonComponentCWProxy { | ||||||
|  |   FloatingActionButtonComponent child(Widget? child); | ||||||
|  |   FloatingActionButtonComponent tooltip(String? tooltip); | ||||||
|  |   FloatingActionButtonComponent foregroundColor(Color? foregroundColor); | ||||||
|  |   FloatingActionButtonComponent backgroundColor(Color? backgroundColor); | ||||||
|  |   FloatingActionButtonComponent focusColor(Color? focusColor); | ||||||
|  |   FloatingActionButtonComponent hoverColor(Color? hoverColor); | ||||||
|  |   FloatingActionButtonComponent splashColor(Color? splashColor); | ||||||
|  |   FloatingActionButtonComponent heroTag(Object? heroTag); | ||||||
|  |   FloatingActionButtonComponent onPressed(void Function()? onPressed); | ||||||
|  |   FloatingActionButtonComponent mouseCursor(MouseCursor? mouseCursor); | ||||||
|  |   FloatingActionButtonComponent elevation(double? elevation); | ||||||
|  |   FloatingActionButtonComponent focusElevation(double? focusElevation); | ||||||
|  |   FloatingActionButtonComponent hoverElevation(double? hoverElevation); | ||||||
|  |   FloatingActionButtonComponent highlightElevation(double? highlightElevation); | ||||||
|  |   FloatingActionButtonComponent disabledElevation(double? disabledElevation); | ||||||
|  |   FloatingActionButtonComponent mini(bool? mini); | ||||||
|  |   FloatingActionButtonComponent shape(ShapeBorder? shape); | ||||||
|  |   FloatingActionButtonComponent clipBehavior(Clip? clipBehavior); | ||||||
|  |   FloatingActionButtonComponent isExtended(bool? isExtended); | ||||||
|  |   FloatingActionButtonComponent focusNode(FocusNode? focusNode); | ||||||
|  |   FloatingActionButtonComponent autofocus(bool? autofocus); | ||||||
|  |   FloatingActionButtonComponent materialTapTargetSize( | ||||||
|  |       MaterialTapTargetSize? materialTapTargetSize); | ||||||
|  |   FloatingActionButtonComponent enableFeedback(bool? enableFeedback); | ||||||
|  |   FloatingActionButtonComponent extendedIconLabelSpacing( | ||||||
|  |       double? extendedIconLabelSpacing); | ||||||
|  |   FloatingActionButtonComponent extendedPadding( | ||||||
|  |       EdgeInsetsGeometry? extendedPadding); | ||||||
|  |   FloatingActionButtonComponent extendedTextStyle(TextStyle? extendedTextStyle); | ||||||
|  |   FloatingActionButtonComponent key(Key? key); | ||||||
|  |   FloatingActionButtonComponent call({ | ||||||
|  |     Widget? child, | ||||||
|  |     String? tooltip, | ||||||
|  |     Color? foregroundColor, | ||||||
|  |     Color? backgroundColor, | ||||||
|  |     Color? focusColor, | ||||||
|  |     Color? hoverColor, | ||||||
|  |     Color? splashColor, | ||||||
|  |     Object? heroTag, | ||||||
|  |     void Function()? onPressed, | ||||||
|  |     MouseCursor? mouseCursor, | ||||||
|  |     double? elevation, | ||||||
|  |     double? focusElevation, | ||||||
|  |     double? hoverElevation, | ||||||
|  |     double? highlightElevation, | ||||||
|  |     double? disabledElevation, | ||||||
|  |     bool? mini, | ||||||
|  |     ShapeBorder? shape, | ||||||
|  |     Clip? clipBehavior, | ||||||
|  |     bool? isExtended, | ||||||
|  |     FocusNode? focusNode, | ||||||
|  |     bool? autofocus, | ||||||
|  |     MaterialTapTargetSize? materialTapTargetSize, | ||||||
|  |     bool? enableFeedback, | ||||||
|  |     double? extendedIconLabelSpacing, | ||||||
|  |     EdgeInsetsGeometry? extendedPadding, | ||||||
|  |     TextStyle? extendedTextStyle, | ||||||
|  |     Key? key, | ||||||
|  |   }); | ||||||
|  | } | ||||||
| @ -17,6 +17,7 @@ | |||||||
| import 'package:copy_with_extension/copy_with_extension.dart'; | import 'package:copy_with_extension/copy_with_extension.dart'; | ||||||
| import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||||
| import 'package:wyatt_ui_components/src/domain/entities/entities.dart'; | import 'package:wyatt_ui_components/src/domain/entities/entities.dart'; | ||||||
|  | import 'package:wyatt_ui_components/src/domain/entities/floating_buttons/floating_action_button_component.dart'; | ||||||
| part 'component_theme_data.g.dart'; | part 'component_theme_data.g.dart'; | ||||||
| 
 | 
 | ||||||
| /// {@template component_theme_data} | /// {@template component_theme_data} | ||||||
| @ -41,6 +42,7 @@ class ComponentThemeData { | |||||||
|     PortfolioCardComponent? portfolioCard, |     PortfolioCardComponent? portfolioCard, | ||||||
|     QuoteCardComponent? quoteCard, |     QuoteCardComponent? quoteCard, | ||||||
|     SkillCardComponent? skillCard, |     SkillCardComponent? skillCard, | ||||||
|  |     FloatingActionButtonComponent? floatingActionButton, | ||||||
|   }) => |   }) => | ||||||
|       ComponentThemeData.raw( |       ComponentThemeData.raw( | ||||||
|         topAppBar: topAppBar, |         topAppBar: topAppBar, | ||||||
| @ -58,6 +60,7 @@ class ComponentThemeData { | |||||||
|         portfolioCard: portfolioCard, |         portfolioCard: portfolioCard, | ||||||
|         quoteCard: quoteCard, |         quoteCard: quoteCard, | ||||||
|         skillCard: skillCard, |         skillCard: skillCard, | ||||||
|  |         floatingActionButton: floatingActionButton, | ||||||
|       ); |       ); | ||||||
| 
 | 
 | ||||||
|   /// {@macro component_theme_data} |   /// {@macro component_theme_data} | ||||||
| @ -78,6 +81,7 @@ class ComponentThemeData { | |||||||
|         portfolioCard: other.portfolioCard, |         portfolioCard: other.portfolioCard, | ||||||
|         quoteCard: other.quoteCard, |         quoteCard: other.quoteCard, | ||||||
|         skillCard: other.skillCard, |         skillCard: other.skillCard, | ||||||
|  |         floatingActionButton: other.floatingActionButton, | ||||||
|       ); |       ); | ||||||
| 
 | 
 | ||||||
|   /// Create a [ComponentThemeData] given a set of exact values. Most values |   /// Create a [ComponentThemeData] given a set of exact values. Most values | ||||||
| @ -102,6 +106,7 @@ class ComponentThemeData { | |||||||
|     this.portfolioCard, |     this.portfolioCard, | ||||||
|     this.quoteCard, |     this.quoteCard, | ||||||
|     this.skillCard, |     this.skillCard, | ||||||
|  |     this.floatingActionButton, | ||||||
|   }); |   }); | ||||||
| 
 | 
 | ||||||
|   R _get<T extends Component, R>(T? component, R? returned) { |   R _get<T extends Component, R>(T? component, R? returned) { | ||||||
| @ -173,4 +178,8 @@ class ComponentThemeData { | |||||||
|   final SymbolButtonComponent? symbolButton; |   final SymbolButtonComponent? symbolButton; | ||||||
|   $SymbolButtonComponentCWProxy get symbolButtonComponent => |   $SymbolButtonComponentCWProxy get symbolButtonComponent => | ||||||
|       _get(symbolButton, symbolButton?.copyWith); |       _get(symbolButton, symbolButton?.copyWith); | ||||||
|  | 
 | ||||||
|  |   final FloatingActionButtonComponent? floatingActionButton; | ||||||
|  |   $FloatingActionButtonComponentCWProxy get floatingActionButtonComponent => | ||||||
|  |       _get(floatingActionButton, floatingActionButton?.copyWith); | ||||||
| } | } | ||||||
|  | |||||||
| @ -41,6 +41,9 @@ abstract class _$ComponentThemeDataCWProxy { | |||||||
| 
 | 
 | ||||||
|   ComponentThemeData skillCard(SkillCardComponent? skillCard); |   ComponentThemeData skillCard(SkillCardComponent? skillCard); | ||||||
| 
 | 
 | ||||||
|  |   ComponentThemeData floatingActionButton( | ||||||
|  |       FloatingActionButtonComponent? floatingActionButton); | ||||||
|  | 
 | ||||||
|   /// 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. |   /// 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. | ||||||
|   /// |   /// | ||||||
|   /// Usage |   /// Usage | ||||||
| @ -63,6 +66,7 @@ abstract class _$ComponentThemeDataCWProxy { | |||||||
|     PortfolioCardComponent? portfolioCard, |     PortfolioCardComponent? portfolioCard, | ||||||
|     QuoteCardComponent? quoteCard, |     QuoteCardComponent? quoteCard, | ||||||
|     SkillCardComponent? skillCard, |     SkillCardComponent? skillCard, | ||||||
|  |     FloatingActionButtonComponent? floatingActionButton, | ||||||
|   }); |   }); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @ -136,6 +140,11 @@ class _$ComponentThemeDataCWProxyImpl implements _$ComponentThemeDataCWProxy { | |||||||
|   ComponentThemeData skillCard(SkillCardComponent? skillCard) => |   ComponentThemeData skillCard(SkillCardComponent? skillCard) => | ||||||
|       this(skillCard: skillCard); |       this(skillCard: skillCard); | ||||||
| 
 | 
 | ||||||
|  |   @override | ||||||
|  |   ComponentThemeData floatingActionButton( | ||||||
|  |           FloatingActionButtonComponent? floatingActionButton) => | ||||||
|  |       this(floatingActionButton: floatingActionButton); | ||||||
|  | 
 | ||||||
|   @override |   @override | ||||||
| 
 | 
 | ||||||
|   /// 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. |   /// 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. | ||||||
| @ -160,6 +169,7 @@ class _$ComponentThemeDataCWProxyImpl implements _$ComponentThemeDataCWProxy { | |||||||
|     Object? portfolioCard = const $CopyWithPlaceholder(), |     Object? portfolioCard = const $CopyWithPlaceholder(), | ||||||
|     Object? quoteCard = const $CopyWithPlaceholder(), |     Object? quoteCard = const $CopyWithPlaceholder(), | ||||||
|     Object? skillCard = const $CopyWithPlaceholder(), |     Object? skillCard = const $CopyWithPlaceholder(), | ||||||
|  |     Object? floatingActionButton = const $CopyWithPlaceholder(), | ||||||
|   }) { |   }) { | ||||||
|     return ComponentThemeData( |     return ComponentThemeData( | ||||||
|       topAppBar: topAppBar == const $CopyWithPlaceholder() |       topAppBar: topAppBar == const $CopyWithPlaceholder() | ||||||
| @ -222,6 +232,10 @@ class _$ComponentThemeDataCWProxyImpl implements _$ComponentThemeDataCWProxy { | |||||||
|           ? _value.skillCard |           ? _value.skillCard | ||||||
|           // ignore: cast_nullable_to_non_nullable |           // ignore: cast_nullable_to_non_nullable | ||||||
|           : skillCard as SkillCardComponent?, |           : skillCard as SkillCardComponent?, | ||||||
|  |       floatingActionButton: floatingActionButton == const $CopyWithPlaceholder() | ||||||
|  |           ? _value.floatingActionButton | ||||||
|  |           // ignore: cast_nullable_to_non_nullable | ||||||
|  |           : floatingActionButton as FloatingActionButtonComponent?, | ||||||
|     ); |     ); | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user