OpenMediacenterMobileFlutter/lib/api/actor_api.dart

13 lines
328 B
Dart

import 'dart:convert';
import '../types/actor.dart';
import 'api.dart';
Future<List<Actor>> loadAllActors() async {
final data = await API.query("actor", "getAllActors", {});
final d = (jsonDecode(data) ?? []) as List<dynamic>;
final actors = d.map((e) => Actor.fromJson(e)).toList(growable: false);
return actors;
}