-
Notifications
You must be signed in to change notification settings - Fork 225
Add clipRRect parameter to WaveStyle #258
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,6 +65,9 @@ class WaveStyle { | |
| /// Value > 0 will be padded right and value < 0 will be padded left. | ||
| final double durationTextPadding; | ||
|
|
||
| /// Applies this clipRRect to waveforms. | ||
| final RRect? clipRRect; | ||
|
Comment on lines
+68
to
+69
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Exposing this as a raw |
||
|
|
||
| /// Applies this gradient to waveforms. | ||
| /// | ||
| /// **Use as below** | ||
|
|
@@ -113,6 +116,7 @@ class WaveStyle { | |
| this.durationLinesColor = Colors.blueAccent, | ||
| this.gradient, | ||
| this.scaleFactor = 20.0, | ||
| this.clipRRect, | ||
| }) : assert(waveThickness < spacing, | ||
| "waveThickness can't be greater than spacing"); | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change to
getDecibellooks unrelated to the clipRRect feature — could it move to its own PR? Beyond scope, returning0in the catch is risky: the method returnsFuture<double?>, so0reads as a genuine decibel value and callers can't distinguish a real reading from a failure.I'd let the
PlatformExceptionpropagate, or returnnullto signal "no value", and log the error rather than discard it. The boundeis also unused (the analyzer flagsunused_catch_clause) —catch (_)oron PlatformException catchwould be cleaner.