2026-04-09 21:32:23 +08:00

64 lines
1.7 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:yumi/ui_kit/components/text/marquee_gradient_text.dart';
Widget text(
String content, {
double fontSize = 12,
Color textColor = Colors.white,
int maxLines = 1,
TextDecoration decoration = TextDecoration.none,
FontWeight fontWeight = FontWeight.w400,
TextOverflow overflow = TextOverflow.ellipsis,
TextAlign? textAlign,
double? maxWidth,
double? letterSpacing,
double? lineHeight,
FontStyle? fontStyle,
List<Shadow>? shadows,
TextDirection? textDirection,
}) {
return Container(
constraints: BoxConstraints(maxWidth: maxWidth??double.infinity),
child: Text(
content,
overflow: overflow,
maxLines: maxLines,
textAlign: textAlign,
style: TextStyle(
fontSize: fontSize.sp,
color: textColor,
fontWeight: fontWeight,
decoration: decoration,
letterSpacing: letterSpacing,
height: lineHeight,
fontStyle: fontStyle,
shadows: shadows,
decorationThickness: 2,
decorationColor: textColor,
),
textDirection: textDirection,
),
);
}
Widget socialchatNickNameText(
String content, {
double fontSize = 12,
int maxLines = 1,
Color textColor = Colors.white,
double? maxWidth,
String? type,
bool needScroll = false,
FontWeight fontWeight = FontWeight.w400,
double? speed,
double? sweepSpeed,
double? gapWidth,
}) {
if (content.isEmpty) {
return Container();
}
return text(content,fontSize: fontSize, maxLines: maxLines,maxWidth: maxWidth, textColor: textColor, fontWeight: fontWeight);
}