-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtickless_hand.dart
executable file
·52 lines (48 loc) · 1.47 KB
/
tickless_hand.dart
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
// Copyright 2020 Shakir Kasmani. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the tourbillon_clock/LICENSE file.
import 'package:flutter/material.dart';
class TicklessHand extends AnimatedWidget {
const TicklessHand(
{Key key,
@required this.size,
@required this.color,
AnimationController controller})
: assert(controller != null),
super(key: key, listenable: controller);
final double size;
final Color color;
Animation<double> get _progress => listenable;
@override
Widget build(BuildContext context) {
return RotationTransition(
turns: _progress,
child: Center(
child: SizedBox.expand(
child: Container(
child: Transform.scale(
scale: size,
alignment: Alignment.center,
child: Container(
child: Center(
child: Transform.translate(
offset: Offset(0.0, -63.0),
child: Container(
width: 7,
height: 221,
decoration: ShapeDecoration(
color: color,
shape: BeveledRectangleBorder(
borderRadius: BorderRadius.circular(11)),
),
),
),
),
),
),
),
),
),
);
}
}