android/ios-adaption feature, markdown, and augment #6
					 4 changed files with 29 additions and 15 deletions
				
			
		
							
								
								
									
										7
									
								
								lib/attachamentDownloadStub.dart
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								lib/attachamentDownloadStub.dart
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,7 @@
 | 
				
			||||||
 | 
					import 'structs.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class Attachmentdownload {
 | 
				
			||||||
 | 
					  Future<void> saveFile(AttachmentResponse attachment) async {
 | 
				
			||||||
 | 
					    print("stub attachment download");
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -1,15 +1,3 @@
 | 
				
			||||||
import 'dart:html' as html;
 | 
					export 'attachamentDownloadStub.dart'
 | 
				
			||||||
import 'package:web/web.dart' as web;
 | 
					    if (dart.library.io) 'attachmentDownloadAndroid.dart';
 | 
				
			||||||
import 'dart:io';
 | 
					  // if (dart.library.js_interop) 'attachmentDownloadWeb.dart';
 | 
				
			||||||
import 'structs.dart';
 | 
					 | 
				
			||||||
import 'package:file_saver/file_saver.dart';
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
class Attachmentdownload {
 | 
					 | 
				
			||||||
  Future<void> saveFile(AttachmentResponse attachment) async {
 | 
					 | 
				
			||||||
    await FileSaver.instance.saveFile(
 | 
					 | 
				
			||||||
      name: attachment.name.toString().substring(0, attachment.name.toString().lastIndexOf('.')),
 | 
					 | 
				
			||||||
      bytes: attachment.data,
 | 
					 | 
				
			||||||
      ext: attachment.name.toString().substring(attachment.name.toString().lastIndexOf('.')+1)
 | 
					 | 
				
			||||||
    );
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
							
								
								
									
										7
									
								
								lib/attachmentDownloadAndroid.dart
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								lib/attachmentDownloadAndroid.dart
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,7 @@
 | 
				
			||||||
 | 
					import 'structs.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class Attachmentdownload {
 | 
				
			||||||
 | 
					  Future<void> saveFile(AttachmentResponse attachment) async {
 | 
				
			||||||
 | 
					    print("android attachment download");
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										12
									
								
								lib/attachmentDownloadWeb.dart
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								lib/attachmentDownloadWeb.dart
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,12 @@
 | 
				
			||||||
 | 
					// import 'structs.dart';
 | 
				
			||||||
 | 
					// import 'package:file_saver/file_saver.dart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// class Attachmentdownload {
 | 
				
			||||||
 | 
					//   Future<void> saveFile(AttachmentResponse attachment) async {
 | 
				
			||||||
 | 
					//     await FileSaver.instance.saveFile(
 | 
				
			||||||
 | 
					//       name: attachment.name.toString().substring(0, attachment.name.toString().lastIndexOf('.')),
 | 
				
			||||||
 | 
					//       bytes: attachment.data,
 | 
				
			||||||
 | 
					//       ext: attachment.name.toString().substring(attachment.name.toString().lastIndexOf('.')+1)
 | 
				
			||||||
 | 
					//     );
 | 
				
			||||||
 | 
					//   }
 | 
				
			||||||
 | 
					// }
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue