OpenMediacenterMobileFlutter/lib/api/actor_api.dart

13 lines
328 B
Dart
Raw Normal View History

2022-08-30 21:25:21 +00:00
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;
}