Skip to content

Commit 98fac95

Browse files
committed
fix some crashes
1 parent 90dd73f commit 98fac95

5 files changed

Lines changed: 8 additions & 4 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
**Changelog:**
2+
- Fixed crash on random page when no shockers are selected
3+
- Fixed crash on alarm tone creation when adding multiple components in succession

lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const String issues_url =
1818
"https://github.com/ComputerElite/ShockAlarmApp/issues";
1919

2020
String GetUserAgent() {
21-
return "ShockAlarm/0.3.5";
21+
return "ShockAlarm/0.3.6";
2222
}
2323

2424
bool isAndroid() {

lib/screens/shockers/shocker_item.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ class IntensityDurationSelectorState extends State<IntensityDurationSelector> {
541541
widget.allowRandom
542542
? RangeSlider(
543543
values: widget.controlsContainer.intensityRange,
544-
divisions: widget.maxIntensity,
544+
divisions: widget.maxIntensity <= 0 ? 1 : widget.maxIntensity,
545545
max: widget.maxIntensity.toDouble(),
546546
min: 0,
547547
onChanged: (RangeValues values) {

lib/stores/alarm_store.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class AlarmToneComponent {
7070
int duration = 1000;
7171
ControlType? type = ControlType.vibrate;
7272
int time = 0;
73+
int internalReference = DateTime.now().microsecondsSinceEpoch;
7374

7475
AlarmToneComponent({this.intensity = 25, this.duration = 1000, this.type = ControlType.vibrate, this.time = 0});
7576

@@ -113,7 +114,7 @@ class AlarmToneComponent {
113114
}
114115

115116
getId() {
116-
return "$intensity-$duration-${type?.index}-$time";
117+
return "$intensity-$duration-${type?.index}-$time-$internalReference";
117118
}
118119
}
119120

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
1616
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
1717
# In Windows, build-name is used as the major, minor, and patch parts
1818
# of the product and file versions while build-number is used as the build suffix.
19-
version: 0.3.5+38
19+
version: 0.3.6+39
2020
environment:
2121
sdk: ^3.6.0
2222
flutter: ">=3.29.2"

0 commit comments

Comments
 (0)