Scenario:
For example, I have the following abstract class Synchronizable:
abstract class Synchronizable {
/// Getter & setter for sync status of the current data
bool get synced;
set synced(bool status);
/// Method that will be called to execute the synchronization process
Future<Either<Error, dynamic>> onSync();
}
As you can see the class has 3 different abstract methods:
- Getter for
syncedbool value - Setter for
syncedbool value - An abstract method
onSyncto perform synchronization
I have extended the class in one dummy implementation for this question:
class DummyImpl extends Synchronizable {
}
The IDE gave me an error/warning to must override abstract methods, but the method count was not 3, it was 2.
When I implemented using the prompt, It overrode only 2 methods.
The getter & the onSync method.
Note: The error is gone from the class name, meaning the override was successful & did not miss any method to override.
Question(s):
- How do I force override of the
settermethod in this case? - Why is the compiler skipping the
setterfor the override? (Not important but curious about this)
Update:
From the responses I got, It seems that getter/setters are replaced with a member directly by the compiler. However the main question still remains unanswered, how do I force override the any methods.
To reflect the same intention, I have updated the Question title as well. Please respond to solve that part.
Thank you.

