Solian/lib/widgets/posts/post_share.dart

104 lines
3.5 KiB
Dart
Raw Normal View History

2024-10-13 15:12:23 +00:00
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart';
import 'package:qr_flutter/qr_flutter.dart';
import 'package:solian/models/post.dart';
import 'package:solian/widgets/posts/post_item.dart';
import 'package:solian/widgets/root_container.dart';
class PostShareImage extends StatelessWidget {
final Post item;
const PostShareImage({super.key, required this.item});
@override
Widget build(BuildContext context) {
final textColor = Theme.of(context).colorScheme.onSurface.withOpacity(0.3);
return RootContainer(
2024-10-13 16:03:45 +00:00
child: Wrap(
alignment: WrapAlignment.spaceBetween,
runAlignment: WrapAlignment.center,
2024-10-13 15:12:23 +00:00
children: [
2024-10-13 16:03:45 +00:00
const SizedBox(height: 40),
2024-10-13 15:12:23 +00:00
Material(
color: Colors.transparent,
child: Card(
2024-10-13 16:03:45 +00:00
margin: EdgeInsets.zero,
2024-10-13 15:12:23 +00:00
child: PostItem(
item: item,
isShowEmbed: true,
isClickable: false,
showFeaturedReply: false,
isReactable: false,
isShowReply: false,
2024-10-13 16:03:45 +00:00
isNonScrollAttachment: true,
padding: const EdgeInsets.symmetric(
horizontal: 4,
2024-10-13 16:10:13 +00:00
vertical: 16,
2024-10-13 16:03:45 +00:00
),
2024-10-13 15:12:23 +00:00
onComment: () {},
),
),
2024-10-13 16:03:45 +00:00
).paddingOnly(bottom: 24),
2024-10-13 15:12:23 +00:00
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(8)),
child: Image.asset(
'assets/logo.png',
width: 48,
height: 48,
),
),
const Gap(16),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
'shareImageFooter'.tr,
style: TextStyle(
fontSize: 13,
color: textColor,
),
),
Text(
'Solsynth LLC © ${DateTime.now().year}',
style: TextStyle(
fontSize: 11,
color: textColor,
),
),
],
),
],
),
ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(8)),
child: Material(
color: Theme.of(context).colorScheme.surface,
child: QrImageView(
data: 'https://solsynth.dev/posts/${item.id}',
version: QrVersions.auto,
padding: const EdgeInsets.all(4),
size: 48,
2024-10-13 16:03:45 +00:00
dataModuleStyle: QrDataModuleStyle(
color: Theme.of(context).colorScheme.onSurface,
),
eyeStyle: QrEyeStyle(
color: Theme.of(context).colorScheme.onSurface,
),
2024-10-13 15:12:23 +00:00
),
),
),
],
),
],
).paddingSymmetric(horizontal: 36, vertical: 24),
);
}
}