Skip to content

text with setState not work #27

Closed
Closed
@leapit

Description

@leapit

text with setState not work

code like this

setState(() {
  text = ["AWESOME", "OPTIMISTIC", "DIFFERENT"];
});

.....

RotateAnimatedTextKit(
      text: text,
    ),

When text state change

setState(() {
  text = ["A", "B", "C","D","E"];
});

will got error

I/flutter (10175): The following RangeError was thrown building AnimatedBuilder(animation: AnimationController#386c6(⏭
I/flutter (10175): 1.000; paused), dirty, state: _AnimatedState#4fb90):
I/flutter (10175): RangeError (index): Invalid value: Not in range ...

Flutter:

[✓] Flutter (Channel stable, v1.5.4-hotfix.2, on Mac OS X 10.13.6 17G6030, locale en-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.4)
[✓] VS Code (version 1.33.1)
[✓] Connected device (1 available)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions