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,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
FittedBox(
|
||||||
|
fit: BoxFit.scaleDown,
|
||||||
|
alignment: AlignmentDirectional.centerStart,
|
||||||
|
child: Text(
|
||||||
displayName ?? username,
|
displayName ?? username,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
),
|
),
|
||||||
maxLines: 2,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
),
|
||||||
),
|
),
|
||||||
if (displayName != null) ...[
|
if (displayName != null) ...[
|
||||||
const SizedBox(height: 2),
|
const SizedBox(height: 2),
|
||||||
|
|||||||
@@ -32,18 +32,21 @@ class SettingsDropdownTile<T> extends StatelessWidget {
|
|||||||
trailing: DropdownButton<T>(
|
trailing: DropdownButton<T>(
|
||||||
value: value,
|
value: value,
|
||||||
icon: const Icon(Icons.arrow_drop_down),
|
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
|
items: options
|
||||||
.map(
|
.map(
|
||||||
(e) => DropdownMenuItem<T>(
|
(e) => DropdownMenuItem<T>(
|
||||||
value: e,
|
value: e,
|
||||||
enabled: e != value,
|
enabled: e != value,
|
||||||
child: Row(
|
child: _optionRow(e),
|
||||||
children: [
|
|
||||||
Icon(optionIcon(e)),
|
|
||||||
const SizedBox(width: 10),
|
|
||||||
Text(optionLabel(e)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.toList(),
|
.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