resolve static method

List<String> resolve(
  1. Map<String, dynamic> options
)

Implementation

static List<String> resolve(Map<String, dynamic> options) {
  final deps = <String>[];

  final stateManagement = options['state_management'] as String? ?? 'none';
  final router = options['router'] as String? ?? 'none';
  final networking = options['networking'] as String? ?? 'none';
  final storage = options['storage'] as String? ?? 'none';
  final localization = options['localization'] as bool? ?? false;

  switch (stateManagement) {
    case 'riverpod':
      deps.add('flutter_riverpod');
      break;
    case 'bloc':
      deps.add('flutter_bloc');
      break;
  }

  switch (router) {
    case 'go_router':
      deps.add('go_router');
      break;
  }

  switch (networking) {
    case 'dio':
      deps.add('dio');
      break;
    case 'http':
      deps.add('http');
      break;
  }

  switch (storage) {
    case 'shared_preferences':
      deps.add('shared_preferences');
      break;
    case 'secure_storage':
      deps.add('flutter_secure_storage');
      break;
  }

  if (localization) {
    deps.add('intl');
  }

  return deps;
}