Skip to content

Commit

Permalink
Merge pull request #5 from badlee/patch-2
Browse files Browse the repository at this point in the history
fix BUG Overlay.of(context)  return null
  • Loading branch information
RafaelBarbosatec committed Mar 25, 2022
2 parents 5315d27 + b81656e commit 3446640
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/achievement_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ class AchievementView {
final String title;
final String subTitle;
final double elevation;
final OverlayState overlay;

OverlayEntry _overlayEntry;

AchievementView(
this._context, {
this.overlay,
this.elevation = 2,
this.onTab,
this.listener,
Expand Down Expand Up @@ -70,7 +72,7 @@ class AchievementView {
void show() {
if (_overlayEntry == null) {
_overlayEntry = _buildOverlay();
Overlay.of(_context).insert(_overlayEntry);
(overlay ?? Overlay.of(_context)).insert(_overlayEntry);
}
}

Expand Down

0 comments on commit 3446640

Please sign in to comment.