StrapiCollection class
basic queries against a collection object of strapi
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
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
Static Methods
-
count(
String collection) → Future< int> -
count the objects in the
collection
, throws StrapiResponseException if response is failed -
create(
{required String collection, required Map< String, dynamic> data}) → Future<Map< String, dynamic> > -
create a new object at
collection
with the provideddata
, returns the object with aid
, throws StrapiResponseException if response is failed -
customEndpoint(
{required String collection, required String endPoint, Map< String, String> ? params, String? method, int? limit}) → Future<List< Map< >String, dynamic> > -
use this to reach a custom endpoint you've setup for a strapi collection
if you setup a endpoint name
xEndPoint
for collection namexCollection
and the resulting route is/xCollection/xEndPoint
, then you have to use this method like this -
delete(
{required String collection, required String id}) → Future< Map< String, dynamic> > -
deletes a object with
id
atcollection
-
findMultiple(
{required String collection, int? limit}) → Future< List< Map< >String, dynamic> > -
returns all objects in a collection, run get query against a
collection
, limit the number of objects in the response by settinglimit
, throws StrapiResponseException if response is failed -
findOne(
{required String collection, required String id}) → Future< Map< String, dynamic> > -
gets a single object in a
collection
withid
, throws StrapiResponseException if response is failed -
update(
{required String collection, required String id, required Map< String, dynamic> data}) → Future<Map< String, dynamic> > -
update a object with
id
atcollection
with the newdata
, returns updated object, throws StrapiResponseException if response is failed