getValuesDirFileStringValue method

String getValuesDirFileStringValue({
  1. required String attributeName,
  2. required String targetKey,
})

Implementation

String getValuesDirFileStringValue({required String attributeName, required String targetKey}) {
  String result = '';
  final allFiles = FileUtil.listFilesByExtensions(valuesDir.path, ['xml']);
  for (final filePath in allFiles) {
    final tmpFile = File(filePath);
    if (!tmpFile.existsSync()) continue;

    final valueDoc = XmlDocument.parse(tmpFile.readAsStringSync());
    result = getDocStringValue(doc: valueDoc, name: 'string', attributeName: attributeName, targetKey: targetKey);
    if (result.isNotEmpty) {
      break;
    }
  }
  return result;
}