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());
}
1. 建造错误:
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.
我在《共和国报》中设立了。 yam:
- assets:
- .env
怎样才能在启动时找到 Flu子吗?