import 'package:flutter/material.dart';
import 'package:tour_travel_agr/resource/colors.dart';
import 'package:tour_travel_agr/resource/style.dart';

class CustomButton extends StatelessWidget {
  const CustomButton({
    Key? key,
    required this.text,
    this.colorText = Colors.white,
    this.colorButton,
    this.onTap,
  }) : super(key: key);

  final String text;
  final Color colorText;
  final Color? colorButton;
  final void Function()? onTap;

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onTap,
      child: Container(
        width: double.infinity,
        height: 45,
        decoration: BoxDecoration(
          borderRadius: BorderRadius.circular(5),
          color: (colorButton == null) ? ColorManager.primary : colorButton,
        ),
        child: Center(
          child: Text(
            text,
            style: getRegularStyle(
              color: colorText,
            ),
          ),
        ),
      ),
    );
  }
}
