flutterblocprovider

flutter_bloc persistent errors


I have been working on an a Flutter app using Flutter_bloc, testing it multiple times per day no problem, tonight and after performing 'flutter pub upgrade' I got this errors; no matter what I do, the errors persist, created totally fresh project with sample counter to test - the same errors, I deleted the entire cache where packages are kept - nothing worked ... what is happening? I am totally stuck

:
 Superclass has no constructor named 'MultiProvider'.
  }) 
:
 super(key
:
 key, providers
:
 listeners, child
:
 child);
       ^^^^^
pub-cache/hosted/pub.dev/flutter_bloc-9.1.0/lib/src/multi_bloc_provider.dart:57:8: Error
:
 Superclass has no constructor named 'MultiProvider'.
  }) 
:
 super(key
:
 key, providers
:
 providers, child
:
 child);
       ^^^^^
pub-cache/hosted/pub.dev/flutter_bloc-9.1.0/lib/src/multi_repository_provider.dart:51:8: Error
:
 Superclass has no constructor named 'MultiProvider'.
  }) 
:
 super(key
:
 key, providers
:
 providers, child
:
 child);
       ^^^^^```

Solution

  • Just do a flutter pub upgrade again.

    The provider 6.1.4 version has a fix for this, the previous version had the error. You can check here:
    https://pub.dev/packages/provider/changelog

    Or set the provider: ^6.1.4 in your pubspec.yaml file.