Dart Flutter Freezed Classes
Package name | Weekly Downloads | Version | License | Updated |
---|---|---|---|---|
@graphql-codegen/flutter-freezed | Nov 1st, 2022 |
Installation
yarn add -D @graphql-codegen/flutter-freezed
The flutter-freezed
plugin generates [Freezed] models using a GraphQL Schema.
Please refer the the Flutter Freezed Guide for how to get started with this plugin.
configure the flutter-freezed
plugin
Config API Reference
camelCasedEnums
type: boolean
default: true
Dart's recommended lint uses camelCase for enum fields. Set this option to false
to use the same case as used in the GraphQL Schema but note this can cause lint issues.
Usage Examples
generates:
flutter_app/lib/data/models/app_models.dart
plugins:
- flutter-freezed
config:
camelCasedEnums: true
customScalars
fileName
globalFreezedConfig
type: FreezedConfig
default: DefaultFreezedConfig
use the same Freezed configuration for every generated output
typeSpecificFreezedConfig
type: Record_1
default: undefined
override the globalFreezedConfig
for specific types. The GraphQL Type name is the key
ignoreTypes
Last updated on August 18, 2022