wordpress_client 8.0.0 copy "wordpress_client: ^8.0.0" to clipboard
wordpress_client: ^8.0.0 copied to clipboard

outdated

A library to interact with the Wordpress REST API. Supports most of the common endpoints and all of the CRUD operations on the endpoints.

example/wordpress_client_example.dart

// ignore_for_file: avoid_print

import 'package:wordpress_client/src/utilities/extensions/response_extensions.dart';
import 'package:wordpress_client/wordpress_client.dart';

Future<void> main() async {
  final baseUrl = Uri.parse('https://example.com/wp-json/wp/v2');

  // Simple Usage
  final client = WordpressClient(
    baseUrl: baseUrl,
    bootstrapper: (bootstrapper) => bootstrapper.withDebugMode(false).build(),
  );

  client.initialize();

  final postsResponse = await client.media.list(
    ListMediaRequest(
      events: WordpressEvents(
        onError: (error) {
          print(error.toString());
        },
      ),
    ),
  );

  postsResponse.map<void>(
    onSuccess: (response) {
      print(response.message);
    },
    onFailure: (response) {
      print(response.error.toString());
    },
  );
}
37
likes
0
points
1.33k
downloads

Publisher

verified publisherarunprakashg.com

Weekly Downloads

A library to interact with the Wordpress REST API. Supports most of the common endpoints and all of the CRUD operations on the endpoints.

Repository (GitHub)
View/report issues

Topics

#wordpress #fluent #crud #rest

License

unknown (license)

Dependencies

collection, dio, http_parser, meta, path, synchronized

More

Packages that depend on wordpress_client