dart_strapi 1.0.0 copy "dart_strapi: ^1.0.0" to clipboard
dart_strapi: ^1.0.0 copied to clipboard

outdated

http client for strapi, you can access your models by name or the custom ones using the http client.

example/dart_strapi_example.dart

import 'package:dart_strapi/dart_strapi.dart';

void main() async {
  final strapiClient = Strapi(
    'https://server.app',
    // token: 'token',
  );

  // strapiClient.token = 'token';

  // final records = await strapiClient.find('lines', queryParameters: {});
  // print(records);

  // final record =
  //     await strapiClient.findOne('lines', '5e44abbb7764fe87bd959434');
  // print(record);

  // final count = await strapiClient.count(
  //   'lines',
  //   queryParameters: {'color': '#0054A4'},
  // );
  // print(count);

  // final page = await strapiClient.create(
  //   'pages',
  //   {'id': 'lalala', 'title': 'lalala test'},
  //   options: Options(
  //     headers: {
  //       'Authorization':
  //           'Bearer token'
  //     },
  //   ),
  // );

  // final page = await strapiClient.update(
  //   Entry(
  //     collectionName: 'pages',
  //     id: Identifier.string('607a5dbea8c1a80015805eed'),
  //     data: {
  //       'title': 'lalaa test 2',
  //     },
  //   ),
  //   options: Options(
  //     headers: {
  //       'Authorization':
  //           'Bearer token'
  //     },
  //   ),
  // );
  // print(page);

  // final page = await strapiClient.delete(
  //   Entry(
  //     collectionName: 'pages',
  //     id: Identifier.string('607a5bffa8c1a80015805eec'),
  //   ),
  //   options: Options(
  //     headers: {
  //       'Authorization':
  //           'Bearer token'
  //     },
  //   ),
  // );
  // print(page);

  // final page = await strapiClient.deleteById(
  //   'pages',
  //   '607a5be6a8c1a80015805eeb',
  //   options: Options(
  //     headers: {
  //       'Authorization':
  //           'Bearer token'
  //     },
  //   ),
  // );
  // print(page);

  // final page = await strapiClient.update(
  //   Entry(
  //     collectionName: 'pages',
  //     id: Identifier.string('607a5852a8c1a80015805eea'),
  //     data: {
  //       'title': 'Ex3',
  //     },
  //   ),
  // );
  // print(page);
}
25
likes
0
points
83
downloads

Publisher

verified publisherxantiagoma.com

Weekly Downloads

http client for strapi, you can access your models by name or the custom ones using the http client.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

dio, freezed_annotation

More

Packages that depend on dart_strapi