import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; // OWNER : Ibrahim albitar // DATE : 12-04-2020 // DESCRIPTION : Customization for Texts in app class AppText extends StatefulWidget { final String data; final Color color; final FontWeight fontWeight; final double fontSize; final String fontFamily; final double margin; final double marginTop; final double marginRight; final double marginBottom; final double marginLeft; final bool visibility; final TextAlign textAlign; final Color backGroundcolor; final bool underline; AppText(this.data, {this.color = Colors.black, this.fontWeight = FontWeight.normal, this.fontSize, this.fontFamily = 'WorkSans', this.margin, this.marginTop = 0, this.marginRight = 0, this.marginBottom = 0, this.marginLeft = 0, this.visibility = true, this.textAlign, this.underline = false, this.backGroundcolor = Colors.white}); @override _AppTextState createState() => _AppTextState(); } class _AppTextState extends State { @override Widget build(BuildContext context) { return Visibility( visible: widget.visibility, child: Container( margin: widget.margin != null ? EdgeInsets.all(widget.margin) : EdgeInsets.only( top: widget.marginTop, right: widget.marginRight, bottom: widget.marginBottom, left: widget.marginLeft), child: Text( widget.data, textAlign: widget.textAlign, overflow: TextOverflow.clip, style: TextStyle( color: widget.color, fontWeight: widget.fontWeight, fontSize: widget.fontSize ?? (SizeConfig.textMultiplier * 2), fontFamily: widget.fontFamily, decoration: widget.underline == true ? TextDecoration.underline : TextDecoration.none // backgroundColor:widget.backGroundcolor ), ), ), ); } }