Skip to main content

marquee_transition 1.0.0 copy "marquee_transition: ^1.0.0" to clipboard
marquee_transition: ^1.0.0 copied to clipboard

A smooth, configurable marquee text and widget scrolling transition for Flutter.

Marquee Transition

A high-performance, silky-smooth marquee text and widget scrolling transition for Flutter.

Pub Version Pub Points GitHub Repo License: MIT


Features #

  • πŸ”„ Continuous Endless Wrap-Around: Seamless 60/120fps wrap-around scrolling without pauses, visual jumps, or viewport gaps.
  • πŸͺž Ping-Pong Mirror Mode: Smooth back-and-forth bounce mode with configurable reverse curve, reverse duration, and reverse delays.
  • ⚑ Constant Velocity (px/sec): Maintains uniform scrolling speed across dynamic or localized content lengths with the velocity parameter.
  • ⏸️ Pause on Hover: Automatically pauses scrolling when the mouse cursor hovers over the ticker (desktop & web friendly).
  • 🎨 Fading Edge Gradients: Built-in edge gradient masking with configurable fade ratio (fadingEdgeRatio) for elegant visual fades.
  • 🌟 Custom Dividers: Injects spacing or custom decorative dividers between individual items and loop cycles.
  • πŸŽ›οΈ Imperative State Control: Control playback programmatically via pause(), resume(), and restart().
  • πŸ“ Convenience Constructor: Instant single-string ticker via MarqueeTransition.text(...).
  • 🧭 Multi-directional: Supports horizontal (right, left) and vertical (down, up) scrolling.

Getting Started #

Add marquee_transition to your pubspec.yaml:

dependencies:
  marquee_transition: ^1.0.0

Then import the package in your Dart code:

import 'package:marquee_transition/marquee_transition.dart';

Usage #

1. Seamless Continuous Ticker #

Scroll multiple widgets continuously with a fixed speed and custom divider:

MarqueeTransition(
  velocity: 70.0, // 70 logical pixels per second
  divider: Padding(
    padding: EdgeInsets.symmetric(horizontal: 16),
    child: Icon(Icons.circle, size: 8, color: Colors.blue),
  ),
  children: const [
    Text('πŸš€ Flutter 3.29 is out!'),
    Text('πŸ“¦ MarqueeTransition v1.0.0 released!'),
    Text('⚑ 60/120fps smooth wrap-around!'),
  ],
)

2. Convenience Text Marquee with Fading Edges & Hover-Pause #

MarqueeTransition.text(
  'Breaking news: Widgetarian Showroom is now officially released! Hover over this text to pause scrolling.',
  style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600),
  velocity: 60,
  fadingEdge: true,
  fadingEdgeRatio: 0.12,
  pauseOnHover: true,
)

3. Ping-Pong Mirror Mode #

Scrolls forward to the end of content, pauses briefly, and scrolls back in reverse:

MarqueeTransition(
  mirror: true,
  velocity: 50.0,
  delay: const Duration(seconds: 1),
  reverseDelay: const Duration(seconds: 1),
  curve: Curves.easeInOutCubic,
  reverseCurve: Curves.easeInOutCubic,
  children: [
    for (int i = 0; i < 5; i++)
      Container(
        width: 140,
        margin: const EdgeInsets.symmetric(horizontal: 8),
        color: Colors.amber,
        child: Center(child: Text('Card #$i')),
      ),
  ],
)

4. Imperative State Controls #

final marqueeKey = GlobalKey<MarqueeTransitionState>();

// Render widget
MarqueeTransition(
  key: marqueeKey,
  velocity: 60,
  children: const [Text('Controlled Ticker')],
);

// Control playback
marqueeKey.currentState?.pause();
marqueeKey.currentState?.resume();
marqueeKey.currentState?.restart();

Parameters #

Parameter Type Default Description
children List<Widget> required The widgets displayed inside the marquee.
repeat int -1 Number of cycles to repeat (-1 for infinite loop).
pause bool false Whether the marquee animation is paused.
mirror bool false Whether to play forward and backward in ping-pong mode.
velocity double? null Speed in logical pixels per second. Overrides duration.
duration Duration? 5s Duration of one animation cycle (used when velocity is null).
direction AxisDirection right Direction of scrolling (right, left, down, up).
curve Curve linear Easing curve for forward scrolling.
delay Duration Duration.zero Delay before forward animation begins.
reverseDuration Duration? null Duration for reverse movement in mirror mode.
reverseCurve Curve? null Easing curve for reverse movement in mirror mode.
reverseDelay Duration? null Delay before reverse movement in mirror mode.
pauseOnHover bool false Automatically pause scrolling when mouse hovers over marquee.
fadingEdge bool false Apply soft transparent fading mask to the marquee edges.
fadingEdgeRatio double 0.1 Fraction of marquee width/height to fade (0.0 to 0.5).
divider Widget? null Widget inserted between items and between loop cycles.
onCycleComplete ValueChanged<int>? null Callback triggered after each cycle finishes.
onComplete VoidCallback? null Callback triggered when all repeats have finished playing.

Contributing #

Contributions and bug reports are welcome! Please submit issues and pull requests to the GitHub Repository.

0
likes
0
points
796
downloads

Publisher

verified publisherwidgetarian.com

Weekly Downloads

A smooth, configurable marquee text and widget scrolling transition for Flutter.

Homepage
Repository (GitHub)
View/report issues

Topics

#marquee #scroll #animation #transition #widgetarian

Funding

Consider supporting this project:

buymeacoffee.com
ko-fi.com

License

unknown (license)

Dependencies

flutter

More

Packages that depend on marquee_transition