/* import 'package:flutter/material.dart'; import 'package:rasadyar_app/presentation/common/app_color.dart'; import 'package:rasadyar_app/presentation/common/assets.dart'; import 'package:rasadyar_app/presentation/utils/color_utils.dart'; import 'package:rasadyar_app/presentation/widget/vec_widget.dart'; class RFab extends StatefulWidget { final VoidCallback? onPressed; Color? foregroundColor; Color? backgroundColor; Color? disabledForegroundColor; Color? disabledBackgroundColor; double? radius; ShapeBorder? shapeBorder; Widget? icon; @override State createState() => _RFabState(); //region Add RFab.smallAdd({required VoidCallback? onPressed, Key? key}) : this.small( onPressed: onPressed, icon: vecWidget(Assets.vecAddSvg), backgroundColor: AppColor.greenNormal, key: key, ); RFab.add({required VoidCallback? onPressed, Key? key}) : this( onPressed: onPressed, icon: vecWidget(Assets.vecAddSvg), backgroundColor: AppColor.greenNormal, key: key, ); //endregion //region Edit RFab.smallEdit({required VoidCallback? onPressed, Key? key}) : this.small( onPressed: onPressed, icon: vecWidget(Assets.vecEditSvg), backgroundColor: AppColor.blueNormal, key: key, ); RFab.edit({required VoidCallback? onPressed, Key? key}) : this( onPressed: onPressed, icon: vecWidget(Assets.vecEditSvg), backgroundColor: AppColor.blueNormal, key: key, ); //endregion //region delete RFab.smallDelete({required VoidCallback? onPressed, Key? key}) : this.small( onPressed: onPressed, icon: vecWidget(Assets.vecTrashSvg), backgroundColor: AppColor.redNormal, key: key, ); RFab.delete({required VoidCallback? onPressed, Key? key}) : this( onPressed: onPressed, icon: vecWidget(Assets.vecTrashSvg), backgroundColor: AppColor.redNormal, key: key, ); //endregion //region action RFab.smallAction({required VoidCallback? onPressed, Key? key}) : this.small( onPressed: onPressed, icon: vecWidget(Assets.vecScanSvg), backgroundColor: AppColor.blueNormal, key: key, ); RFab.action({required VoidCallback? onPressed, Key? key}) : this( onPressed: onPressed, icon: vecWidget(Assets.vecScanSvg), backgroundColor: AppColor.blueNormal, key: key, ); //endregion //region filter RFab.smallFilter({required VoidCallback? onPressed, Key? key}) : this.small( onPressed: onPressed, icon: vecWidget(Assets.vecFilterSvg), backgroundColor: AppColor.blueNormal, key: key, ); RFab.filter({required VoidCallback? onPressed, Key? key}) : this( onPressed: onPressed, icon: vecWidget(Assets.vecFilterSvg), backgroundColor: AppColor.blueNormal, key: key, ); //endregion //region download RFab.smallDownload({required VoidCallback? onPressed, Key? key}) : this.small( onPressed: onPressed, icon: vecWidget(Assets.vecDownloadSvg), backgroundColor: AppColor.blueNormal, key: key, ); RFab.download({required VoidCallback? onPressed, Key? key}) : this( onPressed: onPressed, icon: vecWidget(Assets.vecDownloadSvg), backgroundColor: AppColor.blueNormal, key: key, ); //endregion //region Excel RFab.smallExcel({required VoidCallback? onPressed, Key? key}) : this.small( onPressed: onPressed, icon: vecWidget(Assets.vecDownloadSvg), backgroundColor: AppColor.greenDark, key: key, ); RFab.excel({required VoidCallback? onPressed, Key? key}) : this( onPressed: onPressed, icon: vecWidget(Assets.vecDownloadSvg), backgroundColor: AppColor.greenDark, key: key, ); //endregion //region Back RFab.smallBack({required VoidCallback? onPressed, Key? key}) : this.small( onPressed: onPressed, icon: vecWidget(Assets.vecArrowLeftSvg), backgroundColor: AppColor.blueNormal, key: key, ); RFab.back({required VoidCallback? onPressed, Key? key}) : this( onPressed: onPressed, icon: vecWidget(Assets.vecArrowLeftSvg), backgroundColor: AppColor.blueNormal, key: key, ); //endregion //region General RFab.small({ required this.onPressed, required this.icon, required this.backgroundColor, super.key, }) : radius = 40.0, foregroundColor = Colors.white; RFab({ required this.onPressed, required this.icon, required this.backgroundColor, super.key, }) : radius = 56.0, foregroundColor = Colors.white; //endregion } class _RFabState extends State { @override Widget build(BuildContext context) { return ElevatedButton( onPressed: widget.onPressed, style: ButtonStyle( side: WidgetStateProperty.all(BorderSide.none), backgroundColor: WidgetStateProperty.resolveWith((states) { if (states.contains(WidgetState.pressed)) { return widget.backgroundColor?.pressedColor ?? AppColor.blueNormalActive; } else if (states.contains(WidgetState.hovered)) { return widget.backgroundColor?.hoverColor ?? AppColor.blueNormalHover; } else if (states.contains(WidgetState.disabled)) { return widget.backgroundColor?.disabledColor ?? AppColor.blueNormal.disabledColor; } return widget.backgroundColor ?? AppColor.blueNormal; }), foregroundColor: WidgetStateProperty.resolveWith((states) { if (states.contains(WidgetState.disabled)) { return widget.foregroundColor?.disabledColor; } return widget.foregroundColor; }), shape: WidgetStatePropertyAll( CircleBorder(side: BorderSide(width: 1, color: Colors.transparent)), ), fixedSize: WidgetStatePropertyAll( Size(widget.radius ?? 56, widget.radius ?? 56), ), padding: WidgetStatePropertyAll(EdgeInsets.zero), ), child: widget.icon, ); } } */