Skip to content

Commit

Permalink
Attachment UI improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
vyPal committed Oct 28, 2023
1 parent 06bea5d commit 1ebe9dd
Showing 1 changed file with 33 additions and 28 deletions.
61 changes: 33 additions & 28 deletions lib/message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -124,40 +124,45 @@ class MessagePageState extends State<MessagePage> {
att.value.endsWith(".jpeg") ||
att.value.endsWith(".gif"))
Card(
child: Column(
children: [
Image.network(
"https://${data["origin_server"]}${att.key}"),
Row(
children: [
Expanded(
child: Text(
unescape.convert(att.value),
overflow: TextOverflow.fade,
maxLines: 5,
softWrap: true,
style: const TextStyle(fontSize: 14),
elevation: 5,
child: Padding(
padding: const EdgeInsets.only(left: 15, top: 15),
child: Column(
children: [
Image.network(
"https://${data["origin_server"]}${att.key}"),
Row(
children: [
Expanded(
child: Text(
unescape.convert(att.value),
overflow: TextOverflow.fade,
maxLines: 5,
softWrap: true,
style: const TextStyle(fontSize: 14),
),
),
),
IconButton(
icon: const Icon(Icons.download_rounded),
onPressed: () async {
await dio.download(
"https://${data["origin_server"]}${att.key}",
"/storage/emulated/0/Download/${att.value}",
);
},
),
],
),
],
IconButton(
icon:
const Icon(Icons.download_rounded),
onPressed: () async {
await dio.download(
"https://${data["origin_server"]}${att.key}",
"/storage/emulated/0/Download/${att.value}",
);
},
),
],
),
],
),
),
)
else if (att.value.endsWith(".pdf"))
Card(
elevation: 5,
child: Padding(
padding: const EdgeInsets.only(left: 8.0),
padding: const EdgeInsets.only(left: 15),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Expand Down Expand Up @@ -218,7 +223,7 @@ class MessagePageState extends State<MessagePage> {
Card(
elevation: 5,
child: Padding(
padding: const EdgeInsets.only(left: 8.0),
padding: const EdgeInsets.only(left: 15),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Expand Down

0 comments on commit 1ebe9dd

Please sign in to comment.