LoadDataHttpSources<T extends BaseEntityDataModel> class
A Dio-based implementation of IBaseLoadSource for HTTP endpoints.
This class handles remote data loading by making GET requests to a backend API. It supports query parameters, path parameters, and identifiers.
- Implemented types
Constructors
-
LoadDataHttpSources({String baseUrl = "", required String url, Map<
String, dynamic> ? query, Map<String, dynamic> ? params, String? id, T dataBuilder(Map<String, dynamic> jsondata, String? docId)?}) - Standard constructor for LoadDataHttpSources.
-
LoadDataHttpSources.list({String? baseUrl = "", required String url, Map<
String, dynamic> ? query, Map<String, dynamic> ? params, T dataBuilder(Map<String, dynamic> jsondata, String? docId)?}) -
Factory for creating a LoadDataHttpSources instance for list data loading.
factory
-
LoadDataHttpSources.single({String? baseUrl = "", required String url, required String id, Map<
String, dynamic> ? query, Map<String, dynamic> ? params, T dataBuilder(Map<String, dynamic> jsondata, String? docId)?}) -
Factory for creating a LoadDataHttpSources instance for single data loading.
factory
Properties
- baseUrl ↔ String
-
The base URL for the HTTP requests.
getter/setter pair
-
dataBuilder
↔ T Function(Map<
String, dynamic> jsondata, String? docId)? -
Optional builder function to construct the data model from JSON.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- id ↔ String?
-
The unique identifier of a single item to fetch.
getter/setter pair
-
params
↔ Map<
String, dynamic> ? -
Additional parameters or path parameters.
getter/setter pair
-
query
↔ Map<
String, dynamic> ? -
Query parameters to be included in the request URL.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- url ↔ String
-
The endpoint path relative to the base URL.
getter/setter pair
Methods
-
getDataList(
) → Future< Result< RemoteBaseModel, RemoteBaseModel< >List< >T> > -
Retrieves a list of data items.
override
-
getSingleData(
{String? id}) → Future< Result< RemoteBaseModel, RemoteBaseModel< >T> > -
Retrieves a single data item.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited