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

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
points
65
downloads

Publisher

verified publishermrgnhnt.com

Weekly Downloads

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, class_fields_annotation, meta, source_gen

More

Packages that depend on class_fields