summaryrefslogtreecommitdiff
path: root/lib/screens
diff options
context:
space:
mode:
Diffstat (limited to 'lib/screens')
-rw-r--r--lib/screens/level_selection.dart23
1 files changed, 11 insertions, 12 deletions
diff --git a/lib/screens/level_selection.dart b/lib/screens/level_selection.dart
index 5fafe3f..eff9274 100644
--- a/lib/screens/level_selection.dart
+++ b/lib/screens/level_selection.dart
@@ -3,6 +3,7 @@ import 'dart:io';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart';
+import 'package:sense_the_rhythm/widgets/connection_status_button.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:sense_the_rhythm/utils/esense_input.dart';
import 'package:sense_the_rhythm/utils/simfile.dart';
@@ -94,18 +95,16 @@ class _LevelSelectionState extends State<LevelSelection> {
appBar: AppBar(
title: const Text('Sense the Rhythm'),
actions: [
- IconButton(
- onPressed: () => showDialog(
- context: context,
- builder: (BuildContext context) {
- return ESenseConnectDialog(
- deviceStatus: ESenseInput.instance.deviceStatus,
- connect: (String name) {
- ESenseInput.instance.connectToESense(name);
- });
- },
- ),
- icon: const Icon(Icons.bluetooth))
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 8.0),
+ child: ValueListenableBuilder(
+ valueListenable: ESenseInput.instance.deviceStatus,
+ builder:
+ (BuildContext context, String deviceStatus, Widget? child) {
+ return ConnectionStatusButton(deviceStatus);
+ },
+ ),
+ )
],
),
body: Builder(builder: (context) {