init static method
Initialize Nylo
Implementation
static Future<Nylo> init(
{Function? setup, Function(Nylo nylo)? setupFinished}) async {
const String ENV_FILE = String.fromEnvironment(
'ENV_FILE',
defaultValue: '.env',
);
await dotenv.load(fileName: ENV_FILE);
Nylo _nylo = Nylo();
if (setup == null) {
if (setupFinished != null) {
await setupFinished(_nylo);
}
return _nylo;
}
_nylo = await setup();
if (setupFinished != null) {
await setupFinished(_nylo);
}
return _nylo;
}