Code Monkey home page Code Monkey logo

geoao's Introduction

Geoao

A package that uses Geoao API developed by ATECH, aiming to expose all geolocation data referring to Angola.

MainClass ✨

/// GEOAO
///
/// Geolocation Angola - Geoao
/// A package that uses geoao API aiming to expose all geolocation data referring to Angola
class Geoao {
  ProvinceService _provinceService;
  CountyService _countyService;

  Geoao() {
    _provinceService = ProvinceService();
    _countyService = CountyService();
  }

  /// getProvinces
  ///
  /// Get all provinces of Angola
  Future<ProvincesModel> getProvinces() async =>
      await _provinceService.getProvinces();

  /// getCounties
  ///
  /// Get all counties from a province [provinceId] of Angola
  Future<List<CountyModel>> getCounties(int provinceId) async =>
      await _countyService.getCounties(provinceId);

  /// getCountyById
  ///
  /// Get specific county [countyId] of Angola
  Future<CountyModel> getCountyById(int countyId) async =>
      await _countyService.getCountyById(countyId);
}

Usage 🤳

import 'package:geoao/geoao.dart';

_exampleUsage() async {
  Geoao _geoao;
  
  ProvincesModel provincesModel;
  List<CountyModel> counties;
  CountyModel countyModel;

  int idProvince = 1;
  int idCounty = 1;

  provincesModel = await _geoao.getProvinces();
  counties = await _geoao.getCounties(idProvince);
  countyModel = await _geoao.getCountyById(idCounty);
}

MIT License

geoao's People

Contributors

josuemcapita avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.