24 lines
599 B
Dart
24 lines
599 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: const Duration(seconds: 2),
|
|
duration: const Duration(seconds: 6),
|
|
pause: Duration.zero,
|
|
gap: 60,
|
|
child: Text(text, style: textStyle),
|
|
);
|
|
}
|
|
} |