I am reading the source code of Flame.
It seems that Flame has its own Provider, separate from those provided by https://pub.dev/packages/provider and https://riverpod.dev/.
Definition:
https://github.com/flame-engine/flame/blob/fabbf928d04a47693aeabd1386fe89fbe179ffa7/packages/flame/lib/src/effects/provider_interfaces.dart#L71
/// Interface for a component that can be affected by size effects.
abstract class SizeProvider extends ReadOnlySizeProvider {
set size(Vector2 value);
}
Usage:
https://github.com/flame-engine/flame/blob/fabbf928d04a47693aeabd1386fe89fbe179ffa7/packages/flame/lib/src/geometry/circle_component.dart#L10
class CircleComponent extends ShapeComponent implements SizeProvider {
...
}
/// Interface for a component that can be affected by size effects.
It says “Interface for a component that can be affected by size effects,” but I don’t quite understand what it means.
For example:
When using StatefulWidget, you understand that it is used to manage state.
When using the mixin Fooable, you know that it adds the functionality of Foo.
These are hints when reading the code, but what does the Provider in this case suggest or what is its purpose?