fixed overflowing account name and dropdowns in settings

This commit is contained in:
2026-09-26 14:34:47 +02:00
parent d6130584f2
commit 0f6c388940
2 changed files with 35 additions and 14 deletions
@@ -136,14 +136,17 @@ class _AccountSectionState extends State<AccountSection> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
displayName ?? username,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
FittedBox(
fit: BoxFit.scaleDown,
alignment: AlignmentDirectional.centerStart,
child: Text(
displayName ?? username,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
),
maxLines: 1,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
if (displayName != null) ...[
const SizedBox(height: 2),
@@ -32,18 +32,21 @@ class SettingsDropdownTile<T> extends StatelessWidget {
trailing: DropdownButton<T>(
value: value,
icon: const Icon(Icons.arrow_drop_down),
alignment: AlignmentDirectional.centerEnd,
selectedItemBuilder: (context) => options
.map(
(e) => Align(
alignment: AlignmentDirectional.centerEnd,
child: _optionRow(e),
),
)
.toList(),
items: options
.map(
(e) => DropdownMenuItem<T>(
value: e,
enabled: e != value,
child: Row(
children: [
Icon(optionIcon(e)),
const SizedBox(width: 10),
Text(optionLabel(e)),
],
),
child: _optionRow(e),
),
)
.toList(),
@@ -53,4 +56,19 @@ class SettingsDropdownTile<T> extends StatelessWidget {
),
);
}
Widget _optionRow(T e) => Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(optionIcon(e)),
const SizedBox(width: 10),
Flexible(
child: Text(
optionLabel(e),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
],
);
}