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