# 🚀 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`:

```yaml id="a1b2c3"
dependencies:
  csc: ^0.0.8
```

Then run:

```bash id="d4e5f6"
flutter pub get csc
```

---

## 🚀 Usage

Import the package:

```dart id="g7h8i9"
import 'package:csc/csc.dart';
```

### Basic Example

```dart id="j1k2l3"
csc.countries
```

## 🧩 API Reference

### Enum NameLang

* arabic
* english
* farsi
* kurdish
* russian

### 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

```id="p7q8r9"
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

