2023-08-05 01:00:46 -04:00
|
|
|
import 'package:awesome_extensions/awesome_extensions.dart';
|
2023-07-28 20:36:05 -04:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
2024-01-30 14:14:11 -05:00
|
|
|
import '../../proto/proto.dart' as proto;
|
2024-01-08 21:37:08 -05:00
|
|
|
import '../../theme/theme.dart';
|
2023-08-05 01:00:46 -04:00
|
|
|
|
2024-01-08 21:37:08 -05:00
|
|
|
class ProfileWidget extends StatelessWidget {
|
2023-07-28 20:36:05 -04:00
|
|
|
const ProfileWidget({
|
2024-01-30 14:14:11 -05:00
|
|
|
required proto.Profile profile,
|
2023-07-28 20:36:05 -04:00
|
|
|
super.key,
|
2024-01-30 14:14:11 -05:00
|
|
|
}) : _profile = profile;
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
final proto.Profile _profile;
|
|
|
|
|
|
|
|
//
|
2023-07-28 20:36:05 -04:00
|
|
|
|
|
|
|
@override
|
|
|
|
// ignore: prefer_expression_function_bodies
|
2024-01-08 21:37:08 -05:00
|
|
|
Widget build(BuildContext context) {
|
2023-08-05 01:00:46 -04:00
|
|
|
final theme = Theme.of(context);
|
|
|
|
final scale = theme.extension<ScaleScheme>()!;
|
|
|
|
final textTheme = theme.textTheme;
|
2023-07-28 20:36:05 -04:00
|
|
|
|
2023-09-23 12:56:54 -04:00
|
|
|
return DecoratedBox(
|
|
|
|
decoration: ShapeDecoration(
|
2023-09-24 15:30:54 -04:00
|
|
|
color: scale.primaryScale.border,
|
|
|
|
shape:
|
|
|
|
RoundedRectangleBorder(borderRadius: BorderRadius.circular(16))),
|
2023-09-23 12:56:54 -04:00
|
|
|
child: Column(children: [
|
|
|
|
Text(
|
2024-01-30 14:14:11 -05:00
|
|
|
_profile.name,
|
2024-04-12 20:55:05 -04:00
|
|
|
style: textTheme.headlineSmall!
|
|
|
|
.copyWith(color: scale.primaryScale.borderText),
|
2023-09-23 12:56:54 -04:00
|
|
|
textAlign: TextAlign.left,
|
|
|
|
).paddingAll(4),
|
2024-01-30 14:14:11 -05:00
|
|
|
if (_profile.pronouns.isNotEmpty)
|
2024-04-12 20:55:05 -04:00
|
|
|
Text(_profile.pronouns,
|
|
|
|
style: textTheme.bodyMedium!
|
|
|
|
.copyWith(color: scale.primaryScale.borderText))
|
2024-01-29 22:38:19 -05:00
|
|
|
.paddingLTRB(4, 0, 4, 4),
|
2023-09-23 12:56:54 -04:00
|
|
|
]),
|
|
|
|
);
|
2023-07-28 20:36:05 -04:00
|
|
|
}
|
|
|
|
}
|