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,49 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:rive/rive.dart';
class AnimatedBtn extends StatelessWidget {
const AnimatedBtn({
Key? key,
required RiveAnimationController btnAnimationController,
required this.press,
}) : _btnAnimationController = btnAnimationController,
super(key: key);
final RiveAnimationController _btnAnimationController;
final VoidCallback press;
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: press,
child: SizedBox(
height: 64,
width: 236,
child: Stack(
children: [
RiveAnimation.asset(
"assets/RiveAssets/button.riv",
controllers: [_btnAnimationController],
),
Positioned.fill(
top: 8,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Icon(CupertinoIcons.arrow_right),
const SizedBox(width: 8),
Text(
"Start the course",
style: Theme.of(context).textTheme.labelLarge,
)
],
),
)
],
),
),
);
}
}