Files
Motula-Translate-App/motula_translate_app/lib/screens/onboding/components/animated_btn.dart
2024-03-08 12:15:47 +01:00

50 lines
1.4 KiB
Dart

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,
)
],
),
)
],
),
),
);
}
}