You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
car_common_app/lib/views/advertisement/custom_add_button.dart

37 lines
1.1 KiB
Dart

import 'package:flutter/material.dart';
import 'package:mc_common_app/extensions/string_extensions.dart';
import 'package:mc_common_app/theme/colors.dart';
class CustomAddButton extends StatelessWidget {
final Widget icon;
final String text;
final Color bgColor;
final bool needsBorder;
final Function() onTap;
const CustomAddButton({Key? key, required this.text, required this.onTap, required this.icon, required this.bgColor, required this.needsBorder}) : super(key: key);
@override
Widget build(BuildContext context) {
return InkWell(
onTap: onTap,
child: Container(
height: 80,
decoration: BoxDecoration(color: bgColor, border: needsBorder ? Border.all(width: 2, color: MyColors.darkPrimaryColor) : null),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
icon,
const SizedBox(width: 10),
text.toText(
fontSize: 15,
isBold: true,
color: MyColors.lightTextColor,
),
],
),
),
);
}
}