import 'package:flutter/material.dart';

import 'package:google_fonts/google_fonts.dart';

import '../res/app_colors.dart';

class LabelText extends StatelessWidget {
  final String text;
  final EdgeInsets margin;
  final Color labelColor;
  final bool underLineColor;
  final double fontSize;
  final bool underline;
  final FontWeight fontWeight;
  final bool fontFamily;
  final TextStyle? style;
  LabelText(
    this.text, {
    this.margin = EdgeInsets.zero,
    this.labelColor = AppColors.colorTitle,
    this.underLineColor = false,
    this.fontSize = 18,
    this.underline = false,
    this.fontWeight = FontWeight.w600,
    this.fontFamily = false,
    this.style,
    Key? key,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Text(
      text,
      maxLines: 3,
      textAlign: TextAlign.center,
      style: style ??
          TextStyle(
            color: labelColor,
            fontSize: fontSize,
            fontFamily: fontFamily ? GoogleFonts.roboto().toString() : "",
            fontWeight: fontWeight,
            decoration:
                underline ? TextDecoration.underline : TextDecoration.none,
            decorationColor:
                underLineColor ? AppColors.colorTitle : Colors.transparent,
          ),
    );
  }
}
