πŸ”₯ Go Rest app

In this project, we are going to build a user management app using flutter. we have used go rest api to make http request methods. This API provides all sorts of methods that we wanted: GET, POST, PUT and DELETE. We will call all End-points (users/todos/posts/comments) provided to us by go rest api using the Dio package in our app. we have performed different operations like select, add, edit, and remove user and also user posts/todos and comments.

❗️ Api limitation

β€’ In user endpoint there are ten user objects by default. if you delete any of them, it will be replaced with new json object. This means that the length of user list will always equal to ten and you can’t create more than ten user objects. This will also be true for when you want to add query parameter to the users.

β€’ Request methods PUT, POST, PATCH, DELETE needs access token, which needs to be passed with “Authorization” header as Bearer token that I have already put my own token inside app, but if you get Unauthorized Error (401) go to this link and get new token and replace it with old token in api_config file inside core directory.

β€’ The data are not permanent and will be changed or deleted every 20 minutes to 1 hour.

πŸ–Ό Screenshots

User screen Create-update User Todo screen Post screen
Date picker Time picker Create-update post Comment Screen
Error state Empty state Warning dialog Progress dialog

🧩 Entity Relationship Diagram (ERD)

πŸš€ Features

β€’ Performing CRUD operation using Dio and go rest api
β€’ Converting JSON string to an equivalent dart object and vice versa with json serializable
β€’ Implementing Interceptors, Global configuration and timeout for api calls
β€’ Exception Handling with Dio interceptor and Dartz
β€’ Displaying error type to the user through the alert dialogs
β€’ Colorize api info like request, response, body and exceptions in Debug console log
β€’ Read, create, update and delete user
β€’ Filter users by status activity or gender
β€’ Read, create, update and delete user todos
β€’ Filter todos by status 
β€’ Read, create, update and delete user posts
β€’ Deleting and updating post items by swipe them to right or left side
β€’ Displaying user comments for each post 
β€’ Get date/time from user by Date/Time picker
β€’ State management with GetX 

πŸ“‚ Directory Structure

πŸ“‚lib
 │───main.dart  
 β”‚β”€β”€β”€πŸ“‚common  
 β”‚   β”‚β”€β”€β”€πŸ“‚network
 β”‚   β”‚   │──dio_client.dart
 β”‚   β”‚   │──dio_exception.dart
 β”‚   β”‚   └──dio_interceptor.dart
 β”‚   β”‚β”€β”€β”€πŸ“‚widget
 β”‚   β”‚   │──date_time_picker.dart
 β”‚   β”‚   │──drop_down.dart
 β”‚   β”‚   │──empty_widget.dart
 β”‚   β”‚   │──popup_menu.dart
 β”‚   β”‚   │──spinkit_indicator.dart
 β”‚   β”‚   └──text_input.dart 
 β”‚   β””β”€β”€β”€πŸ“‚dialog
 β”‚       │──create_dialog.dart
 β”‚       │──delete_dialog.dart
 β”‚       │──progress_dialog.dart
 β”‚       └──retry_dialog.dart
 β”‚β”€β”€β”€πŸ“‚core 
 β”‚   │──api_config.dart
 β”‚   │──app_asset.dart
 β”‚   │──app_extension.dart
 β”‚   │──app_string.dart
 β”‚   │──app_style.dart
 β”‚   └──app_theme.dart
 β””β”€β”€β”€πŸ“‚featurs
     β”‚β”€β”€β”€πŸ“‚comment
     β”‚    β”‚β”€β”€β”€πŸ“‚controller
     β”‚    β”‚   └──comment_controller.dart
     β”‚    β””β”€β”€β”€πŸ“‚data
     β”‚        β”‚β”€β”€β”€πŸ“‚model
     β”‚        β”‚   │──comment.dart
     β”‚        β”‚   └──comment.g.dart
     β”‚        β””β”€β”€β”€πŸ“‚provider
     β”‚            β””β”€β”€πŸ“‚remote
     β”‚               └──comment_api.dart
     β”‚β”€β”€β”€πŸ“‚post
     β”‚    β”‚β”€β”€β”€πŸ“‚controller
     β”‚    β”‚   └──post_controller.dart
     β”‚    β”‚β”€β”€β”€πŸ“‚data
     β”‚    β”‚   β”‚β”€β”€β”€πŸ“‚model
     β”‚    β”‚   β”‚   │──post.dart
     β”‚    β”‚   β”‚   └──post.g.dart
     β”‚    β”‚   β””β”€β”€β”€πŸ“‚provider
     β”‚    β”‚       β””β”€β”€πŸ“‚remote
     β”‚    β”‚          └──psot_api.dart
     β”‚    β””β”€β”€β”€πŸ“‚view  
     β”‚        β””β”€β”€πŸ“‚screen
     β”‚           │──post_detail_screen.dart
     β”‚           └──post_list_screen.dart
     β”‚β”€β”€β”€πŸ“‚todo
     β”‚    β”‚β”€β”€β”€πŸ“‚controller
     β”‚    β”‚   └──todo_controller.dart
     β”‚    β”‚β”€β”€β”€πŸ“‚data
     β”‚    β”‚   β”‚β”€β”€β”€πŸ“‚model
     β”‚    β”‚   β”‚   │──todo.dart
     β”‚    β”‚   β”‚   └──todo.g.dart
     β”‚    β”‚   β””β”€β”€β”€πŸ“‚provider
     β”‚    β”‚       β””β”€β”€πŸ“‚remote
     β”‚    β”‚          └──todo_api.dart
     β”‚    β””β”€β”€β”€πŸ“‚view  
     β”‚        β”‚β”€β”€πŸ“‚screen
     β”‚        β”‚  └──todo_list_screen.dart
     β”‚        β””β”€β”€πŸ“‚widget
     β”‚            │──circle_container.dart
     β”‚            └──todo_list_item.dart
     β””β”€β”€β”€πŸ“‚user
          β”‚β”€β”€β”€πŸ“‚controller
          β”‚   └──user_controller.dart
          β”‚β”€β”€β”€πŸ“‚data
          β”‚   β”‚β”€β”€β”€πŸ“‚model
          β”‚   β”‚   │──user.dart
          β”‚   β”‚   └──user.g.dart
          β”‚   β””β”€β”€β”€πŸ“‚provider
          β”‚       β””β”€β”€πŸ“‚remote
          β”‚          └──user_api.dart
          β””β”€β”€β”€πŸ“‚view  
              β”‚β”€β”€πŸ“‚screen
              β”‚  └──user_list_screen.dart
              β””β”€β”€πŸ“‚widget
                 └──status_container.dart

πŸ“• Dependencies

Name Link
get https://pub.dev/packages/get
dio https://pub.dev/packages/dio
json_annotation https://pub.dev/packages/json_annotation
json_serializable https://pub.dev/packages/json_serializable
build_runner https://pub.dev/packages/build_runner
logger https://pub.dev/packages/logger
dartz https://pub.dev/packages/dartz
intl https://pub.dev/packages/intl
flutter_spinkit https://pub.dev/packages/flutter_spinkit

🎯 Other flutter projects

Project Name Stars
Japanese restaurant app GitHub stars
Office furniture store app GitHub stars
Ecommerce app GitHub stars

GitHub

View Github