2

enter image description here

it's flutter I don't want to see textwidget4. A row widget is at most one line.

I don't want to show the passed textwidget when the length of the row exceeds the SizedBox What should I do?

won
  • 73
  • 7

1 Answers1

0

plaese look at https://pub.dev/packages/visibility_detector

I think with this library you can Understand which widget is not Completely Visible . (visiblePercentage)

@override
Widget build(BuildContext context) {
  return VisibilityDetector(
    key: Key('my-widget-key'),
    onVisibilityChanged: (visibilityInfo) {
      var visiblePercentage = visibilityInfo.visibleFraction * 100;
      debugPrint(
          'Widget ${visibilityInfo.key} is ${visiblePercentage}% visible');
    },
    child: someOtherWidget,
  );
}

second Step

Show/hide widgets in Flutter programmatically

Sajjad
  • 2,593
  • 16
  • 26