29 lines
605 B
Dart
29 lines
605 B
Dart
// Author: fengshengxiong
|
|
// Date: 2024/6/5
|
|
// Description: 跑马灯
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:widget_marquee/widget_marquee.dart';
|
|
|
|
class MyMarqueeText extends StatelessWidget {
|
|
const MyMarqueeText({
|
|
super.key,
|
|
required this.text,
|
|
required this.textStyle,
|
|
});
|
|
|
|
final String text;
|
|
final TextStyle textStyle;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Marquee(
|
|
delay: Duration.zero,
|
|
duration: const Duration(seconds: 40),
|
|
pause: Duration.zero,
|
|
gap: 80,
|
|
child: Text(text, style: textStyle),
|
|
);
|
|
}
|
|
}
|