so I have this simple code:
import 'package:provider/provider.dart';
class DataModel with ChangeNotifier{
bool _isLoading = true;
set isLoading(bool value){
_isLoading = value;
notifyListeners();
}
get isLoading => _isLoading;
}
ChangeNotifier and notifyListeners() aren't recognized.
My dependencies:
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
provider: ^4.3.3
I'm very confused as to why is it happening, this is the exact setup in the installation page (and it worked in other projects).
This project is also connected to a git lab project, I don't know if it is related.
btw, it's not like that with other keywords that are in the provider package - it perfectly recognizes ChangeNotifierProvider i.e
DataModel
? – Adnan Alshamicreate: (context) => DataModel(),
– Amit Ritter