Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix-Needle gap error #242

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ This will add a line like this to your package's pubspec.yaml (and run an implic

```dart
dependencies:
geekyants_flutter_gauges: 1.0.1
geekyants_flutter_gauges: 1.0.2
```

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

Use it as below

# Linear Gauge usage

```dart
class _MyGaugeExampleState extends State<MyGaugeExample> {
@override
Expand All @@ -94,6 +96,31 @@ class _MyGaugeExampleState extends State<MyGaugeExample> {
}
```

# Radial Gauge usage

```dart
class _MyGaugeExampleState extends State<MyGaugeExample> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: RadialGauge(
track: RadialTrack(
start: 0,
end: 100,
),
needlePointer: [
NeedlePointer(
value: 30,
),
],
),
)
);
}
}
```

## Linear Gauge

### **Gauge Orientation**:
Expand Down Expand Up @@ -224,3 +251,7 @@ In the Radial Gauge, the `NeedlePointer` and `RadialShapePointer` can be set to
## Credits

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

```

```
14 changes: 3 additions & 11 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,12 @@ class _RadialGaugeExampleState extends State<RadialGaugeExample> {
backgroundColor: Colors.white,
body: RadialGauge(
track: RadialTrack(
color: Colors.grey,
start: 0,
end: 100,
trackStyle: TrackStyle(
showLastLabel: false,
secondaryRulerColor: Colors.grey,
secondaryRulerPerInterval: 3)),
start: 0,
end: 100,
),
needlePointer: [
NeedlePointer(
value: 30,
color: Colors.red,
tailColor: Colors.black,
tailRadius: 0,
needleStyle: NeedleStyle.flatNeedle,
),
],
),
Expand Down
1 change: 1 addition & 0 deletions lib/src/radial_gauge/pointer/needle_pointer_painter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ class RenderNeedlePointer extends RenderBox {

final needlePaint = Paint()
..color = _color
..style = PaintingStyle.fill
..strokeWidth = strokeWidth
..shader = gradient.createShader(
Rect.fromPoints(
Expand Down
Loading