diff --git a/lib/attachmentWidget.dart b/lib/attachmentWidget.dart index c5da22a..5146d9c 100644 --- a/lib/attachmentWidget.dart +++ b/lib/attachmentWidget.dart @@ -1,5 +1,6 @@ import "dart:typed_data"; +import "package:crab_ui/attachmentDownload.dart"; import "package:crab_ui/structs.dart"; import "package:flutter/material.dart"; import 'package:pdfrx/pdfrx.dart'; @@ -27,11 +28,42 @@ class AttachmentWidget extends StatelessWidget { )); } return Center( - child: Text( - "Attachment not supported for preview, you'll need to download", - style: TextStyle( - color: Colors.black, fontSize: 20, decoration: TextDecoration.none), - )); + child: Container( + padding: EdgeInsets.all(20), + decoration: BoxDecoration( + color: Color(0xff6C63FF), + borderRadius: BorderRadius.circular(16), + boxShadow: [ + BoxShadow( + color: Colors.black26, + blurRadius: 10, + ), + ], + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + "No preview available", + style: TextStyle( + color: Colors.white, fontSize: 18, decoration: TextDecoration.none), + ), + SizedBox( + height: 5, + ), + GestureDetector( + child: ElevatedButton( + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Text("Download", style: TextStyle(color: Color(0xff2c3e50)),), + Icon(Icons.download, + color: Color(0xffb0b0b0),), + ]), + onPressed: () => Attachmentdownload().saveFile(att), + )), + ]), + )); } @override