53 lines
1.4 KiB
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,
|
|
),
|
|
);
|
|
}
|
|
} |