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

Custom label feature added #45

Merged
merged 5 commits into from
Mar 6, 2023
Merged

Conversation

SahilSharma2710
Copy link
Collaborator

@SahilSharma2710 SahilSharma2710 commented Mar 5, 2023

This PR closes or fixes #28 issue
Now user can add CustomLabels to the linear gauge (shown in image below)
Screenshot 2023-03-05 at 10 54 33 PM

When users added custom labels starting and ending value of the linear gauge is set up according to the user custom labels
Screenshot 2023-03-05 at 10 47 46 PM

For this addCustomLabels function is added in linear_gauge_label.dart file
Screenshot 2023-03-05 at 10 49 32 PM

To create offset for labels new mathematical expression is created
Screenshot 2023-03-05 at 10 50 22 PM

@SahilSharma2710 SahilSharma2710 linked an issue Mar 5, 2023 that may be closed by this pull request
@SahilSharma2710 SahilSharma2710 added the Feature This is a new feature for the project label Mar 5, 2023
/// ```dart
/// child : const LinearGauge(
/// customLabels: [
/// CustomLinearGaugeLabel(text: "1%", value: 10),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent is missing here for CustomLinearGaugeLabel

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once we change the class name we need to change every where in the example and files

@@ -0,0 +1,40 @@
class CustomLinearGaugeLabel {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need a small change here
can we change the class name to RulerCustomLabel? I think that make more sense .
What do you think ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes agreed that will make more sense . Custom labels are for all gauges not only for linear. Will change that.

Copy link
Contributor

@hasnentai hasnentai Mar 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or how about maybe CustomRulerLabel? Lets try to keep RulerLabel together

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per terminology we used , labels are part of rulers only. So CustomRulerBar or CustomRuler can also work but for user CustomRulerLabel make more sence . So what should be the final call

Copy link
Contributor

@hasnentai hasnentai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

202313172-687ccda4-96b5-47c4-b8e5-fe653dd442c7

@hasnentai hasnentai merged commit 01dfeaa into GeekyAnts:main Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature This is a new feature for the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide an API to enable users to pass custom labels
2 participants