🚀 csc

A powerful and easy-to-use Flutter library that helps developers to fetch information about each country.


📌 Table of Contents

  • About
  • Features
  • Installation
  • Usage
  • API Reference
  • Example
  • Project Structure
  • License
  • Author

📖 About

csc is a reusable package built with Flutter that simplifies more details about each country.

It is designed to be:

  • ⚡ Fast
  • 🎯 Easy to use
  • 🧩 Highly customizable
  • 📱 Cross-platform (Android, iOS, Web, Desktop, Linux, macOS)

✨ Features

  • ✔️ The library provides a database for countries, states, and cities.
  • ✔️ You can search for countries and states.
  • ✔️ Clean and modular architecture

📦 Installation

Add this to your pubspec.yaml:

dependencies:
  csc: ^1.0.0

Then run:

flutter pub get csc

🚀 Usage

Import the package:

import 'package:csc/csc.dart';

Basic Example

csc.countries

🧩 API Reference

csc.countries

Returns List of all countries.

csc.countryExistsByName(String name)

Returns bool if the country exists by name.

csc.countryExistsByCode(String code)

Returns bool if the country exists by country code.

csc.countryByName(String name)

Returns Country with details about the country by name

csc.countryByCode(String code)

Returns Country with details about the country by country code

csc.countryHasStatesByName(String countryName)

Returns bool to check if the country has states by country name.

csc.countryHasStatesByCode(String countryCode)

Returns bool to check if the country has states by country code.

csc.countryStatesByName(String countryName)

Returns List of country states by country name.

csc.countryStatesByCode(String countryCode)

Returns List of country states by country code.

csc.stateExistsByName(String countryName, String stateName)

Returns bool if the state exists by country and state name.

csc.stateExistsByCode(String countryCode, String stateCode)

Returns bool if the state exists by country and state code.

csc.stateByName(String countryName, String stateName)

Returns State with details about the state by country and state name.

csc.stateByCode(String countryCode, String stateCode)

Returns State with details about the state by country and state code.

csc.stateHasCitiesByName(String countryName, String stateName)

Returns bool if the state has cities by country and state name.

csc.stateHasCitiesByCode(String countryCode, String stateCode)

Returns bool if the state has cities by country and state code.

csc.stateCitiesByName(String countryName, String stateName)

Returns List state cities by country and state name.

csc.stateCitiesByCode(String countryCode, String stateCode)

Returns List state cities by country and state code.

csc.cityExistsByName(String countryName, String stateName, String cityName)

Returns bool to check if the city exists by country, state and city name.

csc.cityExistsByCode(String countryCode, String stateCode, String cityName)

Returns bool to check if the city exists by country, state and city code.

csc.cityByName(String countryName, String stateName, String cityName)

Returns City with details about the state by country, state and city name.

csc.cityByCode(String countryCode, String stateCode, String cityName)

Returns City with details about the state by country, state and city code.


📂 Project Structure

lib/
 ├── csc.dart
 ├── src/
 │   ├── type.dart
 │   assets/
 │   ├── csc.json

📄 License

This project is licensed under the MIT License.


👨‍💻 Author

Aburas GitHub: https://github.com/ebrahimAburas/locations

Libraries

csc