You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
doctor_app_flutter/lib/widgets/shared/app_texts_widget.dart

70 lines
1.9 KiB
Dart

6 years ago
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
6 years ago
// OWNER : Ibrahim albitar
6 years ago
// DATE : 12-04-2020
// DESCRIPTION : Customization for Texts in app
6 years ago
6 years ago
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 TextOverflow textOverflow;
6 years ago
AppText(this.data,
{this.color = Colors.black,
this.fontWeight = FontWeight.normal,
this.fontSize,
this.fontFamily = 'Poppins',
6 years ago
this.margin,
this.marginTop = 0,
this.marginRight = 0,
this.marginBottom = 0,
this.marginLeft = 0,
this.visibility = true,
this.textAlign,
this.textOverflow,
this.backGroundcolor = Colors.white});
6 years ago
@override
6 years ago
_AppTextState createState() => _AppTextState();
6 years ago
}
6 years ago
class _AppTextState extends State<AppText> {
6 years ago
@override
Widget build(BuildContext context) {
return 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: widget.textOverflow ?? TextOverflow.clip,
style: TextStyle(
color: widget.color,
fontWeight: widget.fontWeight,
fontSize: widget.fontSize ?? (SizeConfig.textMultiplier * 2),
fontFamily: widget.fontFamily,
// backgroundColor:widget.backGroundcolor
),
6 years ago
),
);
6 years ago
}
6 years ago
}