From 19990c2d42bc5019ba81137d6811ef26fd45dae9 Mon Sep 17 00:00:00 2001 From: Roshan Prakash Raut Date: Thu, 18 Feb 2021 04:20:22 +0530 Subject: [PATCH] added debugDisableShadows usage explaination (#72008) --- packages/flutter/lib/src/painting/debug.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/flutter/lib/src/painting/debug.dart b/packages/flutter/lib/src/painting/debug.dart index f1a42f37e3..25ef095b2c 100644 --- a/packages/flutter/lib/src/painting/debug.dart +++ b/packages/flutter/lib/src/painting/debug.dart @@ -13,6 +13,12 @@ import 'package:flutter/foundation.dart'; /// This is useful when writing golden file tests (see [matchesGoldenFile]) since /// the rendering of shadows is not guaranteed to be pixel-for-pixel identical from /// version to version (or even from run to run). +/// +/// In those tests, this is usually set to false at the beginning of a test and back +/// to true before the end of the test case. +/// +/// If it remains true when the test ends, an exception is thrown to avoid state +/// leaking from one test case to another. bool debugDisableShadows = false; /// Signature for a method that returns an [HttpClient].