We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it supposed to? That's not clear from the docs. I have this working as expected on iOS, but running in Chrome on MacOS I get an exception.
Code:
screenshotController .captureFromWidget( Container( padding: const EdgeInsets.all(5.0), decoration: BoxDecoration( border: Border.all(color: Colors.black, width: 2.0), ), child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Center(child: Text(_title)), Center( child: makeGridWidget( forSharing: true)), ])), delay: const Duration(milliseconds: 500)) .then((capturedImage) { ...
makeGridWidget returns a GridView where each child is one of these:
makeGridWidget
GridView
SizedBox( width: 50, height: 50, child: DecoratedBox( decoration: BoxDecoration(color: color, border: border), child: Center( child: Text(txt, textAlign: TextAlign.center, style: const TextStyle(color: Colors.black))), ), ))
Result:
Launching lib/main.dart on Chrome in debug mode... This app is linked to the debug service: ws://127.0.0.1:58376/ducuHAKejXk=/ws Debug service listening on ws://127.0.0.1:58376/ducuHAKejXk=/ws 💪 Running with sound null safety 💪 Connecting to VM Service at ws://127.0.0.1:58376/ducuHAKejXk=/ws Flutter Web Bootstrap: Programmatic ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════ The following assertion was thrown building RawScrollbar(dirty, dependencies: [Directionality], state: RawScrollbarState<RawScrollbar>#05aaa(tickers: tracking 1 ticker)): No MediaQuery widget ancestor found. RawScrollbar widgets require a MediaQuery widget ancestor. The specific widget that could not find a MediaQuery ancestor was: RawScrollbar The ownership chain for the affected widget is: "RawScrollbar ← Scrollable ← GridView ← Center ← Column ← Padding ← DecoratedBox ← Container ← Directionality ← RenderObjectToWidgetAdapter<RenderBox>-[GlobalObjectKey RenderRepaintBoundary#5b526]" No MediaQuery ancestor could be found starting from the context that was passed to MediaQuery.of(). This can happen because you have not added a WidgetsApp, CupertinoApp, or MaterialApp widget (those widgets introduce a MediaQuery), or it can happen if the context you use comes from a widget above those widgets. The relevant error-causing widget was: GridView When the exception was thrown, this was the stack: dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 251:49 throw_ packages/flutter/src/widgets/debug.dart 246:7 <fn> packages/flutter/src/widgets/debug.dart 260:12 debugCheckHasMediaQuery packages/flutter/src/widgets/media_query.dart 908:12 of packages/flutter/src/widgets/scrollbar.dart 1551:42 <fn> packages/flutter/src/widgets/scrollbar.dart 1558:26 updateScrollbarPainter packages/flutter/src/widgets/scrollbar.dart 1953:5 build packages/flutter/src/widgets/framework.dart 4919:27 build packages/flutter/src/widgets/framework.dart 4806:15 performRebuild packages/flutter/src/widgets/framework.dart 4977:11 performRebuild packages/flutter/src/widgets/framework.dart 4529:5 rebuild packages/flutter/src/widgets/framework.dart 4787:5 [_firstBuild] packages/flutter/src/widgets/framework.dart 4968:11 [_firstBuild] packages/flutter/src/widgets/framework.dart 4781:5 mount packages/flutter/src/widgets/framework.dart 3817:15 inflateWidget packages/flutter/src/widgets/framework.dart 3551:18 updateChild packages/flutter/src/widgets/framework.dart 4832:16 performRebuild packages/flutter/src/widgets/framework.dart 4977:11 performRebuild packages/flutter/src/widgets/framework.dart 4529:5 rebuild packages/flutter/src/widgets/framework.dart 4787:5 [_firstBuild] packages/flutter/src/widgets/framework.dart 4968:11 [_firstBuild] packages/flutter/src/widgets/framework.dart 4781:5 mount packages/flutter/src/widgets/framework.dart 3817:15 inflateWidget packages/flutter/src/widgets/framework.dart 3551:18 updateChild packages/flutter/src/widgets/framework.dart 4832:16 performRebuild packages/flutter/src/widgets/framework.dart 4529:5 rebuild packages/flutter/src/widgets/framework.dart 4787:5 [_firstBuild] packages/flutter/src/widgets/framework.dart 4781:5 mount packages/flutter/src/widgets/framework.dart 3817:15 inflateWidget packages/flutter/src/widgets/framework.dart 3551:18 updateChild packages/flutter/src/widgets/framework.dart 6215:14 mount packages/flutter/src/widgets/framework.dart 3817:15 inflateWidget packages/flutter/src/widgets/framework.dart 6350:36 inflateWidget packages/flutter/src/widgets/framework.dart 6362:32 mount packages/flutter/src/widgets/framework.dart 3817:15 inflateWidget packages/flutter/src/widgets/framework.dart 3551:18 updateChild packages/flutter/src/widgets/framework.dart 6215:14 mount packages/flutter/src/widgets/framework.dart 3817:15 inflateWidget packages/flutter/src/widgets/framework.dart 3551:18 updateChild packages/flutter/src/widgets/framework.dart 6215:14 mount packages/flutter/src/widgets/framework.dart 3817:15 inflateWidget packages/flutter/src/widgets/framework.dart 3551:18 updateChild packages/flutter/src/widgets/framework.dart 4832:16 performRebuild packages/flutter/src/widgets/framework.dart 4529:5 rebuild packages/flutter/src/widgets/framework.dart 4787:5 [_firstBuild] packages/flutter/src/widgets/framework.dart 4781:5 mount packages/flutter/src/widgets/framework.dart 3817:15 inflateWidget packages/flutter/src/widgets/framework.dart 3551:18 updateChild packages/flutter/src/widgets/framework.dart 4832:16 performRebuild packages/flutter/src/widgets/framework.dart 4529:5 rebuild packages/flutter/src/widgets/framework.dart 4787:5 [_firstBuild] packages/flutter/src/widgets/framework.dart 4781:5 mount packages/flutter/src/widgets/framework.dart 3817:15 inflateWidget packages/flutter/src/widgets/framework.dart 3551:18 updateChild packages/flutter/src/widgets/binding.dart 1202:16 [_rebuild] packages/flutter/src/widgets/binding.dart 1171:5 mount packages/flutter/src/widgets/binding.dart 1119:16 <fn> packages/flutter/src/widgets/framework.dart 2597:19 buildScope packages/flutter/src/widgets/binding.dart 1118:12 attachToRenderTree packages/screenshot/screenshot.dart 187:27 widgetToUiImage dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54 runBody dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5 _async packages/screenshot/screenshot.dart 118:42 widgetToUiImage packages/screenshot/screenshot.dart 106:28 captureFromWidget dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54 runBody dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5 _async packages/screenshot/screenshot.dart 99:38 captureFromWidget packages/griddle/main.dart 549:10 sharePuzzle packages/griddle/main.dart 594:35 <fn> packages/flutter/src/material/ink_well.dart 1005:21 [_handleTap] packages/flutter/src/gestures/recognizer.dart 198:24 invokeCallback packages/flutter/src/gestures/tap.dart 613:48 handleTapUp packages/flutter/src/gestures/tap.dart 298:5 [_checkUp] packages/flutter/src/gestures/tap.dart 232:7 handlePrimaryPointer packages/flutter/src/gestures/recognizer.dart 563:9 handleEvent packages/flutter/src/gestures/pointer_router.dart 94:12 [_dispatch] packages/flutter/src/gestures/pointer_router.dart 139:9 <fn> dart-sdk/lib/_internal/js_dev_runtime/private/linked_hash_map.dart 21:13 forEach packages/flutter/src/gestures/pointer_router.dart 137:17 [_dispatchEventToRoutes] packages/flutter/src/gestures/pointer_router.dart 123:7 route packages/flutter/src/gestures/binding.dart 445:19 handleEvent packages/flutter/src/gestures/binding.dart 425:14 dispatchEvent packages/flutter/src/rendering/binding.dart 329:11 dispatchEvent packages/flutter/src/gestures/binding.dart 380:7 [_handlePointerEventImmediately] packages/flutter/src/gestures/binding.dart 344:5 handlePointerEvent packages/flutter/src/gestures/binding.dart 302:7 [_flushPointerEventQueue] packages/flutter/src/gestures/binding.dart 285:32 [_handlePointerDataPacket] lib/_engine/engine/platform_dispatcher.dart 1105:13 invoke1 lib/_engine/engine/platform_dispatcher.dart 185:5 invokeOnPointerDataPacket lib/_engine/engine/pointer_binding.dart 130:39 [_onPointerData] lib/_engine/engine/pointer_binding.dart 543:18 <fn> lib/_engine/engine/pointer_binding.dart 496:21 <fn> lib/_engine/engine/pointer_binding.dart 210:16 loggedHandler ════════════════════════════════════════════════════════════════════════════════════════════════════
The text was updated successfully, but these errors were encountered:
same here background image does not shown in chrome but safari works fine
Sorry, something went wrong.
No branches or pull requests
Is it supposed to? That's not clear from the docs. I have this working as expected on iOS, but running in Chrome on MacOS I get an exception.
Code:
makeGridWidget
returns aGridView
where each child is one of these:Result:
The text was updated successfully, but these errors were encountered: