fixed overflowing account name and dropdowns in settings
This commit is contained in:
@@ -136,14 +136,17 @@ class _AccountSectionState extends State<AccountSection> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
alignment: AlignmentDirectional.centerStart,
|
||||
child: Text(
|
||||
displayName ?? username,
|
||||
style: const TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
),
|
||||
),
|
||||
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,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user