configure method

Future<LauncherIconConfig> configure()

Interactively collects launcher icon configuration from the user.

Returns the configured LauncherIconConfig.

Implementation

Future<LauncherIconConfig> configure() async {
  LoggerService.blank();

  LoggerService.info('Launcher Icons');

  final imagePath = PromptService.ask(
    'Icon image path',
    defaultValue: 'assets/images/app_icon.png',
  );

  final android = PromptService.confirm(
    'Generate Android icons?',
    defaultValue: true,
  );

  final ios = PromptService.confirm(
    'Generate iOS icons?',
    defaultValue: true,
  );

  final web = PromptService.confirm(
    'Generate Web icons?',
    defaultValue: true,
  );

  final adaptiveBackground = PromptService.ask(
    'Adaptive background',
    defaultValue: '#FFFFFF',
  );

  final adaptiveForeground = PromptService.ask(
    'Adaptive foreground',
    defaultValue: imagePath,
  );

  final adaptiveMonochrome = PromptService.ask(
    'Adaptive monochrome (optional)',
    defaultValue: '',
  );

  final removeAlphaIos = PromptService.confirm(
    'Remove alpha for iOS?',
    defaultValue: true,
  );

  return LauncherIconConfig(
    imagePath: imagePath,
    android: android,
    ios: ios,
    web: web,
    adaptiveBackground: adaptiveBackground,
    adaptiveForeground: adaptiveForeground,
    adaptiveMonochrome: adaptiveMonochrome.isEmpty ? null : adaptiveMonochrome,
    removeAlphaIos: removeAlphaIos,
  );
}