From 24364da0b9410c8d7e2606780b7a8ea386f3e943 Mon Sep 17 00:00:00 2001 From: "mr.mojtaba" Date: Mon, 14 Jul 2025 09:19:07 +0330 Subject: [PATCH] fix : fab add size --- .../lib/presentation/widget/buttons/fab.dart | 39 ++++++++----------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/packages/core/lib/presentation/widget/buttons/fab.dart b/packages/core/lib/presentation/widget/buttons/fab.dart index 3a33df7..a9dda88 100644 --- a/packages/core/lib/presentation/widget/buttons/fab.dart +++ b/packages/core/lib/presentation/widget/buttons/fab.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:rasadyar_core/presentation/common/app_color.dart'; import 'package:rasadyar_core/presentation/utils/color_utils.dart'; @@ -30,7 +31,7 @@ class RFab extends StatefulWidget { RFab.add({required VoidCallback? onPressed, Key? key}) : this( onPressed: onPressed, - icon: Assets.vec.addSvg.svg(width: 40, height: 40), + icon: Assets.vec.addSvg.svg(width: 56.w, height: 56.h), backgroundColor: AppColor.greenNormal, key: key, ); @@ -201,14 +202,11 @@ class _RFabState extends State { side: WidgetStateProperty.all(BorderSide.none), backgroundColor: WidgetStateProperty.resolveWith((states) { if (states.contains(WidgetState.pressed)) { - return widget.backgroundColor?.pressedColor ?? - AppColor.blueNormalActive; + return widget.backgroundColor?.pressedColor ?? AppColor.blueNormalActive; } else if (states.contains(WidgetState.hovered)) { - return widget.backgroundColor?.hoverColor ?? - AppColor.blueNormalHover; + return widget.backgroundColor?.hoverColor ?? AppColor.blueNormalHover; } else if (states.contains(WidgetState.disabled)) { - return widget.backgroundColor?.disabledColor ?? - AppColor.blueNormal.disabledColor; + return widget.backgroundColor?.disabledColor ?? AppColor.blueNormal.disabledColor; } return widget.backgroundColor ?? AppColor.blueNormal; }), @@ -222,24 +220,19 @@ class _RFabState extends State { shape: WidgetStatePropertyAll( CircleBorder(side: BorderSide(width: 1, color: Colors.transparent)), ), - fixedSize: WidgetStatePropertyAll( - Size(widget.radius ?? 56, widget.radius ?? 56), - ), + fixedSize: WidgetStatePropertyAll(Size(widget.radius ?? 56, widget.radius ?? 56)), padding: WidgetStatePropertyAll(EdgeInsets.zero), ), - child: - widget.isLoading - ? SizedBox( - height: widget.radius / 2, - width: widget.radius / 2, - child: CircularProgressIndicator( - strokeWidth: 2.5, - valueColor: AlwaysStoppedAnimation( - widget.foregroundColor ?? Colors.white, - ), - ), - ) - : widget.icon, + child: widget.isLoading + ? SizedBox( + height: widget.radius / 2, + width: widget.radius / 2, + child: CircularProgressIndicator( + strokeWidth: 2.5, + valueColor: AlwaysStoppedAnimation(widget.foregroundColor ?? Colors.white), + ), + ) + : widget.icon, ); } }