Skip to content

Commit 0171155

Browse files
committed
refactor: Simplify settings screen layout and improve generic bottom sheet picker UI with ListTile
1 parent bfe7315 commit 0171155

2 files changed

Lines changed: 11 additions & 24 deletions

File tree

client/lib/devices/borneo/lyfi/views/settings_screen.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ class SettingsScreen extends StatelessWidget {
7878
SettingsList _buildSettingsList(BuildContext context) {
7979
final lvm = context.watch<SettingsViewModel>();
8080
return SettingsList(
81-
platform: DevicePlatform.iOS,
8281
sections: [
8382
SettingsSection(
8483
title: Text(context.translate('DEVICE INFORMATION')),
@@ -93,8 +92,7 @@ class SettingsScreen extends StatelessWidget {
9392
descriptionInlineIos: true,
9493
description: Row(
9594
spacing: 8,
96-
crossAxisAlignment: CrossAxisAlignment.start,
97-
mainAxisAlignment: MainAxisAlignment.center,
95+
mainAxisAlignment: MainAxisAlignment.start,
9896
children: [Text(lvm.borneoInfo.manufName), Text(lvm.borneoInfo.modelName)],
9997
),
10098
),
@@ -128,7 +126,6 @@ class SettingsScreen extends StatelessWidget {
128126
title: Text(context.translate('Device time & time zone')),
129127
descriptionInlineIos: true,
130128
description: Row(
131-
crossAxisAlignment: CrossAxisAlignment.start,
132129
spacing: 8,
133130
children: [
134131
Text(lvm.borneoStatus.timestamp.toString()),

client/lib/shared/widgets/generic_bottom_sheet_picker.dart

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -115,28 +115,18 @@ class GenericBottomSheetPicker<T> extends StatelessWidget {
115115
itemBuilder: (context, index) {
116116
final entry = entries[index];
117117
final isSelected = entry.value == effective;
118-
return Material(
119-
color: Colors.transparent,
120-
child: InkWell(
121-
onTap: () => onValueSelected(entry.value),
122-
child: Container(
123-
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 16),
124-
child: Row(
125-
children: [
126-
Expanded(
127-
child: Text(
128-
entry.label,
129-
style: theme.textTheme.bodyLarge?.copyWith(
130-
color: isSelected ? colorScheme.primary : colorScheme.onSurface,
131-
fontWeight: isSelected ? FontWeight.w500 : FontWeight.normal,
132-
),
133-
),
134-
),
135-
if (isSelected) Icon(Icons.check, color: colorScheme.primary, size: 20),
136-
],
137-
),
118+
return ListTile(
119+
title: Text(
120+
entry.label,
121+
style: theme.textTheme.bodyLarge?.copyWith(
122+
color: isSelected ? colorScheme.primary : colorScheme.onSurface,
123+
fontWeight: isSelected ? FontWeight.w500 : FontWeight.normal,
138124
),
139125
),
126+
trailing: isSelected ? Icon(Icons.check, color: colorScheme.primary, size: 20) : null,
127+
contentPadding: const EdgeInsets.symmetric(horizontal: 20, vertical: 0),
128+
onTap: () => onValueSelected(entry.value),
129+
dense: true,
140130
);
141131
},
142132
),

0 commit comments

Comments
 (0)