rrousselGit / freezed

Code generation for immutable classes that has a simple syntax/API without compromising on the features.
https://pub.dev/packages/freezed
1.94k stars 237 forks source link

Add support for default value on copyWith #1082

Closed markokarajlovic closed 6 months ago

markokarajlovic commented 6 months ago

I am using freezed in combination with bloc. I have 1 state class with enums for build and listener.

part 'example_state.freezed.dart';@freezed class ExampleState with _$ExampleState { const ExampleState._(); const factory ExampleState({ @Default(ExampleStateBuildStatus.loading) ExampleStateBuildStatus buildStatus, ExampleStateListenStatus? listenStatus, }) = _ExampleState; } enum ExampleStateBuildStatus { loading, loadSuccess, } enum ExampleStateListenStatus { error, }

Describe the solution you'd like A clear and concise description of what you want to happen.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.