videoloading.dart 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import 'package:flutter/material.dart';
  2. import 'package:flyinsonolite/infrastructure/scale.dart';
  3. import 'package:flyinsonolite/infrastructure/storage.dart';
  4. class VideoLoadingWidget extends StatefulWidget {
  5. const VideoLoadingWidget({Key? key}) : super(key: key);
  6. @override
  7. VideoLoadingWidgetState createState() => VideoLoadingWidgetState();
  8. }
  9. class VideoLoadingWidgetState extends State<VideoLoadingWidget>
  10. with SingleTickerProviderStateMixin {
  11. late final AnimationController _controller = AnimationController(
  12. vsync: this,
  13. duration: const Duration(milliseconds: 1500),
  14. )..repeat();
  15. @override
  16. Widget build(BuildContext context) {
  17. return Center(
  18. child: RotationTransition(
  19. turns: Tween(begin: 0.0, end: 1.0).animate(_controller),
  20. child: SizedBox(
  21. width: 50.s,
  22. height: 50.s,
  23. child: CircularProgressIndicator(
  24. strokeWidth: 2.s,
  25. valueColor: AlwaysStoppedAnimation<Color>(
  26. Storage.currentTheme.videoLoadingColor,
  27. ),
  28. ),
  29. ),
  30. ),
  31. );
  32. }
  33. @override
  34. void dispose() {
  35. _controller.dispose();
  36. super.dispose();
  37. }
  38. }