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

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.


for me it was that I imported import 'package:path/path.dart';

even though i didn't really need it, so it didn't recognize the context.


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