TimeZone support
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user