dart_sealed
dart_sealed copied to clipboard
Default values for fields
Add a capability to add default values for fields. for example like this:
import 'package:sealed_annotations/sealed_annotations.dart';
part 'weather.sealed.dart';
@Sealed()
abstract class _Weather {
void sunny();
void rainy({int rain = 10});
void windy({@WithDefault('1e10') double velocity, double? angle = 100.0});
}
there is the question that if it should support dynamic defaults as well ?!
@SaeedMasoumi
There should be ability to set default values for common fields on constructor