fixed overflowing account name and dropdowns in settings
This commit is contained in:
@@ -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,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user