mirror of
https://github.com/rive-app/rive-flutter.git
synced 2025-06-22 23:07:49 +08:00
remove unnecessary null checks & compiler warnings
This commit is contained in:
@ -37,6 +37,6 @@ class OneShotAnimation extends SimpleAnimation {
|
||||
isActive
|
||||
? onStart?.call()
|
||||
// onStop can fire while widgets are still drawing
|
||||
: WidgetsBinding.instance?.addPostFrameCallback((_) => onStop?.call());
|
||||
: WidgetsBinding.instance.addPostFrameCallback((_) => onStop?.call());
|
||||
}
|
||||
}
|
||||
|
@ -218,7 +218,7 @@ class StateMachineController extends RiveAnimationController<CoreContext> {
|
||||
|
||||
/// Handles state change callbacks
|
||||
void _onStateChange(LayerState layerState) =>
|
||||
SchedulerBinding.instance?.addPostFrameCallback((_) {
|
||||
SchedulerBinding.instance.addPostFrameCallback((_) {
|
||||
String stateName = 'unknown';
|
||||
if (layerState is AnimationState && layerState.animation != null) {
|
||||
stateName = layerState.animation!.name;
|
||||
|
@ -187,7 +187,7 @@ abstract class RiveRenderBox extends RenderBox {
|
||||
return;
|
||||
}
|
||||
_frameCallbackId =
|
||||
SchedulerBinding.instance?.scheduleFrameCallback(_frameCallback) ?? -1;
|
||||
SchedulerBinding.instance.scheduleFrameCallback(_frameCallback);
|
||||
}
|
||||
|
||||
/// Override this if you want to do custom viewTransform alignment. This will
|
||||
|
Reference in New Issue
Block a user