Skip to content

Commit 00e2841

Browse files
open_wearable/lib/widgets/devices: added padding to stereo device postion label
1 parent 4c0f911 commit 00e2841

File tree

3 files changed

+15
-32
lines changed

3 files changed

+15
-32
lines changed

open_wearable/lib/widgets/devices/device_detail/device_detail_page.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@ class _DeviceDetailPageState extends State<DeviceDetailPage> {
6767
children: [
6868
BatteryStateView(device: widget.device),
6969
if (widget.device is StereoDevice)
70-
StereoPosLabel(device: widget.device as StereoDevice),
70+
Padding(
71+
padding: const EdgeInsets.only(left: 8.0),
72+
child: StereoPosLabel(device: widget.device as StereoDevice),
73+
),
7174
],
7275
),
7376
if (wearableIconPath != null)

open_wearable/lib/widgets/devices/devices_page.dart

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import 'package:open_wearable/widgets/devices/device_detail/device_detail_page.d
1212
import 'package:provider/provider.dart';
1313

1414
import '../../view_models/sensor_recorder_provider.dart';
15+
import 'device_detail/stereo_pos_label.dart';
1516

1617
/// On this page the user can see all connected devices.
1718
///
@@ -273,37 +274,16 @@ class DeviceRow extends StatelessWidget {
273274
Row(children: [
274275
BatteryStateView(device: _device),
275276
if (_device is StereoDevice)
276-
FutureBuilder(
277-
future: (_device as StereoDevice).position,
278-
builder: (context, snapshot) {
279-
if (snapshot.connectionState ==
280-
ConnectionState.waiting) {
281-
return PlatformCircularProgressIndicator();
282-
}
283-
if (snapshot.hasError) {
284-
return PlatformText("Error: ${snapshot.error}");
285-
}
286-
if (!snapshot.hasData) {
287-
return PlatformText("N/A");
288-
}
289-
if (snapshot.data == null) {
290-
return PlatformText("N/A");
291-
}
292-
switch (snapshot.data) {
293-
case DevicePosition.left:
294-
return PlatformText("Left");
295-
case DevicePosition.right:
296-
return PlatformText("Right");
297-
default:
298-
return PlatformText("Unknown");
299-
}
300-
},
277+
Padding(
278+
padding: EdgeInsets.only(left: 8.0),
279+
child: StereoPosLabel(device: _device as StereoDevice),
301280
),
302-
],),
303-
],
304-
),
305-
Spacer(),
306-
if (_device is DeviceIdentifier)
281+
],
282+
),
283+
],
284+
),
285+
Spacer(),
286+
if (_device is DeviceIdentifier)
307287
FutureBuilder(
308288
future:
309289
(_device as DeviceIdentifier).readDeviceIdentifier(),

open_wearable/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ packages:
445445
description:
446446
path: "."
447447
ref: HEAD
448-
resolved-ref: "3d4603b0836abdaef1bbfb70a5e46a3267db0ba3"
448+
resolved-ref: e09f5db9000fbc3334996f39fa05e4ab18c1461f
449449
url: "https://github.com/OpenEarable/open_earable_flutter.git"
450450
source: git
451451
version: "0.1.0"

0 commit comments

Comments
 (0)