feat : new ui
This commit is contained in:
@@ -20,7 +20,7 @@ class CardIcon extends StatelessWidget {
|
||||
this.borderWidth = 1,
|
||||
this.iconWidth = 48,
|
||||
this.iconHeight = 48,
|
||||
this.iconColor ,
|
||||
this.iconColor,
|
||||
}) : assert((svgIcon != null) || (vecIcon != null), 'Either svgIcon or vecIcon must be provided');
|
||||
|
||||
final String title;
|
||||
@@ -39,10 +39,11 @@ class CardIcon extends StatelessWidget {
|
||||
|
||||
final double width;
|
||||
final double height;
|
||||
|
||||
//icon
|
||||
final double iconWidth;
|
||||
final double iconHeight;
|
||||
final Color? iconColor ;
|
||||
final Color? iconColor;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -67,13 +68,17 @@ class CardIcon extends StatelessWidget {
|
||||
fit: BoxFit.cover,
|
||||
width: iconWidth.w,
|
||||
height: iconHeight.h,
|
||||
colorFilter: iconColor!= null ? ColorFilter.mode(iconColor!, BlendMode.srcIn) : null,
|
||||
colorFilter: iconColor != null
|
||||
? ColorFilter.mode(iconColor!, BlendMode.srcIn)
|
||||
: null,
|
||||
)
|
||||
: SvgGenImage.vec(vecIcon!).svg(
|
||||
fit: BoxFit.fill,
|
||||
width: iconWidth.w,
|
||||
height: iconHeight.h,
|
||||
colorFilter: iconColor!= null ? ColorFilter.mode(iconColor!, BlendMode.srcIn) : null,
|
||||
colorFilter: iconColor != null
|
||||
? ColorFilter.mode(iconColor!, BlendMode.srcIn)
|
||||
: null,
|
||||
),
|
||||
Text(
|
||||
title,
|
||||
@@ -86,3 +91,146 @@ class CardIcon extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class GlassMorphismCardIcon extends StatelessWidget {
|
||||
const GlassMorphismCardIcon({
|
||||
super.key,
|
||||
required this.title,
|
||||
this.svgIcon,
|
||||
|
||||
this.vecIcon,
|
||||
this.onTap,
|
||||
this.titleColor = AppColor.iconColor,
|
||||
this.spacing = 20,
|
||||
this.titleStyle,
|
||||
this.borderColor = AppColor.blueNormal,
|
||||
this.backgroundColor = Colors.white,
|
||||
this.borderRadius = 35,
|
||||
this.width = 180,
|
||||
this.labelHeight = 80,
|
||||
this.height = 180,
|
||||
this.borderWidth = 1,
|
||||
this.iconWidth = 48,
|
||||
this.iconHeight = 48,
|
||||
this.iconColor,
|
||||
}) : assert((svgIcon != null) || (vecIcon != null), 'Either svgIcon or vecIcon must be provided');
|
||||
|
||||
final String title;
|
||||
final int spacing;
|
||||
|
||||
final String? svgIcon;
|
||||
final String? vecIcon;
|
||||
final VoidCallback? onTap;
|
||||
final Color titleColor;
|
||||
final TextStyle? titleStyle;
|
||||
|
||||
final Color borderColor;
|
||||
final Color backgroundColor;
|
||||
final double borderRadius;
|
||||
final double borderWidth;
|
||||
|
||||
final double width;
|
||||
final double height;
|
||||
final double labelHeight;
|
||||
|
||||
//icon
|
||||
final double iconWidth;
|
||||
final double iconHeight;
|
||||
final Color? iconColor;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: width.w,
|
||||
height: height.h,
|
||||
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(35.r)),
|
||||
child: InkWell(
|
||||
onTap: onTap,
|
||||
child: Stack(
|
||||
children: [
|
||||
|
||||
Positioned.fill(
|
||||
child: Container(
|
||||
width: width.w,
|
||||
height: height.h,
|
||||
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white54,
|
||||
border: Border.all(width: 1, color: Colors.white),
|
||||
borderRadius: BorderRadius.circular(borderRadius),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black12,
|
||||
blurRadius: 5,
|
||||
offset: Offset(10, 12),
|
||||
),
|
||||
],
|
||||
|
||||
),
|
||||
child: InkWell(
|
||||
onTap: onTap,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(height: labelHeight.h + 35.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8.w),
|
||||
child: Text(
|
||||
title,
|
||||
textAlign: TextAlign.center,
|
||||
style:
|
||||
titleStyle ??
|
||||
AppFonts.yekan20Bold.copyWith(color: titleColor, height: 1.20),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Container(
|
||||
height: labelHeight.h,
|
||||
width: width.w,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(borderRadius),
|
||||
topRight: Radius.circular(borderRadius),
|
||||
),
|
||||
gradient: LinearGradient(
|
||||
colors: [Color(0xff00b6bc), Color(0xff003ae0)],
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
),
|
||||
),
|
||||
child: Center(
|
||||
child: svgIcon != null
|
||||
? SvgGenImage(svgIcon!).svg(
|
||||
fit: BoxFit.cover,
|
||||
width: iconWidth.w,
|
||||
height: iconHeight.h,
|
||||
colorFilter: ColorFilter.mode(iconColor ?? Colors.white, BlendMode.srcIn),
|
||||
)
|
||||
: SvgGenImage.vec(vecIcon!).svg(
|
||||
fit: BoxFit.fill,
|
||||
width: iconWidth.w,
|
||||
height: iconHeight.h,
|
||||
colorFilter: ColorFilter.mode(iconColor ?? Colors.white, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class TitleCheckBox extends StatelessWidget {
|
||||
const TitleCheckBox({
|
||||
super.key,
|
||||
this.selectedColor,
|
||||
this.unSelectedColor,
|
||||
required this.title,
|
||||
required this.isSelected,
|
||||
required this.onChanged,
|
||||
});
|
||||
|
||||
final Color? selectedColor;
|
||||
final Color? unSelectedColor;
|
||||
final String title;
|
||||
final bool isSelected;
|
||||
final Function(bool?) onChanged;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
onChanged(!isSelected);
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
Checkbox(
|
||||
value: isSelected,
|
||||
onChanged: onChanged,
|
||||
activeColor: selectedColor ?? AppColor.blueNormal,
|
||||
visualDensity: VisualDensity.compact,
|
||||
side: BorderSide(width: 1.w, color: AppColor.unselectTextColor),
|
||||
),
|
||||
Text(
|
||||
title,
|
||||
style: isSelected
|
||||
? AppFonts.yekan14Bold.copyWith(color: AppColor.blueNormal)
|
||||
: AppFonts.yekan12.copyWith(color: AppColor.unselectTextColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -82,9 +82,10 @@ Widget buildUnitRow({
|
||||
TextStyle? titleStyle,
|
||||
TextStyle? valueStyle,
|
||||
TextStyle? unitStyle,
|
||||
EdgeInsetsGeometry? padding,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 4.0),
|
||||
padding: padding ?? const EdgeInsets.symmetric(vertical: 4.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
|
||||
@@ -3,6 +3,7 @@ export 'bottom_navigation/r_bottom_navigation.dart';
|
||||
export 'bottom_navigation/wave_bottom_navigation.dart';
|
||||
export 'bottom_sheet/base_bottom_sheet.dart';
|
||||
export 'bottom_sheet/date_picker_bottom_sheet.dart';
|
||||
export 'check_box/check_box_widget.dart';
|
||||
//buttons
|
||||
export 'buttons/buttons.dart';
|
||||
export 'card/card_icon_widget.dart';
|
||||
|
||||
Reference in New Issue
Block a user