GeekyAnts / GaugesFlutter

A gauge package for Flutter that displays progress and can be customized for appearance and behavior.
https://pub.dev/packages/geekyants_flutter_gauges
MIT License
67 stars 15 forks source link

Custom track labels #248

Closed LudoPL closed 10 months ago

LudoPL commented 1 year ago

Allow to customize track labels. New version of https://github.com/GeekyAnts/GaugesFlutter/pull/246 Do not hesitate to modify it as it suits you.

hasnentai commented 1 year ago

Hi, @LudoPL I appreciate your efforts in adding custom labels in Radial Gauge. Since we are following an architecture and we have built a custom label for linear gauge something like the below and would like to have the same for RadialGauge as well by using the same class. Will you be willing to take a look at how we have done that by reading the Linear Guage code?

https://github.com/GeekyAnts/GaugesFlutter/blob/9fb6df8ba7e6628cfefd91b267405f01cb723df8/lib/src/linear_gauge/custom_label/custom_ruler_label.dart#L16-L41

and here is how we are using it https://github.com/GeekyAnts/GaugesFlutter/blob/9fb6df8ba7e6628cfefd91b267405f01cb723df8/lib/src/linear_gauge/linear_gauge_label.dart#L38-L47

LudoPL commented 1 year ago

Hi ! Sorry for the response delay, I'm in holidays. I don't think I will spend time on it, as I am not sure I understand what you want exactly. Of course it would be good to have more consistency between you linear and radial widget (I haven't use the linear one on my side). But as I understand, here you have "steps" and primary and secondary rulers parameters that are all linked to the labels. I mean if you authorize to configure Label with a list of "text + value", labels won't be aligned with rulers, and it seems to me that the library will be harder to configured. Moreover you already have "RadialWidgetPainter" which I think are dedicated to place a list of element at a specific place on the track (can be "Text" element with label). I have done a PR to fix what seems to be some issue with it https://github.com/GeekyAnts/GaugesFlutter/pull/247. My PR probably lack the possibility to configure a "shift" to place the label more inside or outside the track. Of course it's your project so totally feel free to implement it as it suit you. I will be happy to follow the evolution of your very useful library.