1

I am facing a problem with Flutter semantics with the scroll view. If there is a SingleChildScrollView of ListView the flutter semantics announce an unlabeled item.

The code is really simple.

 ListView.builder(
                          controller: _scrollController,
                          itemCount: 10,
                          scrollDirection: Axis.horizontal,
                          shrinkWrap: true,
                          itemBuilder: (_, index) {
                          return Container(width: 100, height 200);
                          }

I have attached a screenshot of what the Accessibility inspector is giving me. Under that, you can see there is a FlutterSemanticScrollView object is created.

Accessibility Inspector result

The issue only occurs when there is enough content available for scrolling.

I really appreciate any help you can provide.

2
  • Did you manage to resolve the issue? Commented Mar 6 at 11:22
  • 1
    @AhmadF, I have found that the real device is not showing this. But it varies on devices. Flutter Semantics tree is not mature I feel. Commented Mar 7 at 10:46

1 Answer 1

0

Try to used Sementic instead of Container

return Semantics(
      label: 'Item ${index + 1}',
      hint: 'Double tap to interact',
      child: Container(
        width: 100,
        height: 200,
        color: Colors.blueAccent,
    child: Center(
          child: Text(
            'Item ${index + 1}',
            style: TextStyle(color: Colors.white),
          ),
        ),
      ),
    );
Sign up to request clarification or add additional context in comments.

1 Comment

It doesn't help me. Actually the Container I have added in the question is a dummy widget. It is actually a Semantic widget.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.