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

插件详情v0.10.0

normalize

Dart 中 GraphQL 响应的规范化和反规范化

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
48.6万
喜欢数
16
Pub 分数
130

安装插件

flutter pub add normalize

插件介绍

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

normalize 包为 Dart 提供了用于规范化和反规范化 GraphQL 响应的工具,实现了高效的数据管理和缓存一致性。该包专为与 Ferry GraphQL 客户端无缝协作而设计,可将嵌套的 GraphQL 数据转换为扁平化的规范化结构,避免重复并简化状态更新。这在处理复杂查询和变更时提升了性能和一致性。该包支持所有主要平台,包括 Android、iOS、Web、macOS、Windows 和 Linux。

适合场景

  • 缓存 GraphQL 查询结果
  • 管理嵌套数据结构
  • 提高状态更新效率
  • 将客户端状态与服务器响应同步
  • 在大规模应用中优化性能

主要特点

  • 扁平数据规范化
  • 自动去重实体
  • 对 GraphQL 对象关系的支持
  • 与Ferry客户端的集成
  • 跨平台兼容性

适合对象

  • 使用 Ferry 的 GraphQL 客户端
  • 具有复杂嵌套数据的应用程序
  • 开发人员优先考虑缓存性能
  • 使用规范化数据的状态管理
  • 全栈 Dart/Flutter 应用

使用建议

  • 需要熟悉 GraphQL 数据结构
  • 最好与 Ferry 或类似客户端一起使用
  • 可能增加初始设置的复杂性
  • 仅限 GraphQL 特定用例
  • 不适用于非GraphQL数据格式

原始 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

所属分类

依赖

依赖清单 2 项

源码仓库

使用此插件的项目