Rework profile FOVs - 360 checkbox

This commit is contained in:
stopflock
2026-03-14 17:18:33 -05:00
parent 2d00d7a8fb
commit 16e34b614f
20 changed files with 232 additions and 29 deletions
+12
View File
@@ -225,10 +225,22 @@ class ChangelogService {
versionsNeedingMigration.add('1.6.3');
}
if (needsMigration(lastSeenVersion, currentVersion, '1.8.0')) {
versionsNeedingMigration.add('1.8.0');
}
if (needsMigration(lastSeenVersion, currentVersion, '2.1.0')) {
versionsNeedingMigration.add('2.1.0');
}
if (needsMigration(lastSeenVersion, currentVersion, '2.7.3')) {
versionsNeedingMigration.add('2.7.3');
}
if (needsMigration(lastSeenVersion, currentVersion, '2.10.0')) {
versionsNeedingMigration.add('2.10.0');
}
// Future versions can be added here
// if (needsMigration(lastSeenVersion, currentVersion, '2.0.0')) {
// versionsNeedingMigration.add('2.0.0');
+7 -2
View File
@@ -3,6 +3,7 @@ import 'package:flutter/foundation.dart';
import 'package:uuid/uuid.dart';
import '../models/node_profile.dart';
import '../dev_config.dart';
class ProfileImportService {
// Maximum size for base64 encoded profile data (approx 50KB decoded)
@@ -72,13 +73,17 @@ class ProfileImportService {
final requiresDirection = data['requiresDirection'] ?? true;
final submittable = data['submittable'] ?? true;
// Parse FOV if provided
// Parse FOV if provided, applying restrictions based on dev config
double? fov;
if (data['fov'] != null) {
if (data['fov'] is num) {
final fovValue = (data['fov'] as num).toDouble();
if (fovValue > 0 && fovValue <= 360) {
fov = fovValue;
// If non-360 FOVs are disabled, only allow 360° FOV
if (kEnableNon360FOVs || fovValue == 360.0) {
fov = fovValue;
}
// Otherwise, clear non-360 FOV values (set fov to null)
}
}
}