nigerian_states_and_lga 1.0.0 copy "nigerian_states_and_lga: ^1.0.0" to clipboard
nigerian_states_and_lga: ^1.0.0 copied to clipboard

A package that provides the list of all states and local goverments in Nigeria

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 #

https://user-images.githubusercontent.com/49335945/172783733-3caeb79b-7686-49ec-83e7-8a0b83e5a280.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.

35
likes
150
pub points
83%
popularity

Publisher

unverified uploader

A package that provides the list of all states and local goverments in Nigeria

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on nigerian_states_and_lga