Skip to content

Commit

Permalink
some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
njooma committed Aug 2, 2023
1 parent b18c763 commit ba3583f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 13 additions & 0 deletions lib/widgets/resources/board.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ class _ViamBoardWidgetState extends State<ViamBoardWidget> {
bool high = false;
BoardStatus status = const BoardStatus({}, {});

Future<void> _fetchStatus() async {
final response = await widget.board.status();
setState(() {
status = response;
});
}

@override
void initState() {
super.initState();
_fetchStatus();
}

@override
Widget build(BuildContext context) {
return Theme(
Expand Down
2 changes: 0 additions & 2 deletions lib/widgets/resources/sensor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ class ViamSensorWidget extends StatefulWidget {
final Sensor sensor;
final Duration? refreshInterval;
final bool showLastRefreshed;
final bool showRefreshInput;
final bool showRefreshControls;

const ViamSensorWidget({
Key? key,
required this.sensor,
this.refreshInterval = const Duration(milliseconds: 5000),
this.showLastRefreshed = true,
this.showRefreshInput = true,
this.showRefreshControls = true,
}) : super(key: key);

Expand Down

0 comments on commit ba3583f

Please sign in to comment.