Buscar pacotes, repositórios e categorias de apps

Repositório GitHubdhmgroup/dart-wp

dart-wp

Um cliente da API do WordPress para o dart com suporte a WooCommerce e namespaces personalizados.

Capa do projeto dart-wp
Estrelas
79
Forks
26
Último push (UTC)
29 de jul. de 2024
Status do projeto
Ativo

README original

Texto original em inglês. Visite o GitHub para a versão atual.

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!

DHM Group GitHub avatar
Autor no GitHub

DHM Group ↗

LinguagensDart

Categorias

Pacotes publicados por este repositório

Dependências usadas

Lista de dependências 5 itens

Como escolher um repositório para seu projeto?

Filtre pelo caso de uso, compare a atividade e confira o projeto original antes de adotá-lo.

  1. Busque por nome, autor ou descrição e filtre por tema.
  2. Compare estrelas, forks e envios recentes. Estrelas indicam interesse, mas não garantem qualidade.
  3. Confira o README, a licença e as issues no GitHub antes de usar o projeto.

Fontes e manutenção

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