Add base interactive layout "rive" whit animation

This commit is contained in:
paoloGuagnano
2024-03-08 12:15:47 +01:00
parent 06336bd3d9
commit 2d5fba8897
58 changed files with 1946 additions and 133 deletions

View File

@@ -0,0 +1,23 @@
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);
},
);
}
}