createIcons method

  1. @override
void createIcons()
override

Creates icons for this platform.

Implementation

@override
void createIcons() {
  final imgFilePath = path.join(
    context.prefixPath,
    context.webConfig!.imagePath ?? context.config.imagePath!,
  );

  context.logger
      .verbose('Decoding and loading image file at $imgFilePath...');
  final imgFile = utils.decodeImageFile(imgFilePath);
  if (imgFile == null) {
    context.logger.error('Image File not found at give path $imgFilePath...');
    throw FileNotFoundException(imgFilePath);
  }

  // generate favicon in web/favicon.png
  context.logger.verbose('Generating favicon from $imgFilePath...');
  _generateFavicon(imgFile);

  // generate icons in web/icons/
  context.logger.verbose('Generating icons from $imgFilePath...');
  _generateIcons(imgFile);

  // update manifest.json in web/mainfest.json
  context.logger.verbose(
    'Updating ${path.join(context.prefixPath, constants.webManifestFilePath)}...',
  );
  _updateManifestFile();

  // TODO(RatakondalaArun): update index.html in web/index.html
  // as we are using flutter default config we no need
  // to update index.html for now
  // _updateIndexFile();
}