💄 Better bootstrapping

This commit is contained in:
2024-07-27 14:16:49 +08:00
parent 102df2ef1c
commit 6ca4aad1c4
4 changed files with 140 additions and 100 deletions

View File

@ -82,13 +82,15 @@ class _AttachmentListFullScreenState extends State<AttachmentListFullScreen> {
),
Align(
alignment: Alignment.bottomCenter,
child: Container(
height: 300,
decoration: const BoxDecoration(
gradient: LinearGradient(
begin: Alignment.bottomCenter,
end: Alignment.topCenter,
colors: [Color(0xFFFFFFFF), Color(0x00FFFFFF)],
child: IgnorePointer(
child: Container(
height: 300,
decoration: const BoxDecoration(
gradient: LinearGradient(
begin: Alignment.bottomCenter,
end: Alignment.topCenter,
colors: [Color(0xFFFFFFFF), Color(0x00FFFFFF)],
),
),
),
),
@ -99,75 +101,77 @@ class _AttachmentListFullScreenState extends State<AttachmentListFullScreen> {
bottom: MediaQuery.of(context).padding.bottom,
left: 16,
right: 16,
child: Material(
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (widget.attachment.account != null)
Row(
child: IgnorePointer(
child: Material(
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (widget.attachment.account != null)
Row(
children: [
AccountAvatar(
content: widget.attachment.account!.avatar,
radius: 19,
),
const SizedBox(width: 8),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'attachmentUploadBy'.tr,
style: Theme.of(context).textTheme.bodySmall,
),
Text(
widget.attachment.account!.nick,
style: Theme.of(context).textTheme.bodyMedium,
),
],
),
],
),
const SizedBox(height: 4),
Text(
widget.attachment.alt,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontSize: 15,
fontWeight: FontWeight.w500,
),
),
const SizedBox(height: 2),
Wrap(
spacing: 6,
children: [
AccountAvatar(
content: widget.attachment.account!.avatar,
radius: 19,
),
const SizedBox(width: 8),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'attachmentUploadBy'.tr,
style: Theme.of(context).textTheme.bodySmall,
if (widget.attachment.metadata?['width'] != null &&
widget.attachment.metadata?['height'] != null)
Text(
'${widget.attachment.metadata?['width']}x${widget.attachment.metadata?['height']}',
style: TextStyle(
fontSize: 12,
color: _unFocusColor,
),
Text(
widget.attachment.account!.nick,
style: Theme.of(context).textTheme.bodyMedium,
),
if (widget.attachment.metadata?['ratio'] != null)
Text(
'${(widget.attachment.metadata?['ratio'] as double).toPrecision(2)}',
style: TextStyle(
fontSize: 12,
color: _unFocusColor,
),
],
),
),
Text(
_formatBytes(widget.attachment.size),
style: TextStyle(
fontSize: 12,
color: _unFocusColor,
),
)
],
),
const SizedBox(height: 4),
Text(
widget.attachment.alt,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontSize: 15,
fontWeight: FontWeight.w500,
),
),
const SizedBox(height: 2),
Wrap(
spacing: 6,
children: [
if (widget.attachment.metadata?['width'] != null &&
widget.attachment.metadata?['height'] != null)
Text(
'${widget.attachment.metadata?['width']}x${widget.attachment.metadata?['height']}',
style: TextStyle(
fontSize: 12,
color: _unFocusColor,
),
),
if (widget.attachment.metadata?['ratio'] != null)
Text(
'${(widget.attachment.metadata?['ratio'] as double).toPrecision(2)}',
style: TextStyle(
fontSize: 12,
color: _unFocusColor,
),
),
Text(
_formatBytes(widget.attachment.size),
style: TextStyle(
fontSize: 12,
color: _unFocusColor,
),
)
],
),
],
],
),
),
),
)