搜尋套件、儲存庫與 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 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。