feat: add ThermionFlutterOptions classes, rename interface parameter for offsetTop and ensure pixelRatio is passed to resizeTexture
This commit is contained in:
@@ -4,6 +4,12 @@ import 'package:thermion_dart/thermion_dart/thermion_viewer.dart';
|
||||
import 'package:plugin_platform_interface/plugin_platform_interface.dart';
|
||||
import 'thermion_flutter_texture.dart';
|
||||
|
||||
abstract class ThermionFlutterOptions {
|
||||
final String? uberarchivePath;
|
||||
|
||||
ThermionFlutterOptions({this.uberarchivePath});
|
||||
}
|
||||
|
||||
abstract class ThermionFlutterPlatform extends PlatformInterface {
|
||||
ThermionFlutterPlatform() : super(token: _token);
|
||||
|
||||
@@ -17,14 +23,17 @@ abstract class ThermionFlutterPlatform extends PlatformInterface {
|
||||
_instance = instance;
|
||||
}
|
||||
|
||||
Future<ThermionViewer> createViewer({String? uberArchivePath});
|
||||
Future<ThermionViewer> createViewerWithOptions(
|
||||
covariant ThermionFlutterOptions options);
|
||||
|
||||
Future<ThermionFlutterTexture?> createTexture(
|
||||
double width, double height, double offsetLeft, double offsetRight, double pixelRatio);
|
||||
@deprecated
|
||||
Future<ThermionViewer> createViewer({String? uberarchivePath});
|
||||
|
||||
Future<ThermionFlutterTexture?> createTexture(double width, double height,
|
||||
double offsetLeft, double offsetTop, double pixelRatio);
|
||||
|
||||
Future destroyTexture(ThermionFlutterTexture texture);
|
||||
|
||||
Future<ThermionFlutterTexture?> resizeTexture(ThermionFlutterTexture texture,
|
||||
int width, int height, int offsetLeft, int offsetRight);
|
||||
|
||||
int width, int height, int offsetTop, int offsetRight, double pixelRatio);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import 'package:thermion_flutter_platform_interface/thermion_flutter_platform_interface.dart';
|
||||
|
||||
class ThermionFlutterWebOptions extends ThermionFlutterOptions {
|
||||
bool createCanvas;
|
||||
bool importCanvasAsWidget;
|
||||
|
||||
ThermionFlutterWebOptions({this.importCanvasAsWidget = false, this.createCanvas = true, String? uberarchivePath}) : super(uberarchivePath:uberarchivePath);
|
||||
}
|
||||
Reference in New Issue
Block a user