How to make fixedLengthList in class model using @freezed?
@freezed class Example with _$Example { factory Example({ List<int> example, // this list should be max 5 positions, not more }) = _Example; }
You can do it like so:
@freezed class Example with _$Example { @Assert('example.length <= 5', 'this list should be max 5 positions, not more') factory Example({ List<int> example }) = _Example; }
You can do it like so: