Initial commit with local development content

This commit is contained in:
gem
2025-01-16 14:19:38 +08:00
commit 24fc4c113d
89 changed files with 2449 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
// You have generated a new plugin project without specifying the `--platforms`
// flag. A plugin project with no platform support was generated. To add a
// platform, run `flutter create -t plugin --platforms <platforms> .` under the
// same directory. You can also find a detailed instruction on how to add
// platforms in the `pubspec.yaml` at
// https://flutter.dev/to/pubspec-plugin-platforms.
import 'flutter_cocos_view_platform_interface.dart';
class FlutterCocosView {
Future<String?> getPlatformVersion() {
return FlutterCocosViewPlatform.instance.getPlatformVersion();
}
}

View File

@@ -0,0 +1,17 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'flutter_cocos_view_platform_interface.dart';
/// An implementation of [FlutterCocosViewPlatform] that uses method channels.
class MethodChannelFlutterCocosView extends FlutterCocosViewPlatform {
/// The method channel used to interact with the native platform.
@visibleForTesting
final methodChannel = const MethodChannel('flutter_cocos_view');
@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 'flutter_cocos_view_method_channel.dart';
abstract class FlutterCocosViewPlatform extends PlatformInterface {
/// Constructs a FlutterCocosViewPlatform.
FlutterCocosViewPlatform() : super(token: _token);
static final Object _token = Object();
static FlutterCocosViewPlatform _instance = MethodChannelFlutterCocosView();
/// The default instance of [FlutterCocosViewPlatform] to use.
///
/// Defaults to [MethodChannelFlutterCocosView].
static FlutterCocosViewPlatform get instance => _instance;
/// Platform-specific implementations should set this with their own
/// platform-specific class that extends [FlutterCocosViewPlatform] when
/// they register themselves.
static set instance(FlutterCocosViewPlatform instance) {
PlatformInterface.verifyToken(instance, _token);
_instance = instance;
}
Future<String?> getPlatformVersion() {
throw UnimplementedError('platformVersion() has not been implemented.');
}
}