why this file automatically creates itself generated_plugin_registrant.dart

Viewed 7330

everytime i create a project and i run pubspec.yaml this file gets generated automatically

generated_plugin_registrant.dart

enter image description here

this file was generated as soon as i added my pubspec.yaml from a different project and run pub get what should i do to remove this problem and what does it mean to have this file can i delete it and continue with my project?

1 Answers

generated_plugin_registrant.dart is an automatically generated file that is required to compile your Flutter project as a web application:

This file generated_plugin_registrant. dart exists only to support the web. It exists if Flutter is web-enabled and there is at least one package that has asked for it.

Source

If you're not using Flutter to create a web application, you could drop the web support with the following command:

flutter config --no-enable-web
Related