24 lines
557 B
Dart
24 lines
557 B
Dart
import 'package:rive/rive.dart';
|
|
|
|
class RiveUtils {
|
|
static SMIBool getRiveInput(Artboard artboard,
|
|
{required String stateMachineName}) {
|
|
StateMachineController? controller =
|
|
StateMachineController.fromArtboard(artboard, stateMachineName);
|
|
|
|
artboard.addController(controller!);
|
|
|
|
return controller.findInput<bool>("active") as SMIBool;
|
|
}
|
|
|
|
static void chnageSMIBoolState(SMIBool input) {
|
|
input.change(true);
|
|
Future.delayed(
|
|
const Duration(seconds: 1),
|
|
() {
|
|
input.change(false);
|
|
},
|
|
);
|
|
}
|
|
}
|