fluttercandies / extended_text

A powerful extended official text for Flutter, which supports Speical Text(Image,@somebody), Custom Background, Custom overFlow, Text Selection.
MIT License
655 stars 134 forks source link

[Bug report] overflowWidget isn't cleared when data is updated #168

Open burekas7 opened 1 week ago

burekas7 commented 1 week ago

Version

14.1.0

Platforms

dart, Android, iOS

Device Model

Pixel 4, iPhone XR

flutter info

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.2, on macOS 15.0.1 24A348 darwin-arm64, locale en-IL)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.2)
[✓] VS Code (version 1.94.2)
[✓] Connected device (4 available)
    ! Device 9A251FFAZ002HK is not authorized.
      You might need to check your device for an authorization dialog.
[✓] Network resources

• No issues found!

How to reproduce?

When text is long the overflowWidget is shown as expected in the middle. But when the text is updated with another value or cleared, the overflowWidget is still shown.

Example code (optional)

Expanded(
            child: ExtendedText(
              data.value ?? '?',
              maxLines: 1,
              style: defaultValueTextStyle,
              overflowWidget: TextOverflowWidget(
                position: TextOverflowPosition.middle,
                child: Text(
                  "...",
                  style: defaultValueTextStyle,
                ),
              ),
            ),
          )
zmtzawqlp commented 1 week ago

add key for ExtendedText