logo

Crowdly

(Code Examination) Examine the following code. Identify potential issues wi...

✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.

(Code Examination)

Examine the following code. Identify potential issues with this approach to reading a JSON file and suggest improvements.

 

 

Future<List<String>> loadItems() async {

  final file = File('/storage/emulated/0/items.json');

  final jsonString = await file.readAsString();

  final List<dynamic> items = jsonDecode(jsonString);

  return items.cast<String>();

}

Більше питань подібних до цього

Хочете миттєвий доступ до всіх перевірених відповідей на e-learning.msa.edu.eg?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!