dart_serde 1.0.4

  • Readme
  • Changelog
  • Installing
  • 50

Dart Serde #

The aim of that package is provide an easy and friendly interface to use serialization and deserialization for classes;

Installation #

Add to dependencies #

Add those to your pubspec

dependencies:
  serde: ^1.0.0

dev_dependencies:
  build_runner: ^1.0.0
  serde_generator: ^1.0.0

Run pub get

Getting started #

Given the class

class Public {
    final bool mustShow;
    final int number;
}

To map a json into it, and from it you must do:

@Serde()
class Public {...}

And thats it.

If you have special conditions for some keys, that is treatable. Lets assume, for example, that the field musShow, comes int he json with the name show, and nested in the structure, wrapped by the mapper

@Serde()
class Public {
    @Prop(name: 'show', isNested: true, path: 'mapper')
    final bool mustShow;
    final int number;
}

1.0.0 #

  • Initial version, created by Eduardo Aikin

1.0.3 #

  • Add use of nom primitive types and parse them

1.0.4 #

  • Add dynamic function to make the parse, change the treatment for duration types.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dart_serde: ^1.0.4

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
50
Learn more about scoring.

We analyzed this package on Nov 20, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, web, other

No libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0