import 'package:badges/badges.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';

// ignore: must_be_immutable
class SalesButton extends StatelessWidget {
  TextStyle? style;
  TextStyle descStyle = TextStyle(fontSize: 14);
  final String title;
  final String price;
  final String desc1;
  final String desc2;
  final String desc3;
  String? desc4;
  final String? badgeText;
  final Color badgeColor;
  final VoidCallback onTap;

  SalesButton(
      {required this.title,
      required this.price,
      required this.desc1,
      required this.desc2,
      required this.desc3,
      this.desc4,
      this.badgeText,
      required this.badgeColor,
      required this.onTap,
      required this.style,
      required this.descStyle}) {
    style = style ??
        GoogleFonts.archivoBlack(
          fontSize: 14,
        );
    desc4 = desc4 ?? "";
  }
  @override
  Widget build(BuildContext context) {
    return GestureDetector(
        onTap: onTap,
        child: Container(
            decoration: BoxDecoration(
              image: DecorationImage(
                image: AssetImage('asset/image/WT_sales_background_3x5.jpg'),
                fit: BoxFit.cover,
                alignment: Alignment.center,
              ),
            ),
            child: Badge(
              position: BadgePosition.topEnd(end: -3, top: -5),
              padding: EdgeInsets.all(5),
              badgeColor: badgeColor,
              borderRadius: BorderRadius.circular(5),
              shape: BadgeShape.square,
              badgeContent: badgeText != null
                  ? Text(badgeText!,
                      style: TextStyle(
                        color: Colors.white,
                        backgroundColor: badgeColor,
                        fontSize: 12,
                      ))
                  : Text("",
                      style: TextStyle(
                        color: Colors.transparent,
                        backgroundColor: Colors.transparent,
                        fontSize: 1,
                      )),
              child: Container(
                  child: Text(
                      "ho") /* Center(
                child: Column(
                  children: [
                    Divider(
                      color: Colors.transparent,
                    ),
                    Divider(
                      color: Colors.transparent,
                    ),
                    Text(
                      title,
                      style: GoogleFonts.archivoBlack(color: Colors.black54),
                    ),
                    Text(
                      price,
                      style: style,
                    ),
                    Container(
                        padding: EdgeInsets.only(top: 5, left: 3, right: 3, bottom: 4), child: Text(desc1, maxLines: 2, style: descStyle)),
                    Container(padding: EdgeInsets.only(left: 3, right: 3, bottom: 4), child: Text(desc2, maxLines: 2, style: descStyle)),
                    Container(padding: EdgeInsets.only(left: 3, right: 3, bottom: 4), child: Text(desc3, maxLines: 2, style: descStyle)),
                    Container(
                        padding: EdgeInsets.only(left: 3, right: 3),
                        child: Text(desc4!, maxLines: 2, style: GoogleFonts.inter(fontSize: 10, color: Colors.red[800])))
                  ],
                ),
              ) */
                  ),
            )));
  }
}
