init method

  1. @override
Future<Either<Failure, Unit>> init({
  1. required String page,
})
override

Implementation

@override
Future<Either<Failure, Unit>> init({required String page}) async {
  try {
    await create.page(page);
    await create.main(page);
    await create.analysisOptions();
    await create.injectionContainer();
    await pubspec.clean();
    for (final p in _initialPackages) {
      await pubspec.addPackage(InputConverter.enumToString(p));
    }
    return const Right(unit);
  } on IOFailure catch (e) {
    return Left(e);
  } on ReaderFailure catch (e) {
    return Left(e);
  } catch (e) {
    return Left(UnknownFailure(cause: e.toString()));
  }
}