Merge pull request #162 from just-stuff-tm/fix/battery-layout-overflow

Fix battery chemistry dropdown layout overflow
This commit is contained in:
Ded
2026-02-11 21:27:30 -08:00
committed by GitHub
+17 -2
View File
@@ -384,6 +384,7 @@ class AppSettingsScreen extends StatelessWidget {
); );
} }
// Fixed rendering issues
Widget _buildBatteryCard( Widget _buildBatteryCard(
BuildContext context, BuildContext context,
AppSettingsService settingsService, AppSettingsService settingsService,
@@ -399,6 +400,7 @@ class AppSettingsScreen extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
const SizedBox(height: 4),
Padding( Padding(
padding: const EdgeInsets.fromLTRB(16, 16, 16, 8), padding: const EdgeInsets.fromLTRB(16, 16, 16, 8),
child: Text( child: Text(
@@ -406,6 +408,8 @@ class AppSettingsScreen extends StatelessWidget {
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold), style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
), ),
), ),
// Main tile (icon + text only)
ListTile( ListTile(
leading: const Icon(Icons.battery_full), leading: const Icon(Icons.battery_full),
title: Text(context.l10n.appSettings_batteryChemistry), title: Text(context.l10n.appSettings_batteryChemistry),
@@ -416,8 +420,19 @@ class AppSettingsScreen extends StatelessWidget {
) )
: context.l10n.appSettings_batteryChemistryConnectFirst, : context.l10n.appSettings_batteryChemistryConnectFirst,
), ),
trailing: DropdownButton<String>( contentPadding: const EdgeInsets.symmetric(horizontal: 16),
value: selection, ),
// Dropdown (separate full-width row)
Padding(
padding: const EdgeInsets.fromLTRB(16, 0, 16, 16),
child: DropdownButtonFormField<String>(
initialValue: selection,
isExpanded: true,
decoration: const InputDecoration(
border: UnderlineInputBorder(),
isDense: true,
),
onChanged: isConnected onChanged: isConnected
? (value) { ? (value) {
if (value != null) { if (value != null) {