1
+ import 'package:flutter_examples/model/sample_view.dart' ;
2
+ import 'package:syncfusion_flutter_gauges/gauges.dart' ;
3
+ import 'package:flutter/foundation.dart' ;
4
+ import 'package:flutter/material.dart' ;
5
+
6
+ //ignore: must_be_immutable
7
+ class RadialEaseExample extends SampleView {
8
+ const RadialEaseExample (Key key) : super (key: key);
9
+
10
+ @override
11
+ _RadialEaseExampleState createState () => _RadialEaseExampleState ();
12
+ }
13
+
14
+ class _RadialEaseExampleState extends SampleViewState {
15
+ _RadialEaseExampleState ();
16
+
17
+ @override
18
+ Widget build (BuildContext context) {
19
+ return getRadialEaseExample ();
20
+ }
21
+
22
+
23
+ SfRadialGauge getRadialEaseExample () {
24
+ return SfRadialGauge (
25
+ axes: < RadialAxis > [
26
+ RadialAxis (
27
+ startAngle: 0 ,
28
+ endAngle: 360 ,
29
+ showLabels: false ,
30
+ showTicks: false ,
31
+ radiusFactor: kIsWeb ? 0.8 : 0.9 ,
32
+ axisLineStyle: AxisLineStyle (
33
+ thicknessUnit: GaugeSizeUnit .factor,
34
+ thickness: isCardView ? 0.07 : 0.1 )),
35
+ RadialAxis (
36
+ startAngle: 170 ,
37
+ endAngle: 170 ,
38
+ showTicks: false ,
39
+ labelFormat: '{value}M' ,
40
+ showAxisLine: false ,
41
+ radiusFactor: kIsWeb ? 0.8 : 0.9 ,
42
+ minimum: 0 ,
43
+ maximum: 15 ,
44
+ showLastLabel: false ,
45
+ axisLabelStyle: GaugeTextStyle (
46
+ fontSize: isCardView ? 10 : 12 , fontWeight: FontWeight .w500),
47
+ labelOffset: 25 ,
48
+ interval: isCardView ? 1 : _interval,
49
+ canRotateLabels: true ,
50
+ annotations: < GaugeAnnotation > [
51
+ GaugeAnnotation (
52
+ positionFactor: 1 ,
53
+ axisValue: 0 ,
54
+ widget: Container (
55
+ height: isCardView ? 30 : 45 ,
56
+ width: isCardView ? 30 : 45 ,
57
+ decoration: const BoxDecoration (
58
+ image: DecorationImage (
59
+ image: ExactAssetImage ('images/shotput.png' ),
60
+ fit: BoxFit .fitHeight,
61
+ ),
62
+ ))),
63
+ GaugeAnnotation (
64
+ widget: Container (
65
+ child: const Text ('Distance' , style: TextStyle (fontSize: 20 )),
66
+ ))
67
+ ],
68
+ pointers: < GaugePointer > [
69
+ RangePointer (
70
+ value: 11.5 ,
71
+ width: 0.1 ,
72
+ color: const Color (0xFFF67280 ),
73
+ enableAnimation: true ,
74
+ sizeUnit: GaugeSizeUnit .factor,
75
+ animationType: AnimationType .ease,
76
+ gradient: kIsWeb
77
+ ? null
78
+ : const SweepGradient (
79
+ colors: < Color > [Color (0xFFFFB397 ), Color (0xFFF46AA0 )],
80
+ stops: < double > [0.25 , 0.75 ]),
81
+ ),
82
+ kIsWeb
83
+ ? MarkerPointer (
84
+ value: 11.5 ,
85
+ markerType: MarkerType .circle,
86
+ enableAnimation: true ,
87
+ animationType: AnimationType .ease,
88
+ color: Colors .blue,
89
+ markerHeight: isCardView ? 30 : 40 ,
90
+ markerOffset: 4 ,
91
+ markerWidth: isCardView ? 30 : 40 )
92
+ : MarkerPointer (
93
+ value: 11.5 ,
94
+ markerType: MarkerType .image,
95
+ enableAnimation: true ,
96
+ animationType: AnimationType .ease,
97
+ imageUrl: 'images/ball.png' ,
98
+ markerHeight: isCardView ? 30 : 40 ,
99
+ markerOffset: 4 ,
100
+ markerWidth: isCardView ? 30 : 40 )
101
+ ])
102
+ ],
103
+ );
104
+ }
105
+
106
+ final double _interval = 1 ;
107
+ }
0 commit comments