nigeria_states_geography 1.0.0 copy "nigeria_states_geography: ^1.0.0" to clipboard
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 #

  1. Add the package as a dependency to your pubspec.yaml:

    dependencies:
      nigeria_states_geography: <latest_version> 
    
  2. Import the package in your Dart file:

    import 'package:nigeria_states_geography/nigeria_states_geography.dart';
    
  3. 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 doc directory.

Installation #

flutter pub get
1
likes
160
points
12
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Flutter package that provides a list of Nigeria states and their capitals

Repository (GitHub)

License

BSD-3-Clause (license)

Dependencies

flutter, path

More

Packages that depend on nigeria_states_geography