This is the legacy documentation for our original platform, Cades. Our platform has evolved significantly since then to offer both app and website creation capabilities. Find the new documentation here.

API Integration

Step 1: Network Layer Setup

Let’s create a dependency injection folder using get_it package to manage API instances and follow clean architecture principles. This centralized approach helps avoid duplicating API instances across the codebase.

in the di folder /injection.dart Use get_it to setup the dependency injection graph of the project and call this in the main function for now import dio for network calls and set it up as a singleton dependency

Step 2: API Client Configuration

After setting up Dio and dependency injection, we’ll create a centralized API client class to handle all network requests efficiently and maintain clean architecture principles.

I want to integrate api into the app use retrofit to do the same
my base api url is 'https://api.videogptai.com/api' setup the retrofit class in api folder inject the api in the injection file in di use the singleton dio

Step 3: First API Integration

Let’s now integrate our first API, with this prompt:

Step 4: Authentication Header Setup

Add authentication to API requests.

I want to create a dio interceptor that if logged in it will add the user token in the authorization header for requests as Bearer

Step 5: Second API Integration



This will integrate the library api for the videos user has created with the existing UI.