dvStudioGraphRoutes function
The routes the project graph in root lists, or none when there is no
graph to read.
Implementation
List<Map<String, Object?>> dvStudioGraphRoutes(String? root) {
if (root == null) return const <Map<String, Object?>>[];
try {
final Object? decoded = jsonDecode(utf8.decode(DVAssetSources.at(root).file('graph.json')!.bytes()));
final Object? routes = decoded is Map ? decoded['routes'] : null;
return <Map<String, Object?>>[
if (routes is List)
for (final Object? route in routes)
if (route is Map && route['path'] is String)
route.cast<String, Object?>(),
];
} on Object {
return const <Map<String, Object?>>[];
}
}