kenya_administrative_divisions 1.0.2 copy "kenya_administrative_divisions: ^1.0.2" to clipboard
kenya_administrative_divisions: ^1.0.2 copied to clipboard

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..

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 #

  1. Fork this repository.
  2. Create new branch with feature name.
  3. Create your feature.
  4. Run the tests and ensure they pass
  5. Commit and set commit message with feature name.
  6. Push your code to your fork repository.
  7. Create pull request.

Support #

If you like this project, you can support me with starring ⭐ this repository.

License #

MIT

Made with 💜

2
likes
135
points
14
downloads

Publisher

unverified uploader

Weekly Downloads

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..

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

path, resource_portable

More

Packages that depend on kenya_administrative_divisions