m3_lightmeter/screenshots/utils/parse_configs.dart
Vadim f62f658be8
Automated release screenshots generation (#177)
* added system overlays for iPhone 8 Plus & iPhone 13 Pro

* add device frame (wip)

* scale device frame (wip)

* add text to screenshots (wip)

* added screenshots config json

* reorganized screenshot models

* cleanup

* added fonts for dark screenshots

* typo

* store raw screenshots

* added standalone script to update screenshots

* wip

* refined screenshots naming

* skip metering layout dialog screenshot

* parse ipad name

* added assets for Pixel 6

* typo

* added text for incident light metering

* reorganized store script

* typo

* wip

* synced outlined icons

* added timer screen to screenshot generator

* constrained timer screen timeline for tablets

* added timer screenshot title

* typo

* revised scripts

* track release screenshots

* Update README.md

* iphone 6.5" -> iphone 6.7"

* Update google_play_resources.md

* softened screenshot font colors

* cleanup
2024-05-21 19:13:33 +02:00

14 lines
569 B
Dart

import 'dart:convert';
import 'dart:io';
import '../models/screenshot_config.dart';
Map<String, ScreenshotConfig> parseScreenshotConfigs([String locale = 'en']) {
final configPath = 'screenshots/assets/content/screenshot_titles_$locale.json';
final data = jsonDecode(File(configPath).readAsStringSync()) as Map<String, dynamic>;
final entries = (data['screenshots'] as List).map((value) {
final config = ScreenshotConfig.fromJson(value as Map<String, dynamic>);
return MapEntry(config.screenshotName, config);
});
return Map.fromEntries(entries);
}