From 4e8425664244ebf925066f0bf59d83c19dbbe0a5 Mon Sep 17 00:00:00 2001 From: Hans Muller Date: Thu, 14 Mar 2019 09:19:47 -0700 Subject: [PATCH] Error message when TextSelectionOverlay finds no Overlay (#29329) --- packages/flutter/lib/src/widgets/text_selection.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/flutter/lib/src/widgets/text_selection.dart b/packages/flutter/lib/src/widgets/text_selection.dart index d735280241c..5646fe4c90d 100644 --- a/packages/flutter/lib/src/widgets/text_selection.dart +++ b/packages/flutter/lib/src/widgets/text_selection.dart @@ -254,7 +254,10 @@ class TextSelectionOverlay { assert(context != null), _value = value { final OverlayState overlay = Overlay.of(context); - assert(overlay != null); + assert(overlay != null, + 'No Overlay widget exists above $context.\n' + 'Usually the Navigator created by WidgetsApp provides the overlay. Perhaps your ' + 'app content was created above the Navigator with the WidgetsApp builder parameter.'); _toolbarController = AnimationController(duration: fadeDuration, vsync: overlay); }