superclass_generator 0.3.0 copy "superclass_generator: ^0.3.0" to clipboard
superclass_generator: ^0.3.0 copied to clipboard

Generator for superclass package

example/lib/example.dart

import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:superclass/superclass.dart';

part 'example.freezed.dart';

part 'example.superclass.dart';

part 'example.g.dart';

@freezed
class User with _$User {
  const factory User({
    required String name,
    int? age,
    required Profile profile,
  }) = _User;

  factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
}

@freezed
class Profile with _$Profile {
  const factory Profile({required String bio}) = _Profile;

  factory Profile.fromJson(Map<String, dynamic> json) =>
      _$ProfileFromJson(json);
}

@Superclass(
  includeFreezed: true,
  includeJsonSerialization: true,
  classAnnotations: [Freezed()],
  apply: [
    MakePartial<User>(),
  ],
)
typedef UserProfile = $UserProfile;
0
likes
0
points
1
downloads

Publisher

verified publisherex3.dev

Weekly Downloads

Generator for superclass package

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

analyzer, build, source_gen, superclass

More

Packages that depend on superclass_generator