Giter Club home page Giter Club logo

dart-wp's Introduction

WordPress REST API client for Dart | Flutter

All Contributors

GitHub stars Pub Build Status Maintenance

Description

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

Features

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

Installation

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

dependencies:
  wordpress_api: <latest_version>

Usage

  • Import the package
import 'package:wordpress_api/wordpress_api';
  • Initialize WPAPI
  WordPressAPI api = WordPressAPI('wp-site.com');
  • Retrieve posts from .posts getter

    • You can fetch a list of posts by simply calling .posts. More arguments can be passed to further filter the data returned
      void main() async {
        final api = WordPressAPI('wp-site.com');
        final WPResponse res = await api.posts.fetch();
        for (final post in res.data) {
          print(post.title);
        }
      }
    • As of v0.3.0, you can query a single post from the same endpoint by passing an id
      void main() async {
        final api = WordPressAPI('wp-site.com');
        final WPResponse res = await api.posts.fetch(id: 1);
        print(res.data.title);
      }
  • Retrieve data from a custom endpoint

  void main() async {
    final api = WordPressAPI('wp-site.com');
    final WPResponse res = await api.get(endpoint: 'your-custom-endpoint');
    print(res.data);
  }

ToDo

  • Authentication using Application Passwords. WordPress 5.6+ only
  • Fully integrated WooCommerce support.
  • Full CRUD operations.
  • Support for other popular WordPress Plugins.

Contributions are welcome, report any issues here

Special Thanks

Contributors โœจ

Thanks goes to these wonderful people (emoji key):

anKii
anKii

๐Ÿ’ป
Kellvem Barbosa
Kellvem Barbosa

๐Ÿ’ป
NKlage
NKlage

๐Ÿ’ป ๐Ÿ›
Elikem (Junior) Medehou
Elikem (Junior) Medehou

๐Ÿ’ป
Okan Demir
Okan Demir

๐Ÿ’ป

This project follows the all-contributors specification. Contributions of any kind welcome!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.