搜索插件、代码仓与 APP 分类

插件详情v1.2.0+1

wordpress_api

一个支持 WooCommerce 和自定义命名空间的 Dart 语言 WordPress REST API 客户端。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
90
喜欢数
102
Pub 分数
145

安装插件

flutter pub add wordpress_api

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个 Dart 包,提供对 WordPress REST API 的客户端支持,兼容 WooCommerce 和自定义命名空间。它可实现与多个平台(包括移动设备和网页)上的 WordPress 站点的无缝集成。该包简化了身份验证、数据获取以及复杂 API 响应的处理,非常适合开发与 WordPress 驱动的内容或电子商务系统交互的应用程序。官方支持 Android、iOS、Web、macOS、Windows 和 Linux,确保跨平台兼容性。源代码在 GitHub 上公开,便于透明化和社区贡献。

适合场景

  • 为WordPress博客构建移动应用
  • 将 WooCommerce 商店集成到 Flutter 应用中
  • 从 WordPress 获取自定义文章类型
  • 创建以内容为中心的Web应用程序
  • 通过自定义 API 端点连接到 WordPress

主要特点

  • WooCommerce API 支持
  • 自定义命名空间处理
  • 跨平台兼容性
  • 身份验证工具
  • 强大的错误处理
  • 类型安全的响应解析

适合对象

  • 使用 WordPress 的 Flutter 开发人员
  • 使用 WooCommerce 的电子商务应用程序创建者
  • 内容管理系统集成商
  • 以 API 为先的应用程序构建工具
  • 需要多平台 WordPress 集成的团队

使用建议

  • 需要熟悉 WordPress REST API 结构
  • 可能需要为自定义端点进行额外设置
  • 依赖外部WordPress网站配置
  • 除了基本示例外,文档有限
  • 不适用于直接的WordPress管理操作

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

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!

所属分类

依赖

依赖清单 4 项

源码仓库

使用此插件的项目

暂无相关数据。