forked from ibhavikmakwana/FlutterPlayground
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRotationTransitionExample.dart
More file actions
53 lines (45 loc) · 1.23 KB
/
RotationTransitionExample.dart
File metadata and controls
53 lines (45 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
class RotationTransitionExample extends StatefulWidget {
final String title;
RotationTransitionExample(this.title);
@override
_RotationTransitionExampleState createState() =>
_RotationTransitionExampleState();
}
class _RotationTransitionExampleState extends State<RotationTransitionExample>
with SingleTickerProviderStateMixin {
AnimationController _animation;
@override
void initState() {
super.initState();
_animation = AnimationController(
duration: const Duration(milliseconds: 3600),
vsync: this,
)..repeat();
}
@override
void dispose() {
_animation.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: RotationTransition(
turns: _animation,
child: Container(
decoration: FlutterLogoDecoration(),
width: 200.0,
height: 200.0,
)),
),
);
}
}