TimeZone support

This commit is contained in:
2026-03-21 20:30:37 -05:00
parent 64f6024b4e
commit 06b71d6caf
7 changed files with 295 additions and 378 deletions

View File

@@ -4,6 +4,7 @@ import 'dart:convert';
import 'package:blind_master/BlindMasterResources/error_snackbar.dart';
import 'package:blind_master/BlindMasterResources/secure_transmissions.dart';
import 'package:blind_master/BlindMasterResources/text_inputs.dart';
import 'package:blind_master/BlindMasterResources/timezone_picker.dart';
import 'package:blind_master/BlindMasterScreens/home_screen.dart';
import 'package:blind_master/utils_from_FBPExample/extra.dart';
import 'package:flutter/material.dart';
@@ -29,6 +30,7 @@ class SetDeviceName extends StatefulWidget {
class _SetDeviceNameState extends State<SetDeviceName> {
final deviceNameController = TextEditingController();
String? _selectedTimezone;
Widget? screen;
StreamSubscription<List<int>>? _authSub;
@@ -53,11 +55,22 @@ class _SetDeviceNameState extends State<SetDeviceName> {
"Device Name (Different from others)",
controller: deviceNameController,
),
const SizedBox(height: 16),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: TimezonePicker(
value: _selectedTimezone,
label: 'Device Timezone (optional)',
onChanged: (tz) => setState(() {
_selectedTimezone = tz;
initScreen();
}),
),
),
const SizedBox(height: 16),
ElevatedButton(
onPressed: onPressed,
child: Text(
"Add to Account"
)
child: const Text("Add to Account"),
),
],
);
@@ -67,6 +80,7 @@ class _SetDeviceNameState extends State<SetDeviceName> {
final payload = {
'deviceName': name,
'maxPorts': widget.maxPorts,
if (_selectedTimezone != null) 'timezone': _selectedTimezone,
};
String? token;
try {