You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.2 KiB

2 years ago
  1. import 'package:flutter/material.dart';
  2. import 'package:rive/rive.dart';
  3. class AnimatedDash extends StatelessWidget {
  4. const AnimatedDash({
  5. Key? key,
  6. required this.boardSize,
  7. required Function(Artboard artboard) onInit,
  8. required RiveAnimationController riveController,
  9. EdgeInsets padding = const EdgeInsets.only(right: 56.0, bottom: 56),
  10. }) : _riveController = riveController,
  11. _onInit = onInit,
  12. _padding = padding,
  13. super(key: key);
  14. final double boardSize;
  15. final Function(Artboard artboard) _onInit;
  16. final RiveAnimationController _riveController;
  17. final EdgeInsets _padding;
  18. @override
  19. Widget build(BuildContext context) {
  20. return Align(
  21. alignment: Alignment.bottomCenter,
  22. child: Padding(
  23. padding: _padding,
  24. // child: SizedBox(
  25. // width: boardSize * 0.75,
  26. // height: boardSize * 0.75,
  27. // child: RiveAnimation.asset(
  28. // 'assets/rive/dash.riv',
  29. // fit: BoxFit.contain,
  30. // antialiasing: true,
  31. // controllers: [_riveController],
  32. // onInit: _onInit,
  33. // ),
  34. // ),
  35. ),
  36. );
  37. }
  38. }