merge in Windows support

This commit is contained in:
Nick Fisher
2023-09-30 16:54:20 +10:00
479 changed files with 20885 additions and 54442 deletions

View File

@@ -51,10 +51,22 @@ class _RenderResizeObserver extends RenderProxyBox {
class FilamentWidget extends StatefulWidget {
final FilamentController controller;
///
/// The content to render before the texture widget is available.
/// The default is a solid red Container, intentionally chosen to make it clear that there will be at least one frame where the Texture widget is not being rendered.
///
late final Widget initial;
final void Function()? onResize;
const FilamentWidget({Key? key, required this.controller, this.onResize})
: super(key: key);
FilamentWidget({Key? key, required this.controller, this.onResize, Widget? initial})
: super(key: key) {
if(initial != null) {
this.initial = initial;
} else {
this.initial = Container(color:Colors.red);
}
}
@override
_FilamentWidgetState createState() => _FilamentWidgetState();
@@ -142,7 +154,7 @@ class _FilamentWidgetState extends State<FilamentWidget> {
Widget build(BuildContext context) {
return LayoutBuilder(builder: ((context, constraints) {
if (_textureId == null) {
return Container(color: Colors.transparent);
return widget.initial;
}
var texture = Texture(
key: ObjectKey("texture_$_textureId"),
@@ -177,7 +189,7 @@ class _FilamentWidgetState extends State<FilamentWidget> {
},
child: _resizing
? Container()
: Platform.isLinux
: Platform.isLinux || Platform.isWindows
? Transform(
alignment: Alignment.center,
transform: Matrix4.rotationX(