fix : fab add size
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
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/common/app_color.dart';
|
||||||
import 'package:rasadyar_core/presentation/utils/color_utils.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})
|
RFab.add({required VoidCallback? onPressed, Key? key})
|
||||||
: this(
|
: this(
|
||||||
onPressed: onPressed,
|
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,
|
backgroundColor: AppColor.greenNormal,
|
||||||
key: key,
|
key: key,
|
||||||
);
|
);
|
||||||
@@ -201,14 +202,11 @@ class _RFabState extends State<RFab> {
|
|||||||
side: WidgetStateProperty.all(BorderSide.none),
|
side: WidgetStateProperty.all(BorderSide.none),
|
||||||
backgroundColor: WidgetStateProperty.resolveWith<Color?>((states) {
|
backgroundColor: WidgetStateProperty.resolveWith<Color?>((states) {
|
||||||
if (states.contains(WidgetState.pressed)) {
|
if (states.contains(WidgetState.pressed)) {
|
||||||
return widget.backgroundColor?.pressedColor ??
|
return widget.backgroundColor?.pressedColor ?? AppColor.blueNormalActive;
|
||||||
AppColor.blueNormalActive;
|
|
||||||
} else if (states.contains(WidgetState.hovered)) {
|
} else if (states.contains(WidgetState.hovered)) {
|
||||||
return widget.backgroundColor?.hoverColor ??
|
return widget.backgroundColor?.hoverColor ?? AppColor.blueNormalHover;
|
||||||
AppColor.blueNormalHover;
|
|
||||||
} else if (states.contains(WidgetState.disabled)) {
|
} else if (states.contains(WidgetState.disabled)) {
|
||||||
return widget.backgroundColor?.disabledColor ??
|
return widget.backgroundColor?.disabledColor ?? AppColor.blueNormal.disabledColor;
|
||||||
AppColor.blueNormal.disabledColor;
|
|
||||||
}
|
}
|
||||||
return widget.backgroundColor ?? AppColor.blueNormal;
|
return widget.backgroundColor ?? AppColor.blueNormal;
|
||||||
}),
|
}),
|
||||||
@@ -222,24 +220,19 @@ class _RFabState extends State<RFab> {
|
|||||||
shape: WidgetStatePropertyAll(
|
shape: WidgetStatePropertyAll(
|
||||||
CircleBorder(side: BorderSide(width: 1, color: Colors.transparent)),
|
CircleBorder(side: BorderSide(width: 1, color: Colors.transparent)),
|
||||||
),
|
),
|
||||||
fixedSize: WidgetStatePropertyAll(
|
fixedSize: WidgetStatePropertyAll(Size(widget.radius ?? 56, widget.radius ?? 56)),
|
||||||
Size(widget.radius ?? 56, widget.radius ?? 56),
|
|
||||||
),
|
|
||||||
padding: WidgetStatePropertyAll(EdgeInsets.zero),
|
padding: WidgetStatePropertyAll(EdgeInsets.zero),
|
||||||
),
|
),
|
||||||
child:
|
child: widget.isLoading
|
||||||
widget.isLoading
|
? SizedBox(
|
||||||
? SizedBox(
|
height: widget.radius / 2,
|
||||||
height: widget.radius / 2,
|
width: widget.radius / 2,
|
||||||
width: widget.radius / 2,
|
child: CircularProgressIndicator(
|
||||||
child: CircularProgressIndicator(
|
strokeWidth: 2.5,
|
||||||
strokeWidth: 2.5,
|
valueColor: AlwaysStoppedAnimation<Color>(widget.foregroundColor ?? Colors.white),
|
||||||
valueColor: AlwaysStoppedAnimation<Color>(
|
),
|
||||||
widget.foregroundColor ?? Colors.white,
|
)
|
||||||
),
|
: widget.icon,
|
||||||
),
|
|
||||||
)
|
|
||||||
: widget.icon,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user