dart_sealed
dart_sealed copied to clipboard
Dart and Flutter sealed class generator and annotations, with match methods and other utilities. There is also super_enum compatible API.
In my project I have a sealed class with an empty subtype that I use as default argument in a constructor. For that to work I need a static constant...
Hi, I have fixed some little issues in project. I think now it will work with dart 3 without analysis issues. After merging this pr, please merge branch master onto...
I have this super_enum and the advise was to convert this to this package. I am wondering how all this will convert? Any help is appreciated... ``` import 'package:super_enum/super_enum.dart'; part...
Add a capability to add default values for fields. for example like this: ```dart import 'package:sealed_annotations/sealed_annotations.dart'; part 'weather.sealed.dart'; @Sealed() abstract class _Weather { void sunny(); void rainy({int rain = 10});...
Add ability to define unnamed constructor. An easy way is to provide an annotation like `@UnNamed()` or to reserve a method name like `noNamed` for this purpose. Another way is...
Add ability to use manifest class constructor for common fields. ```dart @Sealed() abstract class _ApiError { _ApiError({String message, String? code,}); void internetError(); void badRequest(); void internalError(Object? error); } ``` Complexities...
Generate copyWith method for sealed classes. We should disallow generic type change in copy with method to make life easier. For nullable types we have two approaches: For example: ```dart...