You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello
I noticed a situation that I think is a problem, or that I could not find a solution to it
When one class inherits from another class
I can't influence variables to be of type: immutable
example here: ↓
if any solution for this
and thanks.
part 'square_model.g.dart';
@CopyWith()
class Square extends Shape {
final String name;
Square({
required super.id,
required this.name,
});
}
abstract class Shape {
@CopyWithField(immutable: true)
final String id;
Shape({required this.id});
}
Future<void> main() async {
Square square = Square(id: '123', name: 'test');
square.copyWith(
id: '333', // ==> this has to be immutable
name: 'test2',
);
}
The text was updated successfully, but these errors were encountered:
Hello
I noticed a situation that I think is a problem, or that I could not find a solution to it
When one class inherits from another class
I can't influence variables to be of type: immutable
example here: ↓
if any solution for this
and thanks.
The text was updated successfully, but these errors were encountered: