// 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,
    this.enable = true,
  });

  final String text;
  final TextStyle textStyle;
  final bool enable;

  @override
  Widget build(BuildContext context) {
    return Marquee(
      delay: Duration.zero,
      duration: Duration(seconds: enable ? 16 : 0),
      pause: Duration.zero,
      gap: 80,
      child: Text(text, style: textStyle),
    );
  }
}
