-
Notifications
You must be signed in to change notification settings - Fork 11
/
main.dart
78 lines (70 loc) · 1.87 KB
/
main.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import 'package:example/gauge_vertical.dart';
import 'package:flutter/material.dart';
import 'package:geekyants_flutter_gauges/geekyants_flutter_gauges.dart';
void main() {
runApp(
const MaterialApp(
debugShowCheckedModeBanner: false,
home: MyVerticalGauge(),
),
);
}
///
/// The following code is a Simple Example of [LinearGauge] Widget.
/// You can customize the [LinearGauge] Widget as per your need.
///
class LinearGaugeExample extends StatefulWidget {
const LinearGaugeExample({Key? key}) : super(key: key);
@override
State<LinearGaugeExample> createState() => _LinearGaugeExampleState();
}
class _LinearGaugeExampleState extends State<LinearGaugeExample> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: LinearGauge(
gaugeOrientation: GaugeOrientation.horizontal,
enableGaugeAnimation: true,
rulers: RulerStyle(
rulerPosition: RulerPosition.bottom,
),
pointers: const [
Pointer(
value: 50,
shape: PointerShape.circle,
),
],
),
),
);
}
}
///
/// The following code is a Simple Example of [RadialGauge] Widget.
/// You can customize the [RadialGauge] Widget as per your need.
///
class RadialGaugeExample extends StatefulWidget {
const RadialGaugeExample({super.key});
@override
State<RadialGaugeExample> createState() => _RadialGaugeExampleState();
}
class _RadialGaugeExampleState extends State<RadialGaugeExample> {
@override
Widget build(BuildContext context) {
return const Scaffold(
backgroundColor: Colors.white,
body: RadialGauge(
track: RadialTrack(
start: 0,
end: 100,
),
needlePointer: [
NeedlePointer(
value: 30,
),
],
),
);
}
}