getters method
mark these functions as protected as we need the implementations, but discourage direct usages. Reasons:
- There are more base getters/setters/methods from the base class. Users can just focus on defining only applicable fields for their classes but still get the base implementations automatically.
- setProperty() will automatically notify the controller's listeners for changes, enabling the listeners (widget state) to redraw.
Use getProperty/setProperty/callMethod instead of these.
Implementation
@override
Map<String, Function> getters() {
return {
'files': () => _controller.files.map((e) => e.toJson()).toList(),
'currentFile': () => _controller.currentFile?.toJson(),
'latitude': () => _controller.position?.latitude,
'longitude': () => _controller.position?.longitude,
'speed': () => _controller.position?.speed,
'angle': () => _controller.angle,
};
}