zwjson_serializable 0.0.1 copy "zwjson_serializable: ^0.0.1" to clipboard
zwjson_serializable: ^0.0.1 copied to clipboard

outdated

修改了 json_serializable 的代码让生成的 fromjson,tojson名字固定下来,不要加类名的前缀

example/example.dart

// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:json_annotation/json_annotation.dart';

part 'example.g.dart';

@JsonSerializable(nullable: false)
class Person {
  final String firstName;
  final String lastName;
  final DateTime dateOfBirth;
  Person({this.firstName, this.lastName, this.dateOfBirth});
  factory Person.fromJson(Map<String, dynamic> json) => _$PersonFromJson(json);
  Map<String, dynamic> toJson() => _$PersonToJson(this);
}
0
likes
30
pub points
0%
popularity

Publisher

unverified uploader

修改了 json_serializable 的代码让生成的 fromjson,tojson名字固定下来,不要加类名的前缀

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

Dependencies

analyzer, build, build_config, json_annotation, meta, path, source_gen

More

Packages that depend on zwjson_serializable