Small bug fix with individual code
This commit is contained in:
@@ -73,6 +73,12 @@
|
|||||||
ReferencedContainer = "container:Runner.xcodeproj">
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
</BuildableReference>
|
</BuildableReference>
|
||||||
</BuildableProductRunnable>
|
</BuildableProductRunnable>
|
||||||
|
<CommandLineArguments>
|
||||||
|
<CommandLineArgument
|
||||||
|
argument = "--vm-service-host=0.0.0.0"
|
||||||
|
isEnabled = "YES">
|
||||||
|
</CommandLineArgument>
|
||||||
|
</CommandLineArguments>
|
||||||
</LaunchAction>
|
</LaunchAction>
|
||||||
<ProfileAction
|
<ProfileAction
|
||||||
buildConfiguration = "Profile"
|
buildConfiguration = "Profile"
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ class _DayTimePickerState extends State<DayTimePicker> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: Text(
|
title: Text(
|
||||||
'New Schedule',
|
(widget.isEditing) ? 'Edit Schedule' : 'New Schedule',
|
||||||
style: GoogleFonts.aBeeZee(),
|
style: GoogleFonts.aBeeZee(),
|
||||||
),
|
),
|
||||||
content: Column(
|
content: Column(
|
||||||
|
|||||||
@@ -168,6 +168,8 @@ class _PeripheralScreenState extends State<PeripheralScreen> {
|
|||||||
calibrated = true;
|
calibrated = true;
|
||||||
calibrationStage = 0;
|
calibrationStage = 0;
|
||||||
});
|
});
|
||||||
|
// Fetch updated peripheral data after calibration completes
|
||||||
|
fetchState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -198,6 +200,7 @@ class _PeripheralScreenState extends State<PeripheralScreen> {
|
|||||||
|
|
||||||
if (response == null) throw Exception("auth error");
|
if (response == null) throw Exception("auth error");
|
||||||
if (response.statusCode != 202) throw Exception("Server Error");
|
if (response.statusCode != 202) throw Exception("Server Error");
|
||||||
|
calibrated = false;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (!mounted) return;
|
if (!mounted) return;
|
||||||
ScaffoldMessenger.of(context).showSnackBar(errorSnackbar(e));
|
ScaffoldMessenger.of(context).showSnackBar(errorSnackbar(e));
|
||||||
@@ -287,7 +290,7 @@ class _PeripheralScreenState extends State<PeripheralScreen> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future loop() async{
|
Future fetchState() async{
|
||||||
try {
|
try {
|
||||||
final payload = {
|
final payload = {
|
||||||
'periphId': widget.peripheralId
|
'periphId': widget.peripheralId
|
||||||
@@ -341,7 +344,7 @@ class _PeripheralScreenState extends State<PeripheralScreen> {
|
|||||||
Future initAll() async{
|
Future initAll() async{
|
||||||
getName();
|
getName();
|
||||||
checkDeviceConnection();
|
checkDeviceConnection();
|
||||||
loop();
|
fetchState();
|
||||||
}
|
}
|
||||||
|
|
||||||
void rename() {
|
void rename() {
|
||||||
@@ -734,9 +737,9 @@ class _PeripheralScreenState extends State<PeripheralScreen> {
|
|||||||
FloatingActionButton(
|
FloatingActionButton(
|
||||||
heroTag: "recalibrate",
|
heroTag: "recalibrate",
|
||||||
tooltip: "Recalibrate Peripheral",
|
tooltip: "Recalibrate Peripheral",
|
||||||
onPressed: deviceConnected ? recalibrate : null,
|
onPressed: (deviceConnected && calibrated) ? recalibrate : null,
|
||||||
foregroundColor: deviceConnected ? Theme.of(context).highlightColor : Colors.grey.shade400,
|
foregroundColor: (deviceConnected && calibrated) ? Theme.of(context).highlightColor : Colors.grey.shade400,
|
||||||
backgroundColor: deviceConnected ? Theme.of(context).primaryColorDark : Colors.grey.shade300,
|
backgroundColor: (deviceConnected && calibrated) ? Theme.of(context).primaryColorDark : Colors.grey.shade300,
|
||||||
child: Icon(Icons.swap_vert),
|
child: Icon(Icons.swap_vert),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user