Skip to content

[Bug report] BuildContext isn't returnable from a 'Widget?' function in itemBuilder #149

Description

@renanyoy

Version

1.26.3

Platforms

macOS

Device Model

android

flutter info

blah..

How to reproduce?

The returned type 'BuildContext' isn't returnable from a 'Widget?' function, as required by the closure's context.dartreturn_of_invalid_type_from_closure

              SliverList.builder(
                itemCount: epub!.spine.length,
                itemBuilder: (context, i) =>
                    _sliverListContext = context; // <= error here, can't assign class var with context
                    BookChapter(epub: epub!, chapter: epub!.spine[i]),
              ),

Logs

Example code (optional)

Contact

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions