nigeria_states_geography 1.0.0
nigeria_states_geography: ^1.0.0 copied to clipboard
A Flutter package that provides a list of Nigeria states and their capitals
Nigerian States Geography #
A Flutter package that provides a list of Nigeria states and their capitals.
Features #
- List of States: Provides a comprehensive list of all Nigerian states.
- State and Capital : Includes a model of both state and capital.
- Data Loading: Loads state data from a local JSON file for efficient and offline access.
- Clean and Well-Documented Code: Includes Dartdoc comments for easy understanding and API documentation generation.
Usage #
-
Add the package as a dependency to your
pubspec.yaml:dependencies: nigeria_states_geography: <latest_version> -
Import the package in your Dart file:
import 'package:nigeria_states_geography/nigeria_states_geography.dart'; -
Use the
getAllStatesAndCapitals()function:Future<void> _loadStates() async { try { final states = await getAllStatesAndCapitals(); setState(() { _states = states; }); } catch (e) { print('Error loading states: $e'); SnackBar( content: Text( e.toString(), ), ); } } @override Widget build(BuildContext context) { return Scaffold( // ... your UI using the _states list or check the example folder for usage ); }
Documentation #
- API Documentation: Generated API documentation is available in the
docdirectory.
Installation #
flutter pub get