animated_rotating_widget 0.0.2 animated_rotating_widget: ^0.0.2 copied to clipboard
Looking to rotate your widget continuously with a specified duration? AnimatedRotatingWidget is your solution. Just provide the duration and the widget will continuously rotate.
import 'package:animated_rotating_widget/animated_rotating_widget.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Rotating Widget Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const Home());
}
}
class Home extends StatefulWidget {
const Home({Key? key}) : super(key: key);
@override
State<Home> createState() => _HomeState();
}
class _HomeState extends State<Home> {
@override
Widget build(BuildContext context) {
return const Scaffold(
backgroundColor: Colors.black,
body: Center(
child: AnimatedRotatingWidget(
duration: Duration(milliseconds: 1500),
child: Icon(
Icons.star,
size: 50,
color: Colors.amber,
),
),
),
);
}
}