mirror of
				https://github.com/johrpan/musicus_mobile.git
				synced 2025-10-26 18:57:25 +01:00 
			
		
		
		
	Add music library
This commit is contained in:
		
							parent
							
								
									9da8f8891b
								
							
						
					
					
						commit
						b1994d1067
					
				
					 6 changed files with 368 additions and 21 deletions
				
			
		|  | @ -47,4 +47,51 @@ class Platform { | |||
|         .map((childJson) => Document.fromJson(childJson)) | ||||
|         .toList(); | ||||
|   } | ||||
| 
 | ||||
|   /// Read contents of file. | ||||
|   /// | ||||
|   /// [treeId] is the base URI from the SAF, [id] is the document ID of the | ||||
|   /// file. | ||||
|   static Future<String> readFile(String treeUri, String id) async { | ||||
|     return await _platform.invokeMethod( | ||||
|       'readFile', | ||||
|       { | ||||
|         'treeUri': treeUri, | ||||
|         'id': id, | ||||
|       }, | ||||
|     ); | ||||
|   } | ||||
| 
 | ||||
|   /// Read contents of file by name | ||||
|   /// | ||||
|   /// [treeId] is the base URI from the SAF, [parentId] is the document ID of | ||||
|   /// the parent directory. | ||||
|   static Future<String> readFileByName( | ||||
|       String treeUri, String parentId, String fileName) async { | ||||
|     return await _platform.invokeMethod( | ||||
|       'readFileByName', | ||||
|       { | ||||
|         'treeUri': treeUri, | ||||
|         'parentId': parentId, | ||||
|         'fileName': fileName, | ||||
|       }, | ||||
|     ); | ||||
|   } | ||||
| 
 | ||||
|   /// Write to file by name | ||||
|   /// | ||||
|   /// [treeId] is the base URI from the SAF, [parentId] is the document ID of | ||||
|   /// the parent directory. | ||||
|   static Future<void> writeFileByName( | ||||
|       String treeUri, String parentId, String fileName, String content) async { | ||||
|     await _platform.invokeMethod( | ||||
|       'writeFileByName', | ||||
|       { | ||||
|         'treeUri': treeUri, | ||||
|         'parentId': parentId, | ||||
|         'fileName': fileName, | ||||
|         'content': content, | ||||
|       }, | ||||
|     ); | ||||
|   } | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Elias Projahn
						Elias Projahn