wordpress_api 0.1.4 copy "wordpress_api: ^0.1.4" to clipboard
wordpress_api: ^0.1.4 copied to clipboard

outdated

A WordPress API client for dart with support for WooCommerce and custom namespaces.

WordPress API client for Dart (Flutter) #

Description #

A WordPress API client for dart with support for WooCommerce and custom namespaces.

Features #

  • Retrieve data from standard WordPress endpoints.
  • Retrieve data from any custom endpoint and namespace

Installation #

In the dependencies: section of your pubspec.yaml, add the following line:

wordpress_api: <latest_version>

Usage #

  • Import the package
import 'package:wordpress_api/wordpress_api';
  • Initialize WPAPI
  WordPressAPI api = WordPressAPI('site.com');
  • Retrieve data from a custom endpoint
  void main() async {
    final wp = WordPressAPI('260blog.com');
    final posts = (await wp.getAsync('posts'))['data'];
    for (final post in posts) {
      print(post['title']['rendered']);
    }
  }
  • Retrieve WP users
  void main() async {
    final wp = WordPressAPI('260blog.com');
    final users = (await wp.getUsers())['data'];
    for (final user in users) {
      print(user['name']);
    }
  }

To Do #

  • Add authentication function
  • Add postAsync function

Contributions are welcome, report any issues here

99
likes
0
pub points
74%
popularity

Publisher

verified publisherdhmgroup.net

A WordPress API client for dart with support for WooCommerce and custom namespaces.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

http

More

Packages that depend on wordpress_api