void main() async {
WidgetsFlutterBinding.ensureInitialized();
await dotenv.load(fileName: "./env");
var documentsDirectory = await path_provider.getApplicationDocumentsDirectory();
Hive.init(documentsDirectory.path);
Hive.registerAdapter(UserDataModelAdapter());
Hive.registerAdapter(TaskHiveModelAdapter());
runApp(const MyApp());
}
My file directory:

Error on build:
No file or variants found for asset: .env.
Error detected in pubspec.yaml:
Target debug_android_application failed: Exception: Failed to bundle asset files.
FAILURE: Build failed with an exception.
I have the .env set up in pubspec.yaml like so:
assets:
- .env
How can Flutter don't find the .env file on startup?
.envfile.OR
pubspec.yamlfile to ensure that the.envfile is present in the assets.Make sure that you have read access to the
.envfile.