showTextOverlay function
Future<void>
showTextOverlay({
- StoryElement? storyElement,
- required EditorController editorController,
Implementation
Future<void> showTextOverlay({
StoryElement? storyElement,
required EditorController editorController,
}) async {
if (_overlayAnimationController == null) {
return;
}
_editorController = editorController;
const Curve curve = Curves.easeOut;
editorController.isShowingOverlay.value = true;
_overlayEntry = OverlayEntry(
builder: (BuildContext context) {
return AnimatedBuilder(
animation: _overlayAnimationController!,
builder: (BuildContext context, Widget? child) {
final double animationValue =
curve.transform(_overlayAnimationController!.value);
return Opacity(
opacity: animationValue,
child: TextOverlay(
editorController: editorController,
storyElement: storyElement,
screen: MediaQuery.of(context).size,
),
);
},
);
},
);
if (_overlayEntry != null) {
await addToOverlay(_overlayEntry!);
await _overlayAnimationController!.forward();
}
}