Skip to content

Commit 7e53724

Browse files
authored
Merge pull request #265 from GeekyAnts/main
geekyants_flutter_gauges: 1.0.4
2 parents 43eb8ab + 103ac4d commit 7e53724

File tree

21 files changed

+225
-70
lines changed

21 files changed

+225
-70
lines changed

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1+
## 1.0.4
2+
3+
**Features**
4+
5+
- Add Custom Track Labels to Radial Gauge
6+
7+
**Fixes**
8+
9+
- Fixed needle-gap issue in Radial Gauge
10+
111
## 1.0.3
212

313
**Fixes**
414

515
- Fixed Drawing of `Pointer` over `valueBar`
616

7-
817
## 1.0.2
918

1019
**Features**

README.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ This will add a line like this to your package's pubspec.yaml (and run an implic
6464

6565
```dart
6666
dependencies:
67-
geekyants_flutter_gauges: 1.0.1
67+
geekyants_flutter_gauges: 1.0.4
6868
```
6969

7070
## Usage
@@ -77,6 +77,8 @@ import 'package:geekyants_flutter_gauges/geekyants_flutter_gauges.dart';
7777

7878
Use it as below
7979

80+
# Linear Gauge usage
81+
8082
```dart
8183
class _MyGaugeExampleState extends State<MyGaugeExample> {
8284
@override
@@ -94,6 +96,31 @@ class _MyGaugeExampleState extends State<MyGaugeExample> {
9496
}
9597
```
9698

99+
# Radial Gauge usage
100+
101+
```dart
102+
class _MyGaugeExampleState extends State<MyGaugeExample> {
103+
@override
104+
Widget build(BuildContext context) {
105+
return Scaffold(
106+
body: Center(
107+
child: RadialGauge(
108+
track: RadialTrack(
109+
start: 0,
110+
end: 100,
111+
),
112+
needlePointer: [
113+
NeedlePointer(
114+
value: 30,
115+
),
116+
],
117+
),
118+
)
119+
);
120+
}
121+
}
122+
```
123+
97124
## Linear Gauge
98125

