fetch method

  1. @override
Future<Map<String, dynamic>> fetch({
  1. required String apiToken,
  2. required String repositoryId,
})
override

Implementation

@override
Future<Map<String, dynamic>> fetch({
  required String apiToken,
  required String repositoryId,
}) async {
  try {
    final client = Dio(
      BaseOptions(
        baseUrl: "https://api.localesync.com",
        headers: {
          "Repository-Token": apiToken,
        },
      ),
    );
    final response = await client.get<Map<String, dynamic>>(
      "/cli/translation/word/repository/$repositoryId",
    );
    return response.data!;
  } catch (e) {
    rethrow;
  }
}