mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-12 11:06:57 +00:00
peer ab/group tab refresh, animated refresh icon
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
30
flutter/lib/common/widgets/animated_rotation_widget.dart
Normal file
30
flutter/lib/common/widgets/animated_rotation_widget.dart
Normal file
@@ -0,0 +1,30 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AnimatedRotationWidget extends StatefulWidget {
|
||||
final VoidCallback onPressed;
|
||||
final ValueChanged<bool>? onHover;
|
||||
final Widget child;
|
||||
const AnimatedRotationWidget(
|
||||
{super.key, required this.onPressed, required this.child, this.onHover});
|
||||
|
||||
@override
|
||||
State<AnimatedRotationWidget> createState() => AnimatedRotationWidgetState();
|
||||
}
|
||||
|
||||
class AnimatedRotationWidgetState extends State<AnimatedRotationWidget> {
|
||||
double turns = 0.0;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AnimatedRotation(
|
||||
turns: turns,
|
||||
duration: const Duration(milliseconds: 200),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
setState(() => turns += 1.0);
|
||||
widget.onPressed();
|
||||
},
|
||||
onHover: widget.onHover,
|
||||
child: widget.child));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user