igot_http_service_helper 0.4.0
igot_http_service_helper: ^0.4.0 copied to clipboard
This package contains a set of high-level functions and classes that make it easy to consume HTTP resources. It's multi-platform (mobile, desktop, and browser) and supports multiple implementations wi [...]
Features #
TODO: This package contains a set of high-level functions and classes that make it easy to consume HTTP resources. It's multi-platform (mobile, desktop, and browser) and supports multiple implementations with DATA Base support with respect to given TTL.
1.TTL Handling:
-
When TTL is Null: The system will call the API directly and return the response.
-
When TTL is Not Null: The system will check the database for existing data.
-
If Data Exists: It will calculate the duration since the data was last updated.
-
If the Duration is Within the TTL: The system will return the data from the database.
-
If the Duration Exceeds the TTL: The system will call the API, update the data in the database, and return the API response.
-
If Data Does Not Exist: The system will call the API, store the data in the database, and return the API response.
2.Force Update Handling:
- If the forceUpdate flag is set to true, the system will: Call the API to retrieve the latest data. Update the data and TTL in the database. Return the updated data.
Getting started #
Using
import 'package:igot_http_service_helper/services/http_service.dart';
var response = await HttpService.get( ttl: Duration(hours: hour), apiUri: Uri.parse('example.com'); );
Usage #
TODO: Used By Igot Project for HTTP calls
Configuration Details #
Flutter 3.35.7 • channel stable • https://github.com/flutter/flutter.git Framework • revision adc9010625 (4 months ago) • 2025-10-21 14:16:03 -0400 Engine • hash 6b24e1b529bc46df7ff397667502719a2a8b6b72 (revision 035316565a) (3 months ago) • 2025-10-21 14:28:01.000Z Tools • Dart 3.9.2 • DevTools 2.48.0