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

插件详情v0.12.0+6

ferry_generator

Ferry GraphQL 客户端生成的类型

AndroidiOSmacOSWindowsLinux
近 30 天下载
6590
喜欢数
23
Pub 分数
120

安装插件

flutter pub add ferry_generator

插件介绍

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

Ferry Generator 是一个用于 Ferry GraphQL 客户端的代码生成工具,旨在从 GraphQL 操作中创建类型安全的 Dart 类。它通过根据模式和查询文件自动生成模型、查询、变更和订阅,简化了 GraphQL 的使用。这减少了样板代码,并通过确保类型与 GraphQL API 保持一致来最小化运行时错误。该生成器可无缝集成到 Flutter 项目中,并支持 Android、iOS、macOS、Windows 和 Linux 等多个平台。

适合场景

  • 自动生成 GraphQL 操作类型
  • 从 GraphQL 模式创建类型安全的模型
  • 简化 Flutter 应用中的变更和查询处理
  • 启用 GraphQL 操作的编译时验证
  • 支持跨平台 GraphQL 客户端

主要特点

  • 从 GraphQL 文件生成 Dart 类
  • 确保 GraphQL 操作的类型安全
  • 与渡轮客户端集成
  • 支持查询、变更和订阅
  • 生成最少的样板代码

适合对象

  • 使用 Ferry GraphQL 客户端的 Flutter 开发人员
  • 优先考虑 GraphQL 使用中的类型安全的团队
  • 需要高效GraphQL代码生成的项目
  • 针对多个平台且共享 GraphQL 逻辑的应用程序
  • 寻求减少手动代码维护的开发人员

使用建议

  • 需要一个 GraphQL 模式和操作文件
  • 依赖于Ferry客户端以实现运行时功能
  • 需要在 pubspec.yaml 中进行正确设置
  • 可能需要为复杂架构进行额外配置
  • 最好与 Ferry 的运行时库配合使用

原始 README

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

A simple, powerful GraphQL Client for Flutter and Dart

MIT License PRs Welcome Watch on GitHub Star on GitHub Watch on GitHub Discord

Documentation 📖

Features

  1. ✅ Fully Typed: work faster and safer with compile time checks and IDE autocomplete, including fully typed Cache reads and writes.
  2. 🔄 Built-In Code Generators: automatically generated immutable data classes for all your GraphQL Operations and Fragments, based on your schema.
  3. 🌐 Customizable Network Interface: highly customizable network interface using gql_link, allowing you to compose and extend Links.
  4. ✨ Normalized Optimistic Cache: keep data in sync with cache normalization and update your UI instantly with optimistic data.
  5. 💾 Multiple Data Stores: extensible Store interface with built-in MemoryStore and HiveStore (which uses hive for offline persistence).
  6. 📄 Refetch & Pagination: easily update responses with new data or combine multiple responses, allowing for seamless pagination.
  7. 📱 Flutter Widgets: Widgets for Queries, Mutations, and Subscriptions, available out of the box.
  8. 🧈 Smooth: Run queries in a separate Isolate to free up resources on the UI thread

Packages

This repo is a monorepo for ferry and related packages.

Pub Package Description
version package:ferry Stream-based GraphQL Client
version package:ferry_cache Normalized, strongly typed, optimistic cache
version package:ferry_exec Strongly typed GraphQL execution interface
version package:ferry_flutter Flutter Widgets for GraphQL Operations
version package:ferry_generator Dart Type Generator for GraphQL Operations
version package:ferry_store Data Persistence for ferry's cache
version package:ferry_hive_store Hive implementation of ferry_store
version package:normalize Normalization / denormalization of GraphQL data

所属分类

依赖

依赖清单 15 项

源码仓库

使用此插件的项目