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

assert added for custom labels #123

Merged
merged 2 commits into from
Mar 21, 2023
Merged

Conversation

SahilSharma2710
Copy link
Collaborator

fixes #116

Assert has been added to add atleast two custom labels and first custom label value should be less than last

@@ -39,6 +39,15 @@ class LinearGauge extends StatefulWidget {
this.enableAnimation = false,
this.extendLinearGauge = 0,
}) : assert(() {
if (customLabels!.isNotEmpty) {
if (customLabels.length < 2) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove if from here and write it in assert

}

if (customLabels.first.value! > customLabels.last.value!) {
assert(false, "Start should be less then end");
Copy link
Contributor

Choose a reason for hiding this comment

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

remove if and write in assert

@hasnentai hasnentai merged commit e664257 into GeekyAnts:main Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CustomLabels] : CustomLabels Throws Error When Single Label Passed at 0 value
2 participants