Rendering errors with root causes in the widget layer should have a reference to the widget (#32511)

This commit is contained in:
chunhtai
2019-07-09 10:18:30 -07:00
committed by GitHub
parent 97b2c98642
commit a76e39f984
15 changed files with 506 additions and 37 deletions

View File

@@ -0,0 +1,26 @@
<<skip until matching line>>
══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following assertion was thrown building
RawGestureDetector-\[LabeledGlobalKey<RawGestureDetectorState>#.+\]\(state:
RawGestureDetectorState#.+\(gestures: <none>, behavior: opaque\)\):
'package:flutter\/src\/painting\/basic_types\.dart': Failed assertion: line 223 pos 10: 'textDirection
!= null': is not true\.
Either the assertion indicates an error in the framework itself, or we should provide substantially
more information in this error message to help you determine and fix the underlying cause\.
In either case, please report this assertion by filing a bug on GitHub:
https:\/\/github\.com\/flutter\/flutter\/issues\/new\?template=BUG\.md
User-created ancestor of the error-causing widget was:
CustomScrollView
file:\/\/\/.+print_user_created_ancestor_test\.dart:[0-9]+:7
When the exception was thrown, this was the stack:
<<skip until matching line>>
\(elided [0-9]+ frames from .+\)
════════════════════════════════════════════════════════════════════════════════════════════════════
.*..:.. \+0 -1: Rendering Error *
Test failed\. See exception logs above\.
The test description was: Rendering Error
*
.*..:.. \+0 -1: Some tests failed\. *

View File

@@ -0,0 +1,25 @@
<<skip until matching line>>
══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following assertion was thrown building
RawGestureDetector-\[LabeledGlobalKey<RawGestureDetectorState>#.+\]\(state:
RawGestureDetectorState#.+\(gestures: <none>, behavior: opaque\)\):
'package:flutter\/src\/painting\/basic_types\.dart': Failed assertion: line 223 pos 10: 'textDirection
!= null': is not true\.
Either the assertion indicates an error in the framework itself, or we should provide substantially
more information in this error message to help you determine and fix the underlying cause\.
In either case, please report this assertion by filing a bug on GitHub:
https:\/\/github\.com\/flutter\/flutter\/issues\/new\?template=BUG\.md
Widget creation tracking is currently disabled. Enabling it enables improved error messages\. It can
be enabled by passing `--track-widget-creation` to `flutter run` or `flutter test`\.
When the exception was thrown, this was the stack:
<<skip until matching line>>
\(elided [0-9]+ frames from .+\)
════════════════════════════════════════════════════════════════════════════════════════════════════
.*..:.. \+0 -1: Rendering Error *
Test failed\. See exception logs above\.
The test description was: Rendering Error
*
.*..:.. \+0 -1: Some tests failed\. *

View File

@@ -0,0 +1,19 @@
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('Rendering Error', (WidgetTester tester) async {
// this should fail
await tester.pumpWidget(
CustomScrollView(
slivers: <Widget>[
SliverToBoxAdapter(child: Container()),
]
)
);
});
}

View File

@@ -0,0 +1,19 @@
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('Rendering Error', (WidgetTester tester) async {
// this should fail
await tester.pumpWidget(
CustomScrollView(
slivers: <Widget>[
SliverToBoxAdapter(child: Container()),
]
)
);
});
}