@@ -4,63 +4,50 @@ import 'package:provider/provider.dart';
44
55class FlowyText extends StatelessWidget {
66 final String title;
7- final TextOverflow overflow;
7+ final TextOverflow ? overflow;
88 final double fontSize;
99 final FontWeight fontWeight;
1010 final TextAlign ? textAlign;
1111 final Color ? color;
12+
1213 const FlowyText (
1314 this .title, {
1415 Key ? key,
15- this .overflow = TextOverflow .ellipsis ,
16+ this .overflow = TextOverflow .clip ,
1617 this .fontSize = 16 ,
1718 this .fontWeight = FontWeight .w400,
1819 this .textAlign,
1920 this .color,
2021 }) : super (key: key);
2122
2223 const FlowyText .semibold (this .title,
23- {Key ? key,
24- this .fontSize = 16 ,
25- TextOverflow ? overflow,
26- this .color,
27- this .textAlign})
24+ {Key ? key, this .fontSize = 16 , this .overflow, this .color, this .textAlign})
2825 : fontWeight = FontWeight .w600,
29- overflow = overflow ?? TextOverflow .ellipsis,
3026 super (key: key);
3127
3228 const FlowyText .medium (this .title,
33- {Key ? key,
34- this .fontSize = 16 ,
35- TextOverflow ? overflow,
36- this .color,
37- this .textAlign})
29+ {Key ? key, this .fontSize = 16 , this .overflow, this .color, this .textAlign})
3830 : fontWeight = FontWeight .w500,
39- overflow = overflow ?? TextOverflow .ellipsis,
4031 super (key: key);
4132
4233 const FlowyText .regular (this .title,
43- {Key ? key,
44- this .fontSize = 16 ,
45- TextOverflow ? overflow,
46- this .color,
47- this .textAlign})
34+ {Key ? key, this .fontSize = 16 , this .overflow, this .color, this .textAlign})
4835 : fontWeight = FontWeight .w400,
49- overflow = overflow ?? TextOverflow .ellipsis,
5036 super (key: key);
5137
5238 @override
5339 Widget build (BuildContext context) {
5440 final theme = context.watch <AppTheme >();
55- return Text (title,
56- softWrap: false ,
57- textAlign: textAlign,
58- overflow: overflow,
59- style: TextStyle (
60- color: color ?? theme.textColor,
61- fontWeight: fontWeight,
62- fontSize: fontSize,
63- fontFamily: 'Mulish' ,
64- ));
41+ return Text (
42+ title,
43+ textAlign: textAlign,
44+ overflow: overflow ?? TextOverflow .clip,
45+ style: TextStyle (
46+ color: color ?? theme.textColor,
47+ fontWeight: fontWeight,
48+ fontSize: fontSize,
49+ fontFamily: 'Mulish' ,
50+ ),
51+ );
6552 }
6653}
0 commit comments