🎯 This library automatically generates object classes from JSON files that can be parsed by the freezed library.

Overview

freezer

The Most Powerful Way to Automatically Generate Model Objects from JSON Files ⚑


GitHub Sponsor GitHub Sponsor

pub package Dart SDK Version Test Analyzer codecov Issues Pull Requests Stars Contributors Code size Last Commits License Contributor Covenant


1. Guide 🌎

This library was built on the foundation of the json_serializable and freezed libraries.

This library provides the ability to automatically generate class objects supported by the freezed library directly from JSON files.

Show some ❀️ and star the repo to support the project.

Note
Many of the specifications in this library are still in development. Your contributions are very welcome!

1.1. Features πŸ’Ž

  • Generate model objects on a JSON basis.
  • Synchronize model design and implementation on a JSON basis.
  • JSON from API can be converted directly into model objects.
  • Aliases and other useful identifiers.
  • Supports automatic Enum generation and mapping with model objects.
  • The automatically generated model objects are based on the freezed library.
  • Very easy to install.
  • etc...

And all you have to do is prepare a JSON file defining the structure of the model object to be generated and run the command dart run freezer:main in a terminal.

You can see the following example.

1.1.1. From

{
  "shop": {
    "name.!required": "My Fancy Shop",
    "products.!as:product.!name:my_products": [
      {
        "name": "Chocolate",
        "price": 5.99
      },
      {
        "name": "Gummy",
        "price": 8.99
      }
    ],
    "location": [-122.4194, 37.7749],
    "closed": false,
    "$name": "This is a comment for name field.",
    "$products": "This is a comment for product field.",
    "$$products": "This is a comment for product object."
  }
}

1.1.2. To

// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: invalid_annotation_target

import 'package:freezed_annotation/freezed_annotation.dart';

import 'product.dart';

part 'shop.freezed.dart';
part 'shop.g.dart';

// **************************************************************************
// FreezerGenerator
// **************************************************************************

@freezed
class Shop with _$Shop {
  const factory Shop({
    /// This is a comment for name field.
    required String name,

    /// This is a comment for product field.
    @JsonKey(name: 'products') List<Product>? myProducts,
    List<double>? location,
    bool? closed,
  }) = _Shop;

  /// Returns [Shop] based on [json].
  factory Shop.fromJson(Map<String, Object?> json) => _$ShopFromJson(json);
}
// GENERATED CODE - DO NOT MODIFY BY HAND

import 'package:freezed_annotation/freezed_annotation.dart';

part 'product.freezed.dart';
part 'product.g.dart';

// **************************************************************************
// FreezerGenerator
// **************************************************************************

/// This is a comment for product object.
@freezed
class Product with _$Product {
  const factory Product({
    String? name,
    double? price,
  }) = _Product;

  /// Returns [Product] based on [json].
  factory Product.fromJson(Map<String, Object?> json) =>
      _$ProductFromJson(json);
}

And .freezed.dart and .g.dart files are automatically generated at the same time.
So, there is even no need to run build_runner yourself!

1.2. Getting Started πŸ„

1.2.1. Prerequisite

The codes automatically generated by this library depend on annotations from json_serializable and freezed.

So, let's add the prerequisite libraries to pubspec.yaml as follows.

dependencies:
  freezed_annotation: ^latest

dev_dependencies:
  json_serializable: ^latest
  freezed: ^latest

1.2.2. Install Library

Next, let's install the libraries to use the freezer functionality.

Simply add freezer: ^latest to your pubspec.yaml's dev_dependencies.

Or you can add by command as follows.

With Dart:

dart pub add freezer

With Flutter:

flutter pub add freezer

1.2.3. Create a JSON File

freezer interprets JSON files as design information and automatically generates object classes supported by the freezed library.

And you need to note following rules when you use the freezer.

  1. freezer parses files with the .freezer.json extension.
  2. freezer parses JSON files stored in the .design folder.

So, now let's create a JSON file with the following structure as a trial.

{
  "shop": {
    "name.!required": "My Fancy Shop",
    "products.!as:product.!name:my_products": [
      {
        "name": "Chocolate",
        "price": 5.99
      },
      {
        "name": "Gummy",
        "price": 8.99
      }
    ],
    "location": [-122.4194, 37.7749],
    "closed": false,
    "$name": "This is a comment for name field.",
    "$products": "This is a comment for product field.",
    "$$products": "This is a comment for product object."
  }
}

And then store this JSON file in the .design folder of the root of project.

.
β”œβ”€β”€ analysis_options.yaml
β”œβ”€β”€ design
β”‚   └── sample
β”‚       └── shop.freezer.json
β”œβ”€β”€ lib
β”œβ”€β”€ pubspec.lock
└── pubspec.yaml

1.2.4. Execute Command

Now let's execute the following command and see what happens!

dart run freezer:main

Then, this trial is successful if the following output is obtained.

Started process for 1 files

[INFO] Reading cached asset graph completed, took 28ms
[INFO] Checking for updates since last build completed, took 297ms
[INFO] Running build completed, took 4.0s
[INFO] Caching finalized dependency graph completed, took 19ms
[INFO] Succeeded after 4.1s with 0 outputs (3 actions)

┏━━ Generated dart files
┃  ┣━━ πŸŽ‰ /Users/user/freezer/lib/sample/product.dart
┃  ┣━━ πŸŽ‰ /Users/user/freezer/lib/sample/product.freezed.dart
┃  ┣━━ πŸŽ‰ /Users/user/freezer/lib/sample/product.g.dart
┃  ┣━━ πŸŽ‰ /Users/user/freezer/lib/sample/shop.dart
┃  ┣━━ πŸŽ‰ /Users/user/freezer/lib/sample/shop.freezed.dart
┃  ┗━━ πŸŽ‰ /Users/user/freezer/lib/sample/shop.g.dart
┗━━ 6 files in 5.5022 seconds

And you can see generated dart codes in the .lib folder like below.

.
β”œβ”€β”€ analysis_options.yaml
β”œβ”€β”€ design
β”‚   └── sample
β”‚       └── shop.freezer.json
β”œβ”€β”€ lib
β”‚   └── sample
β”‚       β”œβ”€β”€ product.dart
β”‚       β”œβ”€β”€ product.freezed.dart
β”‚       β”œβ”€β”€ product.g.dart
β”‚       β”œβ”€β”€ shop.dart
β”‚       β”œβ”€β”€ shop.freezed.dart
β”‚       └── shop.g.dart
β”œβ”€β”€ pubspec.lock
└── pubspec.yaml

1.3. Reference for Identifiers

freezer provides useful identifiers for creating model objects from JSON files.

These identifiers can be used to automatically create classes and fields with names that differ from the field names defined in the JSON file without directly editing the model object source.

Identifier Description Example
.!required The field with this identifier shall be a required field. name.!required
.!as: Assign an alias to a specific object defined in JSON. product.!as:my_product
.!name: Assign an alias to a specific field in object defined in JSON. product.!name:my_product
.!toDateTime Treat this field as DateTime type. datetime.!toDateTime
$ A dartdoc can be created for a specific field by tying it to a field name defined in JSON. "$field_name": "This is a comment for field."
$$ A dartdoc can be created for a specific object by tying it to an object name defined in JSON. "$$object_name": "This is a comment for a object (class)."

Also, you can combine multiple identifiers for specific fields and objects like below.

{
  "shop": {
    "products.!as:product.!name:my_products": [
      {
        "name": "Chocolate",
        "price": 5.99
      }
    ]
  }
}

1.3.1. Make Specific Fields Required

With !required identifier, you can make specific fields required
And fields without this identifier are output as nullable, such as int? and String?.

1.3.1.1. From

{
  "shop": {
    "name.!required": "My Fancy Shop"
  }
}

1.3.1.2. To

import 'package:freezed_annotation/freezed_annotation.dart';

part 'shop.freezed.dart';
part 'shop.g.dart';

@freezed
class Shop with _$Shop {
  const factory Shop({
    required String name,
  }) = _Shop;

  factory Shop.fromJson(Map<String, Object?> json) => _$ShopFromJson(json);
}

1.3.2. Assign an Alias for Objects

With .!as: identifier, you can assign an alias to a specific object defined in JSON.

This identifier is useful when you want to rename an object defined in JSON that has a list structure.
The field names in JSON are often plural when the JSON object has a list structure, but it's more convenient to use the singular form when representing it as a class.

When this identifier is used, only the object name is assigned an alias, and the original name is used for the field name. If you want to change the name of the fields, use in combination with the !name: identifier.

1.3.2.1. From

{
  "shop": {
    "products.!as:product": [
      {
        "name": "Chocolate",
        "price": 5.99
      }
    ]
  }
}

1.3.2.2. To

import 'package:freezed_annotation/freezed_annotation.dart';

import 'product.dart';

part 'shop.freezed.dart';
part 'shop.g.dart';

@freezed
class Shop with _$Shop {
  const factory Shop({
    List<Product>? products,
  }) = _Shop;

  factory Shop.fromJson(Map<String, Object?> json) => _$ShopFromJson(json);
}
import 'package:freezed_annotation/freezed_annotation.dart';

part 'product.freezed.dart';
part 'product.g.dart';

@freezed
class Product with _$Product {
  const factory Product({
    String? name,
    double? price,
  }) = _Product;

  factory Product.fromJson(Map<String, Object?> json) =>
      _$ProductFromJson(json);
}

1.3.3. Assign an Alias for Fields

With .!name: identifier, you can assign an alias to a specific field in object defined in JSON.

When this identifier is used, only the field name is assigned an alias, and the original name of the object or file is used. If you want to change the name of the object, use in combination with the !as: identifier.

1.3.3.1. From

{
  "shop": {
    "products.!as:product.!name:my_products": [
      {
        "name": "Chocolate",
        "price": 5.99
      }
    ]
  }
}

1.3.3.2. To

// ignore_for_file: invalid_annotation_target

import 'package:freezed_annotation/freezed_annotation.dart';

import 'product.dart';

part 'shop.freezed.dart';
part 'shop.g.dart';

@freezed
class Shop with _$Shop {
  const factory Shop({
    @JsonKey(name: 'products') List<Product>? myProducts,
  }) = _Shop;

  factory Shop.fromJson(Map<String, Object?> json) => _$ShopFromJson(json);
}

1.4. Advanced Usage

1.4.1. Enum Generation and Mapping

It would be very convenient if constants with certain regularities could be grouped together and held as an Enum.
And fortunately, freezer supports automatic generation of Enums based on JSON files and automatic mapping to model objects.

Don't worry, it's very easy!

At first, in addition to the model object definition on JSON, one must add a hierarchy to represent Enum.

As shown in the following JSON file, the "models" object in the root should be the JSON object of the model object you are familiar with so far. Then, define the enums to be generated in the root "enums" object like following.

{
  "models": {
    "shop": {
      "name.!required": "My Fancy Shop",
      "products.!as:product": [
        {
          "name": "Chocolate",
          "price": 5.99,
          "product_type": "sweet",
          "country": "belgium"
        }
      ]
    }
  },
  "enums": {
    "product_type": [
      {
        "$": "It represents the sweet product.",
        "name": "sweet",
        "value": 0
      },
      {
        "$": "It represents the juice product.",
        "name": "juice",
        "value": 1
      }
    ],
    "country": ["germany", "belgium"],
    "$$country": "It represents the countries.",
  }
}

In the above example, the two Enums are defined. It's product_type and country. The principle of mapping a field in a model object to an Enum is very simple: simply match the name of the field in the model object with the name of the Enum.

$ and $$country are fields representing dartdocs, respectively. $ is a dartdoc for a specific element of Enum, and fields beginning with $$ are dartdoc for a specific Enum object by name.

For example, the product_type field of the "products" object in the "models" object will automatically map to the "product_type" Enum in the "enums" object.

Then let's run the dart run freezer:main command using this example JSON! You can get following results.

enum ProductType {
  /// It represents the sweet product.
  sweet(0),

  /// It represents the juice product.
  juice(1);

  /// The value of this enum element.
  final int value;

  const ProductType(this.value);
}
/// It represents the countries.
enum Country {
  germany,
  belgium,
}
import 'package:freezed_annotation/freezed_annotation.dart';

import 'country.dart';
import 'product_type.dart';

part 'product.freezed.dart';
part 'product.g.dart';

@freezed
class Product with _$Product {
  const factory Product({
    String? name,
    double? price,
    ProductType? productType,
    Country? country,
  }) = _Product;

  factory Product.fromJson(Map<String, Object?> json) =>
      _$ProductFromJson(json);
}

1.4.2. External Directory Reference

For example, there may be situations where you want to generate common objects in an external directory and reuse the common objects generated in that external directory.

In such cases, references feature is very useful. By defining a "references" object in the root of the JSON file, you can refer to objects in external directories.

For example, consider the following structure.

.
β”œβ”€β”€ design
β”‚   └── sample
β”‚       β”œβ”€β”€ common
β”‚       β”‚   └── common.freezer.json
β”‚       └── shop.freezer.json
└── lib

And common.freezer.json has json structure like below.

{
  "models": {
    "manager": {
      "id": 12345,
      "name": "Jason"
    }
  },
  "enums": {
    "country": ["germany", "belgium"]
  }
}

And shop.freezer.json has json structure like below.

{
  "models": {
    "shop": {
      "name.!required": "My Fancy Shop",
      "products.!as:product.!name:my_products": [
        {
          "name": "Chocolate",
          "price": 5.99,
          "country": "belgium"
        }
      ],
      "manager": {
        "id": 12345,
        "name": "Jason"
      }
    }
  }
}

You can find common terms in the fields defined in common.freezer.json and in shop.freezer.json. Yes, it's manager object and country enum.

Then, you can link these objects between different files by using "references". Let's add "references" in shop.freezer.json like below.

{
  "models": {
    "shop": {
      "name.!required": "My Fancy Shop",
      "products.!as:product.!name:my_products": [
        {
          "name": "Chocolate",
          "price": 5.99,
          "country": "belgium"
        }
      ],
      "manager": {
        "id": 12345,
        "name": "Jason"
      }
    }
  },
  "references": {
    "manager": "./common",
    "country": "./common/"
  }
}

You can see outputs like below if you run dart run freezer:main.

.
β”œβ”€β”€ design
β”‚   └── sample
β”‚       β”œβ”€β”€ common
β”‚       β”‚   └── common.freezer.json
β”‚       └── shop.freezer.json
└── lib
    └── sample
        β”œβ”€β”€ common
        β”‚   β”œβ”€β”€ country.dart
        β”‚   β”œβ”€β”€ manager.dart
        β”‚   β”œβ”€β”€ manager.freezed.dart
        β”‚   └── manager.g.dart
        β”œβ”€β”€ product.dart
        β”œβ”€β”€ product.freezed.dart
        β”œβ”€β”€ product.g.dart
        β”œβ”€β”€ shop.dart
        β”œβ”€β”€ shop.freezed.dart
        └── shop.g.dart
import 'package:freezed_annotation/freezed_annotation.dart';

import './common/manager.dart';
import 'product.dart';

part 'shop.freezed.dart';
part 'shop.g.dart';

@freezed
class Shop with _$Shop {
  const factory Shop({
    required String name,
    @JsonKey(name: 'products') List<Product>? myProducts,
    Manager? manager,
  }) = _Shop;

  factory Shop.fromJson(Map<String, Object?> json) => _$ShopFromJson(json);
}
import 'package:freezed_annotation/freezed_annotation.dart';

import './common/country.dart';

part 'product.freezed.dart';
part 'product.g.dart';

@freezed
class Product with _$Product {
  const factory Product({
    String? name,
    double? price,
    String? productType,
    Country? country,
  }) = _Product;

  factory Product.fromJson(Map<String, Object?> json) =>
      _$ProductFromJson(json);
}

1.5. Contribution πŸ†

If you would like to contribute to freezer, please create an issue or create a Pull Request.

There are many ways to contribute to the OSS. For example, the following subjects can be considered:

  • There are request parameters or response fields that are not implemented.
  • Documentation is outdated or incomplete.
  • Have a better way or idea to achieve the functionality.
  • etc...

You can see more details from resources below:

Or you can create a discussion if you like.

Feel free to join this development, diverse opinions make software better!

1.6. Support ❀️

The simplest way to show us your support is by giving the project a star at GitHub and Pub.dev.

You can also support this project by becoming a sponsor on GitHub:

1.7. License πŸ”‘

All resources of freezer is provided under the BSD-3 license.

Copyright 2022 Kato Shinya. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided the conditions.

Note
License notices in the source are strictly validated based on .github/header-checker-lint.yml. Please check header-checker-lint.yml for the permitted standards.

1.8. More Information 🧐

freezer was designed and implemented by Kato Shinya (@myConsciousness).

Comments
  • feat: allow package reference

    feat: allow package reference

    1. Description

    Allow an external package to be added as a reference eg package:user_repository/user_repository.dart.

    1.1. Checklist

    • [x] The title of my PR starts with a Conventional Commit prefix (fix:, feat:, docs: etc).
    • [x] I have read the Contributor Guide and followed the process outlined for submitting PRs.
    • [ ] I have updated/added tests for ALL new/updated/fixed functionality.
    • [ ] I have updated/added relevant documentation in docs and added dartdoc comments with ///.
    • [ ] I have updated/added relevant examples in examples.

    1.2. Breaking Change

    • [ ] Yes, this is a breaking change.
    • [x] No, this is not a breaking change.

    1.3. Related Issues

    #41

    enhancement 
    opened by Prn-Ice 5
  • External package reference

    External package reference

    1. Problem to solve

    First, thanks for an awesome package yet again. Say I have a model or set of models in an external package, I'd like to be able to add the external package import path as a reference.

    2. Proposal

    • To import a user model from package user_repository.
    • In references add package:user_repository.
    • Generated code uses import url and skips generation of user.

    3. More information

    I would be interested in working on a PR for this with some direction.

    enhancement 
    opened by Prn-Ice 5
  • feat: fixed for the issue (#7)

    feat: fixed for the issue (#7)

    1. Description

    1.1. Checklist

    • [x] The title of my PR starts with a Conventional Commit prefix (fix:, feat:, docs: etc).
    • [x] I have read the Contributor Guide and followed the process outlined for submitting PRs.
    • [x] I have updated/added tests for ALL new/updated/fixed functionality.
    • [x] I have updated/added relevant documentation in docs and added dartdoc comments with ///.
    • [x] I have updated/added relevant examples in examples.

    1.2. Breaking Change

    • [ ] Yes, this is a breaking change.
    • [x] No, this is not a breaking change.

    1.3. Related Issues

    enhancement 
    opened by myConsciousness 4
  • Could not find a file named

    Could not find a file named "pubspec.yaml"

    When I run dart run freezer:main

    I get an error: Could not find a file named "pubspec.yaml" in "/home/sketchbuch/.pub-cache/hosted/pub.dartlang.org/_fe_analyzer_shared-46.0.0".

    I'm guessing I have done something wrong as I'm quite new to flutter/dart, but do you know what the cause of the error could be?

    bug 
    opened by sketchbuch 4
  • build(deps): bump subosito/flutter-action from 2.6.2 to 2.7.1

    build(deps): bump subosito/flutter-action from 2.6.2 to 2.7.1

    Bumps subosito/flutter-action from 2.6.2 to 2.7.1.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    GitHub Actions 
    opened by dependabot[bot] 3
  • build(deps): bump actions/checkout from 2 to 3

    build(deps): bump actions/checkout from 2 to 3

    Bumps actions/checkout from 2 to 3.

    Release notes

    Sourced from actions/checkout's releases.

    v3.0.0

    • Updated to the node16 runtime by default
      • This requires a minimum Actions Runner version of v2.285.0 to run, which is by default available in GHES 3.4 or later.

    v2.4.2

    What's Changed

    Full Changelog: https://github.com/actions/checkout/compare/v2...v2.4.2

    v2.4.1

    • Fixed an issue where checkout failed to run in container jobs due to the new git setting safe.directory

    v2.4.0

    • Convert SSH URLs like org-<ORG_ID>@github.com: to https://github.com/ - pr

    v2.3.5

    Update dependencies

    v2.3.4

    v2.3.3

    v2.3.2

    Add Third Party License Information to Dist Files

    v2.3.1

    Fix default branch resolution for .wiki and when using SSH

    v2.3.0

    Fallback to the default branch

    v2.2.0

    Fetch all history for all tags and branches when fetch-depth=0

    v2.1.1

    Changes to support GHES (here and here)

    v2.1.0

    ... (truncated)

    Changelog

    Sourced from actions/checkout's changelog.

    Changelog

    v3.0.2

    v3.0.1

    v3.0.0

    v2.3.1

    v2.3.0

    v2.2.0

    v2.1.1

    • Changes to support GHES (here and here)

    v2.1.0

    v2.0.0

    v2 (beta)

    • Improved fetch performance

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    GitHub Actions 
    opened by dependabot[bot] 3
  • build(deps): bump subosito/flutter-action from 2.6.2 to 2.7.0

    build(deps): bump subosito/flutter-action from 2.6.2 to 2.7.0

    Bumps subosito/flutter-action from 2.6.2 to 2.7.0.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    GitHub Actions 
    opened by dependabot[bot] 3
  • fix(freezed_object_parser): add jsonkeys for camel case fields

    fix(freezed_object_parser): add jsonkeys for camel case fields

    1. Description

    Add JsonKeys for camel case fields.

    1.1. Checklist

    • [x] The title of my PR starts with a Conventional Commit prefix (fix:, feat:, docs: etc).
    • [x] I have read the Contributor Guide and followed the process outlined for submitting PRs.
    • [ ] I have updated/added tests for ALL new/updated/fixed functionality.
    • [ ] I have updated/added relevant documentation in docs and added dartdoc comments with ///.
    • [ ] I have updated/added relevant examples in examples.

    1.2. Breaking Change

    • [ ] Yes, this is a breaking change.
    • [x] No, this is not a breaking change.

    1.3. Related Issues

    • #44
    opened by Prn-Ice 3
  • [Scheduled] `dart pub upgrade --null-safety`

    [Scheduled] `dart pub upgrade --null-safety`

    Auto-generated by create-pull-request

    See: https://github.com/peter-evans/create-pull-request/blob/master/docs/concepts-guidelines.md#triggering-further-workflow-runs

    GitHub Actions 
    opened by myConsciousness 3
  • build(deps): bump subosito/flutter-action from 2.6.1 to 2.6.2

    build(deps): bump subosito/flutter-action from 2.6.1 to 2.6.2

    Bumps subosito/flutter-action from 2.6.1 to 2.6.2.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    GitHub Actions 
    opened by dependabot[bot] 3
  • feat: fixed for the issue (#34)

    feat: fixed for the issue (#34)

    1. Description

    1.1. Checklist

    • [x] The title of my PR starts with a Conventional Commit prefix (fix:, feat:, docs: etc).
    • [x] I have read the Contributor Guide and followed the process outlined for submitting PRs.
    • [x] I have updated/added tests for ALL new/updated/fixed functionality.
    • [x] I have updated/added relevant documentation in docs and added dartdoc comments with ///.
    • [x] I have updated/added relevant examples in examples.

    1.2. Breaking Change

    • [ ] Yes, this is a breaking change.
    • [x] No, this is not a breaking change.

    1.3. Related Issues

    enhancement 
    opened by myConsciousness 3
  • build(deps): bump snow-actions/tweet from 1.3.0 to 1.4.0

    build(deps): bump snow-actions/tweet from 1.3.0 to 1.4.0

    Bumps snow-actions/tweet from 1.3.0 to 1.4.0.

    Release notes

    Sourced from snow-actions/tweet's releases.

    v1.4.0

    Breaking Changes

    What's Changed

    Full Changelog: https://github.com/snow-actions/tweet/compare/v1.3.0...v1.4.0

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    GitHub Actions 
    opened by dependabot[bot] 2
  • build(deps): bump actions/checkout from 3.1.0 to 3.2.0

    build(deps): bump actions/checkout from 3.1.0 to 3.2.0

    Bumps actions/checkout from 3.1.0 to 3.2.0.

    Release notes

    Sourced from actions/checkout's releases.

    v3.2.0

    What's Changed

    New Contributors

    Full Changelog: https://github.com/actions/checkout/compare/v3...v3.2.0

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    GitHub Actions 
    opened by dependabot[bot] 2
  • [Scheduled] `dart pub upgrade --null-safety`

    [Scheduled] `dart pub upgrade --null-safety`

    Auto-generated by create-pull-request

    See: https://github.com/peter-evans/create-pull-request/blob/master/docs/concepts-guidelines.md#triggering-further-workflow-runs

    GitHub Actions 
    opened by myConsciousness 1
  • Add `.!as:this` operator

    Add `.!as:this` operator

    1. Problem to solve

    Supports a data structure that uses its own objects in a circular fashion within its own objects.

    Like:

    {
        "status": {
            "id": "1234",
            "another_status": ...
        }
    }
    

    2. Proposal

    3. More information

    enhancement 
    opened by myConsciousness 0
  • Let's consider about #44

    Let's consider about #44

    1. Problem to solve

    It is possible that not everyone is familiar with the json_serializable specification and that there may be situations where you do not want to create a build.yaml. In that case, it would be significant for this package to detect the presence of rename: snake in build.yaml, and if not, to add JsonKey annotation.

    2. Proposal

    3. More information

    enhancement 
    opened by myConsciousness 0
Releases(v0.6.1)
  • v0.6.1(Sep 1, 2022)

  • v0.6.0(Aug 26, 2022)

  • v0.5.0(Aug 24, 2022)

  • v0.4.0(Aug 20, 2022)

  • v0.3.0(Aug 17, 2022)

  • v0.2.0(Aug 16, 2022)

  • v0.1.0(Aug 16, 2022)

  • v0.0.2(Aug 14, 2022)

  • v0.0.1(Aug 14, 2022)

Owner
KATO, Shinya / εŠ θ—€ 真也
The founder of @batch-dart, @twitter-dart. Experienced with many languages, and a contributor for @dart-lang & @flutter & @google OSS & @TwitterDev.
KATO, Shinya / εŠ θ—€ 真也
Flutter shareable package of object-oriented classes for local caching of user data in json

json_cache Json Cache is an object-oriented package to serve as a layer on top of local storage packages - packages that persist data locally on the u

Dartoos 10 Dec 19, 2022
Given a JSON string, this library will generate all the necessary Dart classes to parse and generate JSON.

JSON to Dart Given a JSON string, this library will generate all the necessary Dart classes to parse and generate JSON. This library is designed to ge

Javier Lecuona 1.2k Dec 25, 2022
A JSON serialize class to convert 'to' and 'from' JSON format Enums, DateTime and any of your own classes.

A JSON serialize class to convert 'to' and 'from' JSON format Enums, DateTime and any of your own classes. Introduction Jsonize solves the problem of

null 2 Nov 17, 2022
Receiving ozh's github-colors repository with latest commit of colors.json to Flutter's Color object.

Apply GitHub's languages colours into Flutter's Color object. Receiving ozh's github-colors repository with latest commit of colors.json to Flutter's

Cyrus Chan 1 Jun 6, 2022
A Flutter 3D widget that renders Wavefront's object files.

Flutter Cube A Flutter 3D widget that renders Wavefront's object files. Getting Started Add flutter_cube as a dependency in your pubspec.yaml file. de

Zebiao Hu 221 Dec 22, 2022
A generator for fhir dart classes with json artifacts.

A generator for fhir dart classes with json artifacts. Thie generator uses the freezed package to generate the data classes. It also uses all the primitive_types from the fhir package.

Joel Staubach 2 Jun 14, 2022
State Persistence - Persist state across app launches. By default this library store state as a local JSON file called `data.json` in the applications data directory. Maintainer: @slightfoot

State Persistence Persist state across app launches. By default this library store state as a local JSON file called data.json in the applications dat

Flutter Community 70 Sep 28, 2022
Flutter Cryptocurrency App with Riverpod & Freezed + Dio for API REST

Flutter Crypto APP Complete Flutter Application with Riverpod & Freezed + Dio for API REST. Features API REST (CryptoWatch) Linear Graph View (Hour, D

Salvador Valverde 312 Jan 2, 2023
Complete Flutter Application with Riverpod & Freezed + Dio for API REST

Flutter Crypto APP Complete Flutter Application with Riverpod & Freezed + Dio fo

Xtenso 32 Dec 26, 2022
A rewrite of Bloc tutorial: Flutter Weather Tutorial using freezed

A rewrite of Bloc tutorial: Flutter Weather Tutorial using freezed. Bloc was used instead of Cubit (Cubit vs Bloc)

Yu-Han Luo 17 Nov 23, 2022
A Flutter Result type that feels like a Freezed union.

Freezed Result A Result<Success, Failure> that feels like a Freezed union. It represents the output of an action that can succeed or fail. It holds ei

Day Logger, Inc. 2 Nov 24, 2022
Automatically generate profile picture with random first name and background color. But you can still provide pictures if you have them. As the default color, based on the name of the first letter. :fire: :fire: :fire:

FLUTTER PROFILE PICTURE Automatically generate profile picture with random first name and background color. But you can still provide pictures if you

Aditya Dharmawan Saputra 10 Dec 20, 2022
An android app that can automatically dial a phone number.

AutoCallScheduler An android app that can automatically dial a phone number within a given scheduled of time. Basically it's a test base app of google

Rezwan 24 Dec 4, 2022
Flutter package: Json Table Widget to create table from json array

Json Table Widget ?? Proudly Sponsored by FieldAssist Request a Demo This Flutter package provides a Json Table Widget for directly showing table from

Ayush P Gupta 193 Jan 7, 2023
Fluter-json - App Demonstrating JSON Data Parsing with various flutter widgets

users_list Flutter App to Demonstrate JSON Parsing Getting Started This project is a starting point for a Flutter application. A few resources to get

Khurram Rizvi 5 Jul 10, 2021
Json editor - A json editor on flutter

Features Support add comment; Support show errors for invalid json text; Pretty

Chan Young 12 Nov 18, 2022
Tool made in Dart that allows you to dynamically generate JSON files from data models written in Dart.

Dart JSON Generator VersiΓ³n v1.1.1 Dart JSON Generator es una herramienta que permite generar archivos JSON a partir de mapas como modelos de datos en

Joinner Medina 7 Nov 23, 2022
Download files from Firebase Storage with Flutter. List all images, videos, or other files from Firebase and download them.

Flutter Tutorial - Download Files From Firebase Storage Download files from Firebase Storage with Flutter. List all images, videos, or other files fro

Johannes Milke 28 Dec 4, 2022
Upload Files To Firebase Storage with Flutter. Pick images, videos, or other files from your device and upload them to Firebase.

Flutter Tutorial - Upload Files To Firebase Storage Upload Files To Firebase Storage with Flutter. Pick images, videos, or other files from your devic

Johannes Milke 30 Dec 28, 2022