https://github.com/iniakunhuda/flutter_riverpod_strapi
Simple CRUD Riverpod Flutter + Strapi API + Offline Database with Isar
https://github.com/iniakunhuda/flutter_riverpod_strapi
dart flutter flutter-riverpod riverpod
Last synced: about 1 year ago
JSON representation
Simple CRUD Riverpod Flutter + Strapi API + Offline Database with Isar
- Host: GitHub
- URL: https://github.com/iniakunhuda/flutter_riverpod_strapi
- Owner: iniakunhuda
- License: mit
- Created: 2023-03-31T01:42:44.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-24T07:58:10.000Z (about 2 years ago)
- Last Synced: 2025-04-01T07:45:07.049Z (about 1 year ago)
- Topics: dart, flutter, flutter-riverpod, riverpod
- Language: Dart
- Homepage:
- Size: 1.77 MB
- Stars: 29
- Watchers: 1
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Flutter Riverpod Strapi



[](https://github.com/iniakunhuda/flutter_riverpod_strapi/blob/master/LICENSE)
[](https://flutter.dev/)
[](https://github.com/iniakunhuda/flutter_riverpod_strapi)
## Quick start
This is a normal flutter app. You should follow the instructions in the [official documentation](https://flutter.io/docs/get-started/install).
This project uses **Riverpod** to separate the business logic with UI itself.
And also on this project uses **Clean Architecture** approach to separate each feature.
## Structure 🔥
├── lib
│ ├── core
│ │ ├── api
│ │ │ └── endpoints.dart
│ │ ├── constant
│ │ │ └── constant.dart
│ │ ├── database
│ │ │ └── database.dart
│ │ ├── helper
│ │ │ ├── app_exception.dart
│ │ │ ├── app_router.dart
│ │ │ └── network_detector.dart
│ │ └── http
│ │ ├── api_provider.dart
│ │ └── api_response.dart
│ ├── features
│ │ ├── contact
│ │ │ ├── data
│ │ │ │ ├── database
│ │ │ │ │ └── contact_db.dart
│ │ │ │ ├── datasource
│ │ │ │ │ ├── contact_datasource.dart
│ │ │ │ │ ├── contact_local_datasource.dart
│ │ │ │ │ └── contact_remote_datasource.dart
│ │ │ │ ├── dto
│ │ │ │ │ ├── contact_dto.dart
│ │ │ │ │ ├── error_dto.dart
│ │ │ │ ├── model
│ │ │ │ │ ├── contact_model.dart
│ │ │ │ └── state
│ │ │ │ ├── contact_state.dart
│ │ │ ├── domain
│ │ │ │ ├── provider
│ │ │ │ │ └── contact_provider.dart
│ │ │ │ └── repository
│ │ │ │ ├── contact_repository_impl.dart
│ │ │ │ └── contact_repository.dart
│ │ │ └── presentation
│ │ │ ├── screen
│ │ │ │ ├── create_screen.dart
│ │ │ │ ├── detail_screen.dart
│ │ │ │ ├── edit_screen.dart
│ │ │ │ └── list_screen.dart
│ │ │ └── widget
## Features
- Add, Edit and Remove Contact
- Rest API from Strapi
- Offline database
- Script manager with derry
- Clean Architecture
## Banner Design
## Built With 🛠
* [Clean Architecture](https://medium.com/ruangguru/an-introduction-to-flutter-clean-architecture-ae00154001b0) - The blueprint for a modular system, which strictly follows the design principle called separation of concerns.
* [Dartz](https://pub.dev/packages/dartz) - Functional Programming in Dart
* [Derry](https://pub.dev/packages/derry) - A script manager to help you define script shortcuts and use them effortlessly
* [Dio](https://github.com/flutterchina/dio/) - A type-safe HTTP client.
* [Freezed](https://pub.dev/packages/freezed) - Code generation for immutable classes
* [Go Router](https://pub.dev/packages/go_router) - Route management Flutter
* [Isar Database](https://isar.dev/) - Local Database
* [Riverpod](https://riverpod.dev/) - State management with upgrade from provider
* [Strapi API](https://strapi.io/) - Handle rest api from Headless CMS
* Handle State - (Loading, No Data, Has Data, Error)
## Author
* **Miftahul Huda**
Don't forget to follow me, fork and give me a ⭐
## How to run app
Install package
```
flutter pub get
```
Run in terminal to generate freezed file
```
derry build
```
Copy .env.example to .env and fill credential from Strapi
```
// assets/.env
API_KEY_STRAPI=xxx
API_BASE_URL=xxx
```
## Strapi Setup
Install Strapi in your local computer
Run project
```
npm start
```
Create collection structure like this