fix: restrict height of dropdowns in user menu popup

This commit is contained in:
ggurdin 2026-01-20 13:32:50 -05:00
parent bd6aa421bb
commit fecf8de443
No known key found for this signature in database
GPG key ID: A01CB41737CBB478
2 changed files with 5 additions and 3 deletions

View file

@ -1,4 +1,3 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:dropdown_button2/dropdown_button2.dart';
@ -155,6 +154,7 @@ class BotChatSettingsDialogState extends State<BotChatSettingsDialog> {
onChanged: _setLevel,
enabled: !widget.room.isActivitySession,
width: 300,
maxHeight: 300,
),
DropdownButtonFormField2<String>(
customButton: _selectedVoice != null
@ -171,7 +171,7 @@ class BotChatSettingsDialogState extends State<BotChatSettingsDialog> {
),
isExpanded: true,
dropdownStyleData: DropdownStyleData(
maxHeight: kIsWeb ? 250 : null,
maxHeight: 250,
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surfaceContainerHigh,
borderRadius: BorderRadius.circular(14.0),

View file

@ -14,6 +14,7 @@ class LanguageLevelDropdown extends StatelessWidget {
final bool enabled;
final Color? backgroundColor;
final double? width;
final double? maxHeight;
const LanguageLevelDropdown({
super.key,
@ -23,6 +24,7 @@ class LanguageLevelDropdown extends StatelessWidget {
this.enabled = true,
this.backgroundColor,
this.width,
this.maxHeight,
});
@override
@ -46,7 +48,7 @@ class LanguageLevelDropdown extends StatelessWidget {
),
isExpanded: true,
dropdownStyleData: DropdownStyleData(
maxHeight: kIsWeb ? 500 : null,
maxHeight: maxHeight ?? (kIsWeb ? 500 : null),
decoration: BoxDecoration(
color: backgroundColor ??
Theme.of(context).colorScheme.surfaceContainerHigh,