The argument type ‘JsObject’ can’t be assigned to the parameter type ‘BuildContext’ for sliding up panel feature of PROFILE page for flutter program
// Panel Body
SingleChildScrollView _panelBody(ScrollController controller) {
double hPadding = 40;
return SingleChildScrollView(
controller: controller,
physics: const ClampingScrollPhysics(),
child: Column(
children: <Widget>[
Container(
padding: EdgeInsets.symmetric(horizontal: hPadding),
height: MediaQuery.of(context).size.height * 0.35,
^ context is the one that sending error signals which is The argument type 'JsObject' can't be assigned to the parameter type 'BuildContext'. I imported the dart.js that it recommended yet it did not fix the error
)
],
),
);
}
2
Answers
Add context in the _panelBody function
Then wherever you use method _panelBody use as below code
You need to pass the buildContext in the _panelBody function.
And call the widget as