mirror of
				https://github.com/AppFlowy-IO/AppFlowy.git
				synced 2025-10-31 01:54:37 +00:00 
			
		
		
		
	 b9ecc7ceb6
			
		
	
	
		b9ecc7ceb6
		
			
		
	
	
	
	
		
			
			* chore: add custom folder prompt * chore: zip collab db * chore: fix test * chore: add test * chore: fmt * chore: fmt * chore: fmt
		
			
				
	
	
		
			37 lines
		
	
	
		
			906 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			37 lines
		
	
	
		
			906 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
| export 'package:async/async.dart';
 | |
| import 'dart:async';
 | |
| import 'package:appflowy_backend/rust_stream.dart';
 | |
| import 'package:flutter/services.dart';
 | |
| import 'dart:ffi';
 | |
| import 'ffi.dart' as ffi;
 | |
| import 'package:ffi/ffi.dart';
 | |
| 
 | |
| enum ExceptionType {
 | |
|   AppearanceSettingsIsEmpty,
 | |
| }
 | |
| 
 | |
| class FlowySDKException implements Exception {
 | |
|   ExceptionType type;
 | |
|   FlowySDKException(this.type);
 | |
| }
 | |
| 
 | |
| class FlowySDK {
 | |
|   static const MethodChannel _channel = MethodChannel('appflowy_backend');
 | |
|   static Future<String> get platformVersion async {
 | |
|     final String version = await _channel.invokeMethod('getPlatformVersion');
 | |
|     return version;
 | |
|   }
 | |
| 
 | |
|   FlowySDK();
 | |
| 
 | |
|   void dispose() {}
 | |
| 
 | |
|   Future<void> init(String configuration) async {
 | |
|     final port = RustStreamReceiver.shared.port;
 | |
|     ffi.set_stream_port(port);
 | |
| 
 | |
|     ffi.store_dart_post_cobject(NativeApi.postCObject);
 | |
|     ffi.init_sdk(configuration.toNativeUtf8());
 | |
|   }
 | |
| }
 |