finished message popup view

This commit is contained in:
Kima 2024-01-02 22:46:14 +01:00
parent 4a6fabd47d
commit 45bf766d1c
4 changed files with 116 additions and 53 deletions

View File

@ -49,11 +49,11 @@ class AbsenceTile extends StatelessWidget {
visualDensity: VisualDensity.compact,
dense: group,
contentPadding: const EdgeInsets.only(
left: 14.0, right: 12.0, top: 2.0, bottom: 2.0),
left: 15.5, right: 12.0, top: 2.0, bottom: 2.0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(!group ? 14.0 : 12.0)),
leading: Container(
width: 44.0,
width: 39,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: !group ? color.withOpacity(.25) : null,

View File

@ -47,7 +47,8 @@ class AttachmentTile extends StatelessWidget {
return Center(
child: Padding(
padding: const EdgeInsets.all(12.0),
child: CircularProgressIndicator(color: Theme.of(context).colorScheme.secondary),
child: CircularProgressIndicator(
color: Theme.of(context).colorScheme.secondary),
));
}
},
@ -72,7 +73,8 @@ class AttachmentTile extends StatelessWidget {
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 12.0),
child: Text(attachment.name, maxLines: 2, overflow: TextOverflow.ellipsis),
child: Text(attachment.name,
maxLines: 2, overflow: TextOverflow.ellipsis),
),
),
]),

View File

@ -10,7 +10,8 @@ class MessageView extends StatefulWidget {
final List<Message> messages;
static show(List<Message> messages, {required BuildContext context}) =>
Navigator.of(context, rootNavigator: true).push(CupertinoPageRoute(builder: (context) => MessageView(messages)));
Navigator.of(context, rootNavigator: true).push(
CupertinoPageRoute(builder: (context) => MessageView(messages)));
@override
MessageViewState createState() => MessageViewState();

View File

@ -1,5 +1,5 @@
import 'package:filcnaplo/api/providers/user_provider.dart';
import 'package:filcnaplo/utils/color.dart';
import 'package:filcnaplo/theme/colors/colors.dart';
import 'package:filcnaplo_kreta_api/models/message.dart';
import 'package:filcnaplo_mobile_ui/common/panel/panel.dart';
import 'package:filcnaplo_mobile_ui/common/profile_image/profile_image.dart';
@ -7,9 +7,13 @@ import 'package:filcnaplo_mobile_ui/common/widgets/message/attachment_tile.dart'
import 'package:flutter/material.dart';
import 'package:filcnaplo/utils/format.dart';
import 'package:flutter_custom_tabs/flutter_custom_tabs.dart';
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
// import 'package:flutter_feather_icons/flutter_feather_icons.dart';
import 'package:flutter_linkify/flutter_linkify.dart';
import 'package:i18n_extension/i18n_widget.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
import 'package:share_plus/share_plus.dart';
import 'message_view_tile.i18n.dart';
class MessageViewTile extends StatelessWidget {
@ -50,59 +54,115 @@ class MessageViewTile extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Subject
Text(
message.subject,
softWrap: true,
maxLines: 10,
style: const TextStyle(
fontWeight: FontWeight.w600,
fontSize: 24.0,
// subject
Center(
child: Text(
message.subject,
softWrap: true,
maxLines: 10,
textAlign: TextAlign.center,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 24.0,
height: 1.2,
color: Theme.of(context).textTheme.bodySmall?.color,
),
),
),
const SizedBox(height: 8.0),
// Author
ListTile(
visualDensity: VisualDensity.compact,
contentPadding: EdgeInsets.zero,
leading: ProfileImage(
name: message.author,
backgroundColor: ColorUtils.stringToColor(message.author),
),
title: Text(
message.author,
style: const TextStyle(fontWeight: FontWeight.w600),
overflow: TextOverflow.ellipsis,
maxLines: 2,
),
subtitle: Text(
"${"to".i18n} $recipientLabel",
style: const TextStyle(fontWeight: FontWeight.w500),
overflow: TextOverflow.ellipsis,
maxLines: 1,
),
trailing: const Row(
mainAxisSize: MainAxisSize.min,
children: [
// IconButton(
// onPressed: () {},
// icon: Icon(FeatherIcons.cornerUpLeft, color: AppColors.of(context).text),
// splashRadius: 24.0,
// padding: EdgeInsets.zero,
// visualDensity: VisualDensity.compact,
// ),
// IconButton(
// onPressed: () {},
// icon: Icon(FeatherIcons.share2, color: AppColors.of(context).text),
// splashRadius: 24.0,
// padding: EdgeInsets.zero,
// visualDensity: VisualDensity.compact,
// ),
],
// date
Center(
child: Text(
DateFormat("yyyy. MM. dd.", I18n.locale.languageCode)
.format(message.date),
textAlign: TextAlign.center,
style: TextStyle(
fontWeight: FontWeight.w500,
color: Theme.of(context).textTheme.bodySmall?.color,
),
),
),
const SizedBox(height: 28.0),
// Content
// author
Container(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16.0),
border: Border.all(
color: Theme.of(context).colorScheme.primary.withOpacity(.25),
width: 1.0,
),
),
child: ListTile(
visualDensity: VisualDensity.compact,
contentPadding: EdgeInsets.zero,
leading: ProfileImage(
isNotePfp: true,
name: message.author,
backgroundColor: Theme.of(context).colorScheme.secondary,
radius: 19.0,
),
title: Text(
message.author,
style: TextStyle(
fontWeight: FontWeight.w500,
color: Theme.of(context).textTheme.bodySmall?.color,
),
overflow: TextOverflow.ellipsis,
maxLines: 2,
),
subtitle: Text(
"${"to".i18n} $recipientLabel",
style: TextStyle(
fontWeight: FontWeight.w500,
height: 1.2,
color: Theme.of(context)
.textTheme
.bodySmall
?.color
?.withOpacity(0.6),
),
overflow: TextOverflow.ellipsis,
maxLines: 1,
),
trailing: Row(
mainAxisSize: MainAxisSize.min,
children: [
// IconButton(
// onPressed: () {},
// icon: Icon(FeatherIcons.cornerUpLeft,
// color: AppColors.of(context).text),
// splashRadius: 24.0,
// highlightColor: Colors.transparent,
// padding: EdgeInsets.zero,
// visualDensity: VisualDensity.compact,
// ),
IconButton(
onPressed: () {
Share.share(
message.content.escapeHtml(),
subject: 'reFilc',
);
},
icon: Icon(
FeatherIcons.share2,
color: AppColors.of(context).text,
size: 20,
),
splashRadius: 20.0,
highlightColor: Colors.transparent,
padding: EdgeInsets.zero,
visualDensity: VisualDensity.compact,
),
],
),
),
),
const SizedBox(height: 10.0),
// content
Panel(
padding: const EdgeInsets.all(12.0),
child: SelectableLinkify(