A Flutter widget that scrolls text infinitely. Provides many customizations including custom scroll directions and velocities, pausing after every round and specifying custom durations and curves for accelerating and decelerating.
MIT License
284
stars
135
forks
source link
The following assertion was thrown building Marquee(dirty, dependencies: [MediaQuery, _LocalizationsScope-[GlobalKey#85ab8], DefaultTextStyle, Directionality], state: _MarqueeState#ab262): #52
I am trying to use the widget marquee and this is the code :
Marquee(
text: 'Some sample text that takes some space.',
style: TextStyle(fontWeight: FontWeight.bold),
scrollAxis: Axis.horizontal,
crossAxisAlignment: CrossAxisAlignment.start,
blankSpace: 20.0,
velocity: 100.0,
pauseAfterRound: Duration(seconds: 1),
showFadingOnlyWhenScrolling: true,
fadingEdgeStartFraction: 0.1,
fadingEdgeEndFraction: 0.1,
numberOfRounds: 3,
startPadding: 10.0,
accelerationDuration: Duration(seconds: 1),
accelerationCurve: Curves.linear,
decelerationDuration: Duration(milliseconds: 500),
decelerationCurve: Curves.easeOut,
);
and this is the error : -
Acceleration and deceleration phase overlap. To fix this, try a combination of these approaches:
Make the text longer, so there's more room to animate within.
Shorten the accelerationDuration or decelerationDuration.
Decrease the velocity, so the duration to animate within is longer.
'package:marquee/marquee.dart':
Failed assertion: line 631 pos 9: '_linearDuration >= Duration.zero'
I am trying to use the widget marquee and this is the code : Marquee( text: 'Some sample text that takes some space.', style: TextStyle(fontWeight: FontWeight.bold), scrollAxis: Axis.horizontal, crossAxisAlignment: CrossAxisAlignment.start, blankSpace: 20.0, velocity: 100.0, pauseAfterRound: Duration(seconds: 1), showFadingOnlyWhenScrolling: true, fadingEdgeStartFraction: 0.1, fadingEdgeEndFraction: 0.1, numberOfRounds: 3, startPadding: 10.0, accelerationDuration: Duration(seconds: 1), accelerationCurve: Curves.linear, decelerationDuration: Duration(milliseconds: 500), decelerationCurve: Curves.easeOut, ); and this is the error : - Acceleration and deceleration phase overlap. To fix this, try a combination of these approaches: