class_fields 0.1.0 copy "class_fields: ^0.1.0" to clipboard
class_fields: ^0.1.0 copied to clipboard

SDKDart
outdated

Generate all field names as Strings to use within Maps, serialization, etc.

example/lib/main.dart

import 'package:class_fields_annotation/class_fields_annotation.dart';
import 'package:json_annotation/json_annotation.dart';

part 'main.f.dart';

@fields
class Example {
  const Example({
    required String name,
    required this.code,
    required this.description,
    required this.date,
    required this.price,
  }) : _name = name;

  final String _name;
  final int code;

  @Field('desc')
  final String description;
  final DateTime date;

  @JsonKey(name: 'money')
  final double price;

  static const fields = _$ExampleFields();
}
0
likes
130
pub points
0%
popularity

Publisher

verified publishermrgnhnt.com

Generate all field names as Strings to use within Maps, serialization, etc.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

analyzer, build, build_config, class_fields_annotation, meta, source_gen, source_helper

More

Packages that depend on class_fields