-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
Hello,, when use freezed it generate only private classes and also expect other type in the model, for example instead of Union1 it expect _$Union1
Thank you
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:reactive_forms_annotations/reactive_forms_annotations.dart';
part 'freezed_union.freezed.dart';
part 'freezed_union.g.dart';
part 'freezed_union.gform.dart';
@freezed
class FreezedUnion with _$FreezedUnion {
@ReactiveFormAnnotation()
const factory FreezedUnion.union1({
@FormControlAnnotation() required String text,
}) = Union1;
@ReactiveFormAnnotation()
const factory FreezedUnion.union2({
@FormControlAnnotation() required int number,
}) = Union2;
factory FreezedUnion.fromJson(Map<String, dynamic> json) =>
_$FreezedUnionFromJson(json);
}
void main() {
final form = _$Union1FormBuilder( // It should be public
model: _$Union1(text: 'foo'), // It should be Union1
builder: (_, __, ___) {
return Container();
},
);
} reactive_forms_generator: ^1.0.1
danielmahon
Metadata
Metadata
Assignees
Labels
No labels