Skip to content

Commit

Permalink
Convert loaded settings numbers to double
Browse files Browse the repository at this point in the history
  • Loading branch information
mjansen4857 committed Feb 5, 2024
1 parent 6288e8f commit b34246e
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions lib/pages/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -535,15 +535,21 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
.toList() ??
Defaults.autoFolders);
widget.prefs.setDouble(PrefsKeys.defaultMaxVel,
json[PrefsKeys.defaultMaxVel] ?? Defaults.defaultMaxVel);
widget.prefs.setDouble(PrefsKeys.defaultMaxAccel,
json[PrefsKeys.defaultMaxAccel] ?? Defaults.defaultMaxAccel);
widget.prefs.setDouble(PrefsKeys.defaultMaxAngVel,
json[PrefsKeys.defaultMaxAngVel] ?? Defaults.defaultMaxAngVel);
widget.prefs.setDouble(PrefsKeys.defaultMaxAngAccel,
json[PrefsKeys.defaultMaxAngAccel] ?? Defaults.defaultMaxAngAccel);
json[PrefsKeys.defaultMaxVel]?.toDouble() ?? Defaults.defaultMaxVel);
widget.prefs.setDouble(

Check warning on line 539 in lib/pages/home_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/home_page.dart#L538-L539

Added lines #L538 - L539 were not covered by tests
PrefsKeys.defaultMaxAccel,
json[PrefsKeys.defaultMaxAccel]?.toDouble() ??

Check warning on line 541 in lib/pages/home_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/home_page.dart#L541

Added line #L541 was not covered by tests
Defaults.defaultMaxAccel);
widget.prefs.setDouble(

Check warning on line 543 in lib/pages/home_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/home_page.dart#L543

Added line #L543 was not covered by tests
PrefsKeys.defaultMaxAngVel,
json[PrefsKeys.defaultMaxAngVel]?.toDouble() ??

Check warning on line 545 in lib/pages/home_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/home_page.dart#L545

Added line #L545 was not covered by tests
Defaults.defaultMaxAngVel);
widget.prefs.setDouble(

Check warning on line 547 in lib/pages/home_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/home_page.dart#L547

Added line #L547 was not covered by tests
PrefsKeys.defaultMaxAngAccel,
json[PrefsKeys.defaultMaxAngAccel]?.toDouble() ??

Check warning on line 549 in lib/pages/home_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/home_page.dart#L549

Added line #L549 was not covered by tests
Defaults.defaultMaxAngAccel);
widget.prefs.setDouble(PrefsKeys.maxModuleSpeed,
json[PrefsKeys.maxModuleSpeed] ?? Defaults.maxModuleSpeed);
json[PrefsKeys.maxModuleSpeed]?.toDouble() ?? Defaults.maxModuleSpeed);

Check warning on line 552 in lib/pages/home_page.dart

View check run for this annotation

Codecov / codecov/patch

lib/pages/home_page.dart#L552

Added line #L552 was not covered by tests
}

void _saveProjectSettingsToFile(Directory projectDir) {
Expand Down

0 comments on commit b34246e

Please sign in to comment.