createEffect method
Create a effect.
Do not call inside the build method.
Calling this method in build() will create a new effect every render.
Implementation
EffectCleanup createEffect(
dynamic Function() cb, {
String? debugLabel,
dynamic Function()? onDispose,
}) {
final s = effect(
cb,
debugLabel: debugLabel,
onDispose: onDispose,
);
_effects.add(s);
return () {
_effects.remove(s);
s();
};
}