navigator error in flutter navigator error The argument type 'JsObject' can't be assigned to the parameter type 'BuildContext'

Viewed 24
Future<void> gotologin() async {
    await Future.delayed(
      Duration(seconds: 3),
    );
    Navigator.of(context).push(  // <- The argument type 'JsObject' can't be assigned to the parameter type 'BuildContext'
      MaterialPageRoute(
        builder: (context) => Login(),
      ),
    );
  }
1 Answers

enter image description here

Your are having another variable of type JsObject that is named Context , try to rename that variable and try again or you can past the full page code and I will be happy to help you with it !

Related