Overview
A customizable, animated CD spinner widget for FlutterFlow. Ideal for audio applications, it visually represents playback with a rotating disc, enhancing user engagement. Built using Flutter's AnimatedBuilder and Transform widgets for smooth and efficient animations.
Dependencies
- flutter_flow_theme/util/custom_functions: For theming and app integration.
- flutter_svg: For rendering SVG assets (if using SVG images).
Parameters
- imagePath (String): Path to the image asset representing the CD.
- size (double): Diameter of the spinner in pixels.
- rotationDuration (Duration): Time it takes to complete one full rotation.
- isSpinning (bool): Controls whether the spinner is rotating.
- onTap (Function?): Callback function triggered on tap. Dart packages
🔧 Setup Instructions
- Add the Custom Widget
- Name it CDSpinnerWidget and paste the code below.
- Ensure any required dependencies are added to your pubspec.yaml.
- Use in Page
- Drag CDSpinnerWidget into your layout.
- Provide the required parameters and adjust size to fit your UI.
Key Enhancements & Logic
- Animation Control
- Utilises AnimationController and AnimationBuilder for smooth rotation.
- The rotation starts or stops based on the isSpinning parameter.