|
|
|
|
@ -56,7 +56,8 @@ extension WidgetExtensions on Widget {
|
|
|
|
|
Widget toExpanded({int flex = 1}) => Expanded(flex: flex, child: this);
|
|
|
|
|
|
|
|
|
|
Widget handlePopScope({required BuildContext cxt, required VoidCallback onSave, bool? showPopUp = true}) {
|
|
|
|
|
return showPopUp! ? PopScope(
|
|
|
|
|
return showPopUp!
|
|
|
|
|
? PopScope(
|
|
|
|
|
canPop: false,
|
|
|
|
|
onPopInvokedWithResult: (didPop, result) {
|
|
|
|
|
if (didPop) {
|
|
|
|
|
@ -72,13 +73,13 @@ extension WidgetExtensions on Widget {
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
child: this): this;
|
|
|
|
|
child: this)
|
|
|
|
|
: this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget toShimmer({bool isShow = true, double radius = 20, required BuildContext context}) => isShow
|
|
|
|
|
? Shimmer.fromColors(
|
|
|
|
|
// baseColor: const Color(0xffe8eff0),
|
|
|
|
|
baseColor: Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
|
baseColor: context.isDark ? AppColor.backgroundDark : const Color(0xffe8eff0),
|
|
|
|
|
highlightColor: AppColor.background(context),
|
|
|
|
|
child: ClipRRect(
|
|
|
|
|
borderRadius: BorderRadius.circular(radius),
|
|
|
|
|
@ -103,8 +104,17 @@ extension WidgetExtensions on Widget {
|
|
|
|
|
).toShadowContainer(context)
|
|
|
|
|
: this;
|
|
|
|
|
|
|
|
|
|
Widget toShadowContainer(BuildContext context,
|
|
|
|
|
{bool showShadow = true, double borderRadius = 14, bool withShadow = true, Color? backgroundColor, Color borderColor = Colors.transparent, double padding = 16, EdgeInsets? paddingObject, EdgeInsets? margin,}) =>
|
|
|
|
|
Widget toShadowContainer(
|
|
|
|
|
BuildContext context, {
|
|
|
|
|
bool showShadow = true,
|
|
|
|
|
double borderRadius = 14,
|
|
|
|
|
bool withShadow = true,
|
|
|
|
|
Color? backgroundColor,
|
|
|
|
|
Color borderColor = Colors.transparent,
|
|
|
|
|
double padding = 16,
|
|
|
|
|
EdgeInsets? paddingObject,
|
|
|
|
|
EdgeInsets? margin,
|
|
|
|
|
}) =>
|
|
|
|
|
withShadow
|
|
|
|
|
? Container(
|
|
|
|
|
padding: paddingObject ?? EdgeInsets.all(padding),
|
|
|
|
|
|