mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-07-23 22:51:00 -04:00
textscale dialogs
This commit is contained in:
parent
68e8d7fd39
commit
5a6b57e8ec
7 changed files with 62 additions and 59 deletions
|
@ -7,17 +7,10 @@ import '../../theme/theme.dart';
|
|||
class ProfileWidget extends StatelessWidget {
|
||||
const ProfileWidget({
|
||||
required proto.Profile profile,
|
||||
required bool showPronouns,
|
||||
String? byline,
|
||||
super.key,
|
||||
}) : _profile = profile,
|
||||
_showPronouns = showPronouns;
|
||||
|
||||
//
|
||||
|
||||
final proto.Profile _profile;
|
||||
final bool _showPronouns;
|
||||
|
||||
//
|
||||
_byline = byline;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -44,26 +37,37 @@ class ProfileWidget extends StatelessWidget {
|
|||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(8 * scaleConfig.borderRadiusScale))),
|
||||
),
|
||||
child: Row(children: [
|
||||
const Spacer(),
|
||||
Text(
|
||||
_profile.name,
|
||||
style: textTheme.titleMedium!.copyWith(
|
||||
color: scaleConfig.preferBorders
|
||||
? scale.primaryScale.border
|
||||
: scale.primaryScale.borderText),
|
||||
textAlign: TextAlign.left,
|
||||
).paddingAll(8.scaled(context)),
|
||||
if (_profile.pronouns.isNotEmpty && _showPronouns)
|
||||
Text('(${_profile.pronouns})',
|
||||
textAlign: TextAlign.right,
|
||||
style: textTheme.bodySmall!.copyWith(
|
||||
color: scaleConfig.preferBorders
|
||||
? scale.primaryScale.border
|
||||
: scale.primaryScale.primary))
|
||||
.paddingAll(8.scaled(context)),
|
||||
const Spacer()
|
||||
]),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 8.scaled(context),
|
||||
children: [
|
||||
Text(
|
||||
_profile.name,
|
||||
style: textTheme.titleMedium!.copyWith(
|
||||
color: scaleConfig.preferBorders
|
||||
? scale.primaryScale.border
|
||||
: scale.primaryScale.borderText),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: TextAlign.center,
|
||||
maxLines: 1,
|
||||
),
|
||||
if (_byline != null)
|
||||
Text(
|
||||
_byline,
|
||||
style: textTheme.bodySmall!.copyWith(
|
||||
color: scaleConfig.preferBorders
|
||||
? scale.primaryScale.border
|
||||
: scale.primaryScale.primary),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: TextAlign.center,
|
||||
maxLines: 1,
|
||||
),
|
||||
]).paddingAll(8.scaled(context)),
|
||||
);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
final proto.Profile _profile;
|
||||
final String? _byline;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue