getCountries method

Future<List<Country>> getCountries()

Get available countries from the API

Implementation

Future<List<Country>> getCountries() async {
  try {
    final List<Map<String, dynamic>> countriesData = await _plugin.getCountries();
    return countriesData.map((data) => Country.fromJson(data)).toList();
  } catch (e) {
    throw Exception('Failed to get countries: $e');
  }
}