Cant assign widget from map of widgets in flutter

Issue

I am developing a flutter project I have map which I can navigate among screens

but I can’t use it I get this error

The argument type 'Object?' can't be assigned to the parameter type 'Widget?'
this is an error screenshot enter image description here

Solution

Cast your Object to Widget:

body: _pages[_selectedPageIndex]['page'] as Widget

Answered By – iDecode

Answer Checked By – Marie Seifert (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *