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
import 'package:freezed_annotation/freezed_annotation.dart';
// Use the following command to regenerate the freezed file:
// dart run build_runner build
part '../../generated/domain/entities/implemented.freezed.dart';
abstract class Implemented {
int get value;
/// Compute a value
int compute();
}
@freezed
class ImplementedClass with _$ImplementedClass implements Implemented {
@Implements<Implemented>()
const factory ImplementedClass({
required int value,
}) = _ImplementedClass;
const ImplementedClass._();
@override
int compute() => value;
}
I have some questions about inheritance / implementation with freezed after reading this part and testing a bit.
Does it make sense to mix implements keyword with @Implements ? implements keyword permit me to retrieve the base class documentation.
Additionally it seems we can use implements without @Implements which could be counter-intuitive as missing @Implements makes the generated code not adding the implements Implemented.
@freezed
class ImplementedClass with _$ImplementedClass implements Implemented {
const factory ImplementedClass({
required int value,
}) = _ImplementedClass;
@override
int compute() => value;
}
Gives :
abstract class _ImplementedClass implements ImplementedClass {
const factory _ImplementedClass({required final int value}) =
_$ImplementedClassImpl;
[...]
}
However, no error is raised.
I'm not sure to understand...
The text was updated successfully, but these errors were encountered:
I have some questions about inheritance / implementation with freezed after reading this part and testing a bit.
Does it make sense to mix
implements
keyword with@Implements
?implements
keyword permit me to retrieve the base class documentation.Additionally it seems we can use
implements
without@Implements
which could be counter-intuitive as missing@Implements
makes the generated code not adding theimplements Implemented
.Gives :
However, no error is raised.
I'm not sure to understand...
The text was updated successfully, but these errors were encountered: