Skip to content

Commit

Permalink
fix deprecated fuctions which deprecated in 1.12.x
Browse files Browse the repository at this point in the history
  • Loading branch information
boyan01 committed Feb 8, 2021
1 parent 2af2919 commit a363a8a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/src/overlay.dart
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class OverlaySupport extends StatelessWidget {
@override
Widget build(BuildContext context) {
assert(() {
if (context.ancestorWidgetOfExactType(OverlaySupport) != null) {
if (context.findAncestorWidgetOfExactType<OverlaySupport>() != null) {
throw FlutterError('There is already an OverlaySupport in the Widget tree.');
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/overlay_entry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class OverlaySupportEntry {
final GlobalKey<_AnimatedOverlayState> _stateKey;

static OverlaySupportEntry of(BuildContext context, {Widget requireForDebug}) {
final animatedOverlay = context.ancestorWidgetOfExactType(_AnimatedOverlay);
final animatedOverlay = context.findAncestorWidgetOfExactType<_AnimatedOverlay>();
assert(() {
if (animatedOverlay == null && requireForDebug != null) {
throw FlutterError('No _AnimatedOverlay widget found.\n'
Expand Down
2 changes: 1 addition & 1 deletion lib/src/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class OverlaySupportTheme extends InheritedWidget {
super(key: key, child: child);

static OverlaySupportTheme of(BuildContext context) {
return context.inheritFromWidgetOfExactType(OverlaySupportTheme) as OverlaySupportTheme;
return context.dependOnInheritedWidgetOfExactType<OverlaySupportTheme>();
}

static ToastThemeData toast(BuildContext context) {
Expand Down

0 comments on commit a363a8a

Please sign in to comment.