MarcelGarus / marquee

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
274 stars 113 forks source link

_CastError (Null check operator used on a null value) #83

Open dineshkumar02 opened 1 year ago

dineshkumar02 commented 1 year ago

Hi @MarcelGarus ,

Thank you for this wonderful library, as it is part of my project.

But I have some hiccups while using this library, and sometimes it's crashing by throwing the below error.

_CastError (Null check operator used on a null value)

Screenshot 2022-08-22 012555

I am using the latest version of marquee (2.2.3), and below are my flutter version details.

    • Flutter version 3.0.5 at C:\Users\dines\workspace\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f1875d570e (6 weeks ago), 2022-07-13 11:24:16 -0700
    • Engine revision e85ea0e79c
    • Dart version 2.17.6
    • DevTools version 2.12.2

And I am using marquee as below, which is causing the exception


Container(
            decoration: BoxDecoration(
              color: Theme.of(context).colorScheme.primaryContainer,
            ),
            height: Adaptive.h(4),

            child: Marquee(
              text: announce.announce,
              style: Theme.of(context).textTheme.bodyLarge!.copyWith(
                  color: Theme.of(context).colorScheme.onPrimaryContainer),
              scrollAxis: Axis.horizontal,
              crossAxisAlignment: CrossAxisAlignment.start,
              blankSpace: Adaptive.w(50),
              velocity: 10.0,
              numberOfRounds: null,
              pauseAfterRound: Duration(seconds: 1),
              startPadding: 10.0,
              accelerationDuration: Duration(seconds: 1),
              accelerationCurve: Curves.easeIn,
              decelerationDuration: Duration(milliseconds: 500),
              decelerationCurve: Curves.easeOut,
            ),
          )

This actually happens, while scrolling the Listview where Marqueeis one of it's children.

Please let me know if I miss anything here.

wanhongbo commented 1 year ago

I have the same problems:(

abhilashsajeev commented 1 year ago

@MarcelGarus Same issue here also