Initial project

This commit is contained in:
Cody
2026-03-06 14:56:17 +08:00
parent 977b627b15
commit bf9e099747
1180 changed files with 50973 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
library;
export 'src/printer/console_printer.dart';
export 'src/printer/file_printer.dart';
export 'src/printer/log_printer.dart';
export 'src/printer/native_printer.dart';
export 'src/im_log_sdk.dart';

View File

@@ -0,0 +1,19 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'im_log_sdk_platform_interface.dart';
/// An implementation of [ImLogSdkPlatform] that uses method channels.
class MethodChannelImLogSdk extends ImLogSdkPlatform {
/// The method channel used to interact with the native platform.
@visibleForTesting
final methodChannel = const MethodChannel('im_log_sdk');
@override
Future<String?> getPlatformVersion() async {
final version = await methodChannel.invokeMethod<String>(
'getPlatformVersion',
);
return version;
}
}

View File

@@ -0,0 +1,29 @@
import 'package:plugin_platform_interface/plugin_platform_interface.dart';
import 'im_log_sdk_method_channel.dart';
abstract class ImLogSdkPlatform extends PlatformInterface {
/// Constructs a ImLogSdkPlatform.
ImLogSdkPlatform() : super(token: _token);
static final Object _token = Object();
static ImLogSdkPlatform _instance = MethodChannelImLogSdk();
/// The default instance of [ImLogSdkPlatform] to use.
///
/// Defaults to [MethodChannelImLogSdk].
static ImLogSdkPlatform get instance => _instance;
/// Platform-specific implementations should set this with their own
/// platform-specific class that extends [ImLogSdkPlatform] when
/// they register themselves.
static set instance(ImLogSdkPlatform instance) {
PlatformInterface.verifyToken(instance, _token);
_instance = instance;
}
Future<String?> getPlatformVersion() {
throw UnimplementedError('platformVersion() has not been implemented.');
}
}

View File

@@ -0,0 +1 @@
class LogAdaptor {}

View File

@@ -0,0 +1 @@
class LogConfig {}

View File

@@ -0,0 +1 @@
class ImLogSdk {}

View File

@@ -0,0 +1 @@
class LogRecord {}

View File

@@ -0,0 +1 @@
class ConsolePrinter {}

View File

@@ -0,0 +1 @@
class FilePrinter {}

View File

@@ -0,0 +1,10 @@
class LogPrinter {
LogPrinter._();
static LogPrinter? _instance;
static LogPrinter get instance {
_instance ??= LogPrinter._();
return _instance!;
}
}

View File

@@ -0,0 +1 @@
class NativePrinter {}