fix : fab add size
This commit is contained in:
@@ -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<RFab> {
|
||||
side: WidgetStateProperty.all(BorderSide.none),
|
||||
backgroundColor: WidgetStateProperty.resolveWith<Color?>((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<RFab> {
|
||||
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<Color>(
|
||||
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<Color>(widget.foregroundColor ?? Colors.white),
|
||||
),
|
||||
)
|
||||
: widget.icon,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user