Kenya Administrative Divisions
The Kenya Administrative Divisions is a package that provides functionality to retrieve administrative divisions data about Kenya. It includes information about counties, constituencies, and wards.
Table of Contents
Installation
To install the package, add it to your pubspeck.yaml
Run
dart pub add kenya_administrative_divisions
Usage
Getting started
To use the library, instantiate the KenyaAdministrativeDivisions class:
import 'package:kenya_administrative_divisions/kenya_administrative_divisions.dart';
// Instantiate the class
final kenyaAdmin = KenyaAdministrativeDivisionsBase();
Methods available
Get All
// Get All the data
final data = kenyaAdmin.getAll;
Get Counties
// Get all county names
final counties = kenyaAdmin.getCounties();
// Get details of a county by passing its code
final county = kenyaAdmin.getCounties(1);
// Get details of a county by passing its name
final county = kenyaAdmin.getCounties('Nairobi');
Get Constituencies
// Get all constituency names
final constituencies = kenyaAdmin.getConstituencies();
// Get constituencies of a county by passing its code
final constituency = kenyaAdmin.getConstituencies(1);
// Get details of a constituency by passing its name
final constituency = kenyaAdmin.getConstituencies('Westlands');
Get wards
// Get all ward names
final wards = kenyaAdmin.getWards();
// Get wards of a county by passing its code
final wards = kenyaAdmin.getWards(1);
// Get wards of a county by passing its name
final wards = kenyaAdmin.getWards('Nairobi');
// Get wards of a county and constituency by passing county code/name and constituency name
final wards = kenyaAdmin.getWards(1, 'Westlands');
final wards = kenyaAdmin.getWards('Nairobi', 'Westlands');
// Get wards of a constituency by passing the constituency name
final wards = kenyaAdmin.getWards(null, 'Westlands');
Contributing
- Fork this repository.
- Create new branch with feature name.
- Create your feature.
- Run the tests and ensure they pass
- Commit and set commit message with feature name.
- Push your code to your fork repository.
- Create pull request.
Support
If you like this project, you can support me with starring ⭐ this repository.
License
Made with 💜
Libraries
- kenya_administrative_divisions
- Support for doing something awesome.