Skip to content

This is a Dart package that provides all states and local governments in Nigeria

License

Notifications You must be signed in to change notification settings

IdrisAdeyemi01/nigerian_states_and_lga

Repository files navigation

Nigerian States and Local Governments

This is a package that helps provide a full list of Nigerian states and local governments.

Features

  • List of all states in Nigeria
  • List of all local governments in Nigeria
  • List of local governments per state in Nigeria

Getting started

🎖 Installing

dependencies:
    nigerian_states_and_lga: ^latest_version

💡 Import

import 'package:nigerian_states_and_lga/nigerian_states_and_lga.dart';

🛠️ Usage

To get the states

DropdownButton<String>(
                  key: const ValueKey('States'),
                  value: stateValue,
                  isExpanded: true,
                  hint: const Text('Select a Nigerian state'),
                  items: NigerianStatesAndLGA.allStates
                      .map<DropdownMenuItem<String>>((String value) {
                    return DropdownMenuItem<String>(
                      child: Text(value),
                      value: value,
                    );
                  }).toList(),

To get LGAs per state

DropdownButton<String>(
                  key: const ValueKey('Local governments'),
                  value: lgaValue,
                  isExpanded: true,
                  hint: const Text('Select a Lga'),
                  items:
                      statesLga.map<DropdownMenuItem<String>>((String value) {
                    return DropdownMenuItem<String>(
                      child: Text(value),
                      value: value,
                    );
                  }).toList(),

To get all LGAs at a go

DropdownButton<String>(
                  value: selectedLGAFromAllLGAs,
                  isExpanded: true,
                  hint: const Text('Select a Lga'),
                  items: NigerianStatesAndLGA.getAllNigerianLGAs()
                      .map<DropdownMenuItem<String>>((String value) {
                    return DropdownMenuItem<String>(
                      child: Text(value),
                      value: value,
                    );
                  }).toList(),

🎥 Sample

nigerian_states_and_lga.mp4

🪲 Bugs/ Feature Requests

If you encounter any issues while using the package, feel free to open an issue. If you also feel the package is missing any feature, please raise an issue on Github.

🫂 Contribution

Contributions are highly welcomed. Please free free to open a pull request so that we can all improve this package together.

About

This is a Dart package that provides all states and local governments in Nigeria

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published