Skip to content

Commit

Permalink
PR updates
Browse files Browse the repository at this point in the history
  • Loading branch information
angelosilvestre committed Jul 20, 2023
1 parent c664642 commit b338d05
Showing 1 changed file with 3 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class _AndroidEditingOverlayControlsState extends State<AndroidEditingOverlayCon
// We use a post-frame callback to let the text be laid out first.
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
if (mounted) {
_updateOffsetForCollapsedHandleAndRebuild();
_updateOffsetForCollapsedHandle();
}
});
}
Expand All @@ -148,7 +148,7 @@ class _AndroidEditingOverlayControlsState extends State<AndroidEditingOverlayCon
// We use a post-frame callback to let the text be laid out first.
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
if (mounted) {
_updateOffsetForCollapsedHandleAndRebuild();
_updateOffsetForCollapsedHandle();
}
});
}
Expand Down Expand Up @@ -404,25 +404,7 @@ class _AndroidEditingOverlayControlsState extends State<AndroidEditingOverlayCon
if (offset == null) {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
if (mounted) {
_updateOffsetForCollapsedHandleAndRebuild();
}
});
return;
}

_collapsedHandleOffset = offset;
}

/// Update the offset for the collapsed handle and call `setState`.
///
/// Re-schedules the update if we can't compute compute the offset at the current frame.
void _updateOffsetForCollapsedHandleAndRebuild() {
final offset = _computeOffsetForCollapsedHandle();

if (offset == null) {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
if (mounted) {
_updateOffsetForCollapsedHandleAndRebuild();
_updateOffsetForCollapsedHandle();
}
});
return;
Expand Down

0 comments on commit b338d05

Please sign in to comment.