Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error: [dart] The argument type 'Context' can't be assigned to the parameter type 'BuildContext'. [argument_type_not_assignable]

How can I fix this? I'm not sure if it is caused by the Flutter update. enter image description here

like image 386
jerahmeel Avatar asked Nov 21 '18 06:11

jerahmeel


3 Answers

There is some conflict with the import 'package:path/path.dart'. In my case, I put an alias in it import 'package:path/path.dart' as Path and it worked.

like image 83
Rafael Terada Avatar answered Nov 17 '22 13:11

Rafael Terada


Use this.context instead of context.

like image 36
Rahul Rathore Avatar answered Nov 17 '22 14:11

Rahul Rathore


For me it was causing because of the js library ( import 'dart:js';). I removed it and the error was gone.

like image 14
Taba Avatar answered Nov 17 '22 12:11

Taba