renameWeb static method

Future<void> renameWeb(
  1. String filePath,
  2. String appName
)

Implementation

static Future<void> renameWeb(String filePath, String appName) async {
  String data = await File(filePath).readAsString();
  Map<String, dynamic> document = jsonDecode(data);
  document.containsKey('name') ? document['name'] = appName : logMessage('');
  document.containsKey('short_name')
      ? document['short_name'] = appName
      : logMessage('');
  var encoder = const JsonEncoder.withIndent("     ");
  String prettified = encoder.convert(document);
  await saveFile(filePath, prettified);
  printFinishMessage('web');
}