matchFile static method

String? matchFile({
  1. required List<String> files,
  2. required String name,
  3. String extension = 'png',
  4. int scale = 1,
  5. Locale? locale,
})

Implementation

static String? matchFile({
  required List<String> files,
  required String name,
  String extension = 'png',
  int scale = 1,
  Locale? locale,
}) {
  final localized = matchLocale(files: files, name: 'logo', extension: 'png');
  if (localized.isEmpty) return null;
  final scaled = matchScale(
    files: localized,
    name: 'logo',
    extension: 'png',
    scale: scale,
  );
  final file = files.singleWhere((element) => element == scaled);
  return file;
}