Skip to content

celikdemirrberkay/internship_project

Repository files navigation

Albayrak Group Internship Project

Getting Started

Run the following codes in terminal to run the project :

  dart run build_runner build

Environment Variable

To run this project you will need to add the following environment variables to the .env file in the assets/env folder

BASE_URL = "API BASE URL"

Project Structure

The foldering of the project is as follows ->

  • Core
  • Feature
  • Model
  • Service

Service Structure

Null management in projects has always been a challenge for me. For this reason, I managed null in the service layer of the project. I completely eliminated the responsibility of null to the view and view-model. Thanks to the Resource class, I return exception type in case of error or null data. In this way, operations on the view and view-model side become much easier. I share the resource class below.

sealed class Resource<T> {
  const Resource({this.data, this.exceptionType});

  final T? data;

  final ExceptionTypes? exceptionType;
}

class SuccessState<T> extends Resource<T> {
  const SuccessState(T data) : super(data: data);
}

class ErrorState<T> extends Resource<T> {
  const ErrorState(ExceptionTypes type, [T? data]) : super(data: data, exceptionType: type);
}

class LoadingState<T> extends Resource<T> {
  const LoadingState() : super();
}

Screenshots

1 2 3 Screenshot 2024-08-16 at 14 40 06

About

My internship project in Albayrak Group

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published