feat: filters added to home page
This commit is contained in:
61
lib/feature/common/presentation/widgets/app_button.dart
Normal file
61
lib/feature/common/presentation/widgets/app_button.dart
Normal file
@@ -0,0 +1,61 @@
|
||||
|
||||
import '../../../../food_delivery_client.dart';
|
||||
|
||||
|
||||
class AppButton extends StatelessWidget {
|
||||
const AppButton({
|
||||
super.key,
|
||||
required this.name,
|
||||
required this.onPressed,
|
||||
this.margin,
|
||||
this.backgroundColor,
|
||||
this.borderRadius,
|
||||
this.height,
|
||||
this.textColor,
|
||||
this.width,
|
||||
this.action,
|
||||
this.trailing,
|
||||
this.mainAxisAlignment,
|
||||
});
|
||||
|
||||
final String name;
|
||||
final VoidCallback onPressed;
|
||||
final EdgeInsets? margin;
|
||||
final Color? backgroundColor;
|
||||
final Color? textColor;
|
||||
final double? borderRadius;
|
||||
final double? width;
|
||||
final double? height;
|
||||
final Widget? action;
|
||||
final Widget? trailing;
|
||||
final MainAxisAlignment? mainAxisAlignment;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Bounceable(
|
||||
onTap: onPressed,
|
||||
duration: TimeDelayConst.durationMill150,
|
||||
child: Container(
|
||||
width: width ?? double.infinity,
|
||||
height: height ?? 55,
|
||||
margin: margin,
|
||||
alignment: Alignment.center,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
decoration: BoxDecoration(
|
||||
color: backgroundColor ?? AppColors.c000000,
|
||||
borderRadius: BorderRadius.circular(borderRadius ?? 0),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: mainAxisAlignment ?? MainAxisAlignment.center,
|
||||
children: [
|
||||
action ?? AppUtils.kSizedBox,
|
||||
Text(name, style: AppTextStyles.size16Bold.copyWith(
|
||||
color: AppColors.cFFFFFF
|
||||
)),
|
||||
trailing ?? AppUtils.kSizedBox,
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user