HyM attachments resolve: #2 #3
					 1 changed files with 37 additions and 5 deletions
				
			
		| 
						 | 
					@ -1,5 +1,6 @@
 | 
				
			||||||
import "dart:typed_data";
 | 
					import "dart:typed_data";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import "package:crab_ui/attachmentDownload.dart";
 | 
				
			||||||
import "package:crab_ui/structs.dart";
 | 
					import "package:crab_ui/structs.dart";
 | 
				
			||||||
import "package:flutter/material.dart";
 | 
					import "package:flutter/material.dart";
 | 
				
			||||||
import 'package:pdfrx/pdfrx.dart';
 | 
					import 'package:pdfrx/pdfrx.dart';
 | 
				
			||||||
| 
						 | 
					@ -27,10 +28,41 @@ class AttachmentWidget extends StatelessWidget {
 | 
				
			||||||
          ));
 | 
					          ));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    return Center(
 | 
					    return Center(
 | 
				
			||||||
        child: Text(
 | 
					        child: Container(
 | 
				
			||||||
      "Attachment not supported for preview, you'll need to download",
 | 
					          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(
 | 
					                style: TextStyle(
 | 
				
			||||||
          color: Colors.black, fontSize: 20, decoration: TextDecoration.none),
 | 
					                  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),
 | 
				
			||||||
 | 
					              )),
 | 
				
			||||||
 | 
					              ]),
 | 
				
			||||||
        ));
 | 
					        ));
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue