mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-15 09:45:22 +00:00
46 lines
1.0 KiB
Dart
46 lines
1.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
|
|
|
class CustomText extends StatelessWidget {
|
|
const CustomText(this.text,
|
|
{super.key,
|
|
this.style,
|
|
this.textAlign,
|
|
this.onTap,
|
|
this.minLines,
|
|
this.maxLines,
|
|
this.textDirection,
|
|
this.fontSize,
|
|
this.fontColor,
|
|
this.fontWeight});
|
|
|
|
final String text;
|
|
final TextStyle? style;
|
|
final TextAlign? textAlign;
|
|
final Function()? onTap;
|
|
final int? minLines;
|
|
final int? maxLines;
|
|
final TextDirection? textDirection;
|
|
|
|
final double? fontSize;
|
|
final Color? fontColor;
|
|
|
|
final FontWeight? fontWeight;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return SelectableText(
|
|
text,
|
|
style: style!.copyWith(
|
|
fontSize: fontSize,
|
|
color: fontColor ?? ColorsManager.textPrimaryColor,
|
|
fontWeight: fontWeight),
|
|
textAlign: textAlign,
|
|
onTap: onTap,
|
|
minLines: minLines,
|
|
maxLines: maxLines,
|
|
textDirection: textDirection,
|
|
);
|
|
}
|
|
}
|