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.
To install the package, add it to your pubspeck.yaml
dependencies:
kenya_administrative_divisions: ^1.0.0
Then run
dart pub get
To use the library, instantiate the KenyaAdministrativeDivisions
class:
import 'package:kenya_administrative_divisions/kenya_administrative_divisions.dart';
// Instantiate the class
final kenyaAdmin = KenyaAdministrativeDivisionsBase();
// Get All the data
final data = kenyaAdmin.getAll;
// 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 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 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');
- 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.
If you like this project, you can support me with starring ⭐ this repository.
Made with 💜