GeekyAnts / GeekyAnts/GaugesFlutter

Pointer padding / custom label formatter

Open
#280 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
78
Forks
23
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
I cannot find a way to add padding to the linear gauge, as you can see in the below image there is padding/margin between the pointer and the gauge itself.

Additionally, as per the below image, I would like a custom label formatter where we can specify the text to show for the label. E.g. instead of showing the double value of the gauge, we can show any text.

![Screenshot from 2024-07-15 10-12-43](https://github.com/user-attachments/assets/94b230a4-8977-4e68-b25e-2b5eaf1a311b)

**Describe the solution you'd like**
A good solution would be to add a padding property to the Pointer object, this padding value can be used when calculating the offset of the label before drawing onto the canvas.

A potential solution for the custom label could be to have a property similar to the onchanged property that gives the user access to the double value but returns a string object and the user has a choice if they want to use the double value or not.
I.e.,
```
Pointer(
labelFormatter: (value) {
if (condition) {
return value.toString();
} else {
return "F1";
}
},
)
```

**Additional context**
Add any other context or screenshots about the feature request here.

Example of final product:
![Screenshot from 2024-07-15 10-12-43](https://github.com/user-attachments/assets/e271233e-5b6c-4606-88ed-f9930ebb0563)

Many thanks guys, a really great Gauge library!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start from the Pointer API and the linear gauge's canvas label-offset calculation. Work out how a padding property and a formatter returning text should fit the existing gauge behavior, then verify that both pointer spacing and custom label output work without changing the default value display.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
mobile
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.