99126
### **Gauge Orientation**:
@@ -167,6 +194,12 @@ Default **`endAngle`**`: 210°
167194

168195
<p align='center'><img src="https://raw.githubusercontent.com/GeekyAnts/GaugesFlutter/main/example/screens/radial-angles.png" alt="radial-angels" height=440></p>
169196

197+
#### Custom Track Labels
198+
199+
The labels displayed on the RadialGauge track can easily be formated to your need.
200+
201+
<p align='center'><img src="example/screens/radial-custom-track-label.png" alt="radial-gauge-custom-track-label" height=440></p>
202+
170203
#### **Radii Customization**
171204

172205
`radiusFactor` can be used to size the adjust the scaling factor of the radius and change the radius of the gauge accordingly.
@@ -224,3 +257,7 @@ In the Radial Gauge, the `NeedlePointer` and `RadialShapePointer` can be set to
224257
## Credits
225258

226259
Made with ❤️ by <a href="https://geekyants.com/" ><img src="https://s3.ap-southeast-1.amazonaws.com/cdn.elitmus.com/sy0zfezmfdovlb4vaz6siv1l7g30" height="17"/></a>
260+
261+
```
262+
263+
```

example/lib/main.dart

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,12 @@ class _RadialGaugeExampleState extends State<RadialGaugeExample> {
6464
backgroundColor: Colors.white,
6565
body: RadialGauge(
6666
track: RadialTrack(
67-
color: Colors.grey,
68-
start: 0,
69-
end: 100,
70-
trackStyle: TrackStyle(
71-
showLastLabel: false,
72-
secondaryRulerColor: Colors.grey,
73-
secondaryRulerPerInterval: 3)),
67+
start: 0,
68+
end: 100,
69+
),
7470
needlePointer: [
7571
NeedlePointer(
7672
value: 30,
77-
color: Colors.red,
78-
tailColor: Colors.black,
79-
tailRadius: 0,
80-
needleStyle: NeedleStyle.flatNeedle,
8173
),
8274
],
8375
),
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:geekyants_flutter_gauges/geekyants_flutter_gauges.dart';
3+
4+
///
5+
/// The following code is a Simple Example of [RadialGauge] Widget with custom track labels.
6+
///
7+
class RadialGaugeCustomLabel extends StatefulWidget {
8+
const RadialGaugeCustomLabel({super.key});
9+
10+
@override
11+
State<RadialGaugeCustomLabel> createState() => _RadialGaugeCustomLabelState();
12+
}
13+
14+
class _RadialGaugeCustomLabelState extends State<RadialGaugeCustomLabel> {
15+
@override
16+
Widget build(BuildContext context) {
17+
return Scaffold(
18+
backgroundColor: Colors.white,
19+
body: RadialGauge(
20+
track: RadialTrack(
21+
color: Colors.grey,
22+
start: 0,
23+
end: 100,
24+
trackLabelFormater: (double value) => "${value.round()}€",
25+
trackStyle: const TrackStyle(
26+
showFirstLabel: false,
27+
showLastLabel: false,
28+
)),
29+
),
30+
);
31+
}
32+
}

example/macos/Runner.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@
182182
isa = PBXProject;
183183
attributes = {
184184
LastSwiftUpdateCheck = 0920;
185-
LastUpgradeCheck = 1430;
185+
LastUpgradeCheck = 1510;
186186
ORGANIZATIONNAME = "";
187187
TargetAttributes = {
188188
33CC10EC2044A3C60003C045 = {

example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1430"
3+
LastUpgradeVersion = "1510"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

example/pubspec.lock

Lines changed: 52 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,18 @@ packages:
3737
dependency: transitive
3838
description:
3939
name: collection
40-
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
40+
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
4141
url: "https://pub.dev"
4242
source: hosted
43-
version: "1.17.2"
43+
version: "1.18.0"
4444
cupertino_icons:
4545
dependency: "direct main"
4646
description:
4747
name: cupertino_icons
48-
sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be
48+
sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6
4949
url: "https://pub.dev"
5050
source: hosted
51-
version: "1.0.5"
51+
version: "1.0.8"
5252
fake_async:
5353
dependency: transitive
5454
description:
@@ -66,10 +66,10 @@ packages:
6666
dependency: "direct dev"
6767
description:
6868
name: flutter_lints
69-
sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c
69+
sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04
7070
url: "https://pub.dev"
7171
source: hosted
72-
version: "2.0.1"
72+
version: "2.0.3"
7373
flutter_test:
7474
dependency: "direct dev"
7575
description: flutter
@@ -81,47 +81,71 @@ packages:
8181
path: ".."
8282
relative: true
8383
source: path
84-
version: "1.0.2"
84+
version: "1.0.3"
85+
leak_tracker:
86+
dependency: transitive
87+
description:
88+
name: leak_tracker
89+
sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa"
90+
url: "https://pub.dev"
91+
source: hosted
92+
version: "10.0.0"
93+
leak_tracker_flutter_testing:
94+
dependency: transitive
95+
description:
96+
name: leak_tracker_flutter_testing
97+
sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0
98+
url: "https://pub.dev"
99+
source: hosted
100+
version: "2.0.1"
101+
leak_tracker_testing:
102+
dependency: transitive
103+
description:
104+
name: leak_tracker_testing
105+
sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47
106+
url: "https://pub.dev"
107+
source: hosted
108+
version: "2.0.1"
85109
lints:
86110
dependency: transitive
87111
description:
88112
name: lints
89-
sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593"
113+
sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452"
90114
url: "https://pub.dev"
91115
source: hosted
92-
version: "2.0.1"
116+
version: "2.1.1"
93117
matcher:
94118
dependency: transitive
95119
description:
96120
name: matcher
97-
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
121+
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
98122
url: "https://pub.dev"
99123
source: hosted
100-
version: "0.12.16"
124+
version: "0.12.16+1"
101125
material_color_utilities:
102126
dependency: transitive
103127
description:
104128
name: material_color_utilities
105-
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
129+
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
106130
url: "https://pub.dev"
107131
source: hosted
108-
version: "0.5.0"
132+
version: "0.8.0"
109133
meta:
110134
dependency: transitive
111135
description:
112136
name: meta
113-
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
137+
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
114138
url: "https://pub.dev"
115139
source: hosted
116-
version: "1.9.1"
140+
version: "1.11.0"
117141
path:
118142
dependency: transitive
119143
description:
120144
name: path
121-
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
145+
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
122146
url: "https://pub.dev"
123147
source: hosted
124-
version: "1.8.3"
148+
version: "1.9.0"
125149
sky_engine:
126150
dependency: transitive
127151
description: flutter
@@ -139,18 +163,18 @@ packages:
139163
dependency: transitive
140164
description:
141165
name: stack_trace
142-
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
166+
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
143167
url: "https://pub.dev"
144168
source: hosted
145-
version: "1.11.0"
169+
version: "1.11.1"
146170
stream_channel:
147171
dependency: transitive
148172
description:
149173
name: stream_channel
150-
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
174+
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
151175
url: "https://pub.dev"
152176
source: hosted
153-
version: "2.1.1"
177+
version: "2.1.2"
154178
string_scanner:
155179
dependency: transitive
156180
description:
@@ -171,10 +195,10 @@ packages:
171195
dependency: transitive
172196
description:
173197
name: test_api
174-
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
198+
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
175199
url: "https://pub.dev"
176200
source: hosted
177-
version: "0.6.0"
201+
version: "0.6.1"
178202
vector_math:
179203
dependency: transitive
180204
description:
@@ -183,14 +207,14 @@ packages:
183207
url: "https://pub.dev"
184208
source: hosted
185209
version: "2.1.4"
186-
web:
210+
vm_service:
187211
dependency: transitive
188212
description:
189-
name: web
190-
sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
213+
name: vm_service
214+
sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957
191215
url: "https://pub.dev"
192216
source: hosted
193-
version: "0.1.4-beta"
217+
version: "13.0.0"
194218
sdks:
195-
dart: ">=3.1.0-185.0.dev <4.0.0"
219+
dart: ">=3.2.0-0 <4.0.0"
196220
flutter: ">=1.17.0"
26.1 KB
Loading

lib/src/linear_gauge/custom_label/custom_ruler_label.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
/// ```
1313
///
1414
///
15-
1615
class CustomRulerLabel {
1716
const CustomRulerLabel({
1817
required this.text,

lib/src/radial_gauge/pointer/needle_pointer_painter.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ class RenderNeedlePointer extends RenderBox {
200200

201201
final needlePaint = Paint()
202202
..color = _color
203+
..style = PaintingStyle.fill
203204
..strokeWidth = strokeWidth
204205
..shader = gradient.createShader(
205206
Rect.fromPoints(

0 commit comments

Comments
 (0)