import 'dart:convert'; import 'food.dart'; import 'package:flutter/services.dart' as root_bundle; class FoodDTO { static Future> readJson() async { final jsonData = await root_bundle.rootBundle.loadString('assets/json/csvjson_full.json'); final list = json.decode(jsonData) as List; return list.map((e) => Food.fromJson(e)).toList(); } }