This repository has been archived on 2024-10-18. You can view files and clone it, but cannot push or open issues or pull requests.
ftc_patient_app/lib/view/custom_widgets/custom_text_widget.dart

53 lines
1.4 KiB
Dart

import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
class CustomTextWidget extends StatelessWidget {
final String text;
final double? fontSize;
final bool isExpanded;
final FontWeight? fontWeight;
final Color? fontColor;
final String? fontFamily;
final Alignment? alignment;
final TextOverflow? textOverflow;
final TextAlign textAlign;
final TextDecoration textDecoration;
final int? maxLines;
const CustomTextWidget({
Key? key,
required this.text,
this.fontSize,
this.fontWeight,
this.fontColor,
this.alignment,
this.isExpanded = true,
this.fontFamily,
this.textOverflow,
this.textAlign = TextAlign.center,
this.textDecoration = TextDecoration.none,
this.maxLines,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
alignment: alignment,
width: isExpanded ? MediaQuery.of(context).size.width : null,
child: Text(
text,
textAlign: textAlign,
maxLines: maxLines,
style: TextStyle(
fontSize: fontSize,
fontWeight: fontWeight,
color: fontColor ?? CustomAppColors.kIconColor,
fontFamily: fontFamily,
decoration: textDecoration,
decorationColor: fontColor ?? CustomAppColors.kIconColor,
),
overflow: textOverflow,
),
);
}
}