getUserName static method

Future<String?> getUserName()

Implementation

static Future<String?> getUserName() async {
  final file = await _getConfigFile();

  if (!file.existsSync()) return null;

  final content = await file.readAsString();
  final data = jsonDecode(content);

  return data['name'];
}