diff --git a/thermion_flutter/thermion_flutter_platform_interface/lib/thermion_flutter_platform_interface.dart b/thermion_flutter/thermion_flutter_platform_interface/lib/thermion_flutter_platform_interface.dart index 7a3b45d9..7bf6dfb2 100644 --- a/thermion_flutter/thermion_flutter_platform_interface/lib/thermion_flutter_platform_interface.dart +++ b/thermion_flutter/thermion_flutter_platform_interface/lib/thermion_flutter_platform_interface.dart @@ -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 createViewer({String? uberArchivePath}); + Future createViewerWithOptions( + covariant ThermionFlutterOptions options); - Future createTexture( - double width, double height, double offsetLeft, double offsetRight, double pixelRatio); + @deprecated + Future createViewer({String? uberarchivePath}); + + Future createTexture(double width, double height, + double offsetLeft, double offsetTop, double pixelRatio); Future destroyTexture(ThermionFlutterTexture texture); Future resizeTexture(ThermionFlutterTexture texture, - int width, int height, int offsetLeft, int offsetRight); - + int width, int height, int offsetTop, int offsetRight, double pixelRatio); } diff --git a/thermion_flutter/thermion_flutter_web/lib/thermion_flutter_web_options.dart b/thermion_flutter/thermion_flutter_web/lib/thermion_flutter_web_options.dart new file mode 100644 index 00000000..e453233d --- /dev/null +++ b/thermion_flutter/thermion_flutter_web/lib/thermion_flutter_web_options.dart @@ -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); +}