Add base interactive layout "rive" whit animation
This commit is contained in:
23
motula_translate_app/lib/utils/rive_utils.dart
Normal file
23
motula_translate_app/lib/utils/rive_utils.dart
Normal 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);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user