diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index e3773d4..f56da16 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -73,6 +73,12 @@ ReferencedContainer = "container:Runner.xcodeproj"> + + + + { Widget build(BuildContext context) { return AlertDialog( title: Text( - 'New Schedule', + (widget.isEditing) ? 'Edit Schedule' : 'New Schedule', style: GoogleFonts.aBeeZee(), ), content: Column( diff --git a/lib/BlindMasterScreens/individualControl/peripheral_screen.dart b/lib/BlindMasterScreens/individualControl/peripheral_screen.dart index 9ccc8be..969f93c 100644 --- a/lib/BlindMasterScreens/individualControl/peripheral_screen.dart +++ b/lib/BlindMasterScreens/individualControl/peripheral_screen.dart @@ -168,6 +168,8 @@ class _PeripheralScreenState extends State { calibrated = true; calibrationStage = 0; }); + // Fetch updated peripheral data after calibration completes + fetchState(); } } }); @@ -198,6 +200,7 @@ class _PeripheralScreenState extends State { if (response == null) throw Exception("auth error"); if (response.statusCode != 202) throw Exception("Server Error"); + calibrated = false; } catch (e) { if (!mounted) return; ScaffoldMessenger.of(context).showSnackBar(errorSnackbar(e)); @@ -287,7 +290,7 @@ class _PeripheralScreenState extends State { } } - Future loop() async{ + Future fetchState() async{ try { final payload = { 'periphId': widget.peripheralId @@ -341,7 +344,7 @@ class _PeripheralScreenState extends State { Future initAll() async{ getName(); checkDeviceConnection(); - loop(); + fetchState(); } void rename() { @@ -734,9 +737,9 @@ class _PeripheralScreenState extends State { FloatingActionButton( heroTag: "recalibrate", tooltip: "Recalibrate Peripheral", - onPressed: deviceConnected ? recalibrate : null, - foregroundColor: deviceConnected ? Theme.of(context).highlightColor : Colors.grey.shade400, - backgroundColor: deviceConnected ? Theme.of(context).primaryColorDark : Colors.grey.shade300, + onPressed: (deviceConnected && calibrated) ? recalibrate : null, + foregroundColor: (deviceConnected && calibrated) ? Theme.of(context).highlightColor : Colors.grey.shade400, + backgroundColor: (deviceConnected && calibrated) ? Theme.of(context).primaryColorDark : Colors.grey.shade300, child: Icon(Icons.swap_vert), ), ],