RotatingView class
create_user: zhengzaihong email:1096877329@qq.com create_date: 2024/5/8 create_time: 9:15 describe: 持续旋转动画组件 / Continuous Rotating Animation Component
让子组件持续旋转的动画组件 Component that continuously rotates its child widget
功能特性 / Features
- 🔄 持续旋转动画 / Continuous rotation animation
- ⚙️ 可自定义旋转速度 / Customizable rotation speed
- 🎯 自动循环播放 / Auto-loop playback
- 💫 流畅的动画效果 / Smooth animation effect
基础示例 / Basic Example
// 简单旋转
RotatingView(
child: Icon(Icons.refresh, size: 50),
)
// 自定义速度
RotatingView(
speed: Duration(seconds: 1),
child: Image.asset('assets/loading.png'),
)
// 加载指示器
RotatingView(
speed: Duration(milliseconds: 800),
child: Container(
width: 40,
height: 40,
decoration: BoxDecoration(
border: Border.all(color: Colors.blue, width: 3),
borderRadius: BorderRadius.circular(20),
),
),
)
// 旋转Logo
RotatingView(
speed: Duration(seconds: 3),
child: FlutterLogo(size: 100),
)
注意事项 / Notes
- speed 越小旋转越快 / Smaller speed means faster rotation
- 组件会持续旋转直到销毁 / Rotates continuously until disposed
- 适合用作加载指示器 / Suitable for loading indicators
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- RotatingView
- Available extensions
Constructors
- RotatingView({required Widget child, Duration? speed = const Duration(seconds: 2), Key? key})
-
const
Properties
- child → Widget
-
子组件 / Child widget
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- speed → Duration?
-
旋转速度 / Rotation speed
final
Methods
-
blurred(
{double blur = 5, Color blurColor = Colors.white, BorderRadius? borderRadius, double colorOpacity = 0.5, Widget? overlay, AlignmentGeometry alignment = Alignment.center}) → Blur -
Available on Widget, provided by the BlurExtension extension
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< RotatingView> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
frosted(
{double blur = 5, Color frostColor = Colors.white, AlignmentGeometry alignment = Alignment.center, double? height, double? width, double frostOpacity = 0.0, BorderRadius? borderRadius, EdgeInsetsGeometry padding = EdgeInsets.zero}) → Blur -
Available on Widget, provided by the FrostExtension extension
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited