import 'package:boilerplate/core/styles/my_dimensions.dart';
import 'package:boilerplate/core/styles/my_font.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';

class ContactButton extends StatelessWidget {
  final String iconAsset;
  final String title;
  final VoidCallback onPressed;

  const ContactButton({
    Key? key,
    required this.iconAsset,
    required this.title,
    required this.onPressed,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: this.onPressed,
      child: Container(
        padding: EdgeInsets.all(MyDimens.dimen14),
        decoration: BoxDecoration(
          borderRadius: BorderRadius.circular(15),
          gradient: LinearGradient(colors: [
            Color(0xFFEF5943),
            Color(0xFFB5222A),
          ]),
        ),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.center,
          mainAxisSize: MainAxisSize.min,
          children: [
            SvgPicture.asset(
              this.iconAsset,
              width: MyDimens.dimen24,
            ),
            SizedBox(width: MyDimens.dimen10),
            Text(
              this.title,
              style: MyFont.medium16.copyWith(
                color: Colors.white,
              ),
            ),
          ],
        ),
      ),
    );
  }
}
