Closed rlee1990 closed 1 year ago
Which version of Flutter are you using?
Which version of Flutter are you using?
@ueman I am using flutter 3.3.8
@ueman any ideas on what it could be?
No, unfortunately not. Can you post a minimal example to reproduce the error?
No, unfortunately not. Can you post a minimal example to reproduce the error?
@ueman I am using it like this inside a stack
ScreenRecorder(
background: Colors.black,
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
controller: screenRecorderController!,
child: Stack(
alignment: Alignment.center,
children: [
Center(
child: Image.file(
newFile!,
fit: BoxFit.cover,
),
),
for (int i = 0; i < addedWidgets.length; i++)
addedWidgets[i],
],
),
),
I made a fork of the package and made this change
Future<ui.Image> capture() async {
final renderObject = _containerKey.currentContext!.findRenderObject()
as RenderRepaintBoundary;
return await renderObject.toImage(pixelRatio: pixelRatio);
}
I no longer get the error but also everything is null.
@ueman if you check this example that I made on how mine is setup it also returns null. Ill keep playing around to find the root cause. Example
Also, why does version 0.1.0 require a nonstable version of flutter?
Also, why does version 0.1.0 require a nonstable version of flutter?
It makes use of new APIs which make taking the recording easier.
Also, why does version 0.1.0 require a nonstable version of flutter?
It makes use of new APIs which make taking the recording easier.
Let me try to upgrade flutter to this and see if this fix the issue. Its odd I use the example with the changes I made to the package and it somewhat works just very delayed
@ueman so I tried using the lastest Flutter master branch but I cannot as other packages(alot) are not supporting it that I rely on. So trying with version 0.0.3 of this package but the data is always null when returned.
When I try to record I receive this error
Exception: _containerKey.currentContext is null. Thus we can't create a screenshot