Skip to content

Commit e48bd9e

Browse files
committed
Address sliver tree test review feedback
1 parent ec25498 commit e48bd9e

1 file changed

Lines changed: 16 additions & 43 deletions

File tree

packages/flutter/test/rendering/sliver_tree_test.dart

Lines changed: 16 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,56 +2,29 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
import 'package:flutter/foundation.dart'
6-
show FlutterError, FlutterErrorDetails, FlutterExceptionHandler;
7-
import 'package:flutter/painting.dart'
8-
show
9-
Axis,
10-
Color,
11-
FontWeight,
12-
Offset,
13-
Rect,
14-
TextDecoration,
15-
TextDecorationStyle,
16-
TextDirection,
17-
TextStyle;
18-
import 'package:flutter/rendering.dart' show TreeSliverIndentationType;
19-
import 'package:flutter/widgets.dart'
20-
show
21-
AnimationStyle,
22-
Container,
23-
Curves,
24-
CustomScrollView,
25-
DefaultTextStyle,
26-
Directionality,
27-
Icon,
28-
ScrollController,
29-
TreeSliver,
30-
TreeSliverNode,
31-
Widget;
5+
import 'package:flutter/foundation.dart';
6+
import 'package:flutter/rendering.dart';
7+
import 'package:flutter/widgets.dart';
328
import 'package:flutter_test/flutter_test.dart';
339

34-
/// The fallback text style used by MaterialApp when no other style is provided.
35-
///
36-
/// This is used in tests to ensure consistent text metrics without a dependency
37-
/// on the Material library.
38-
const TextStyle _materialAppFallbackTextStyle = TextStyle(
39-
color: Color(0xD0FF0000),
40-
fontFamily: 'monospace',
41-
fontSize: 48.0,
42-
fontWeight: FontWeight.w900,
43-
decoration: TextDecoration.underline,
44-
decorationColor: Color(0xFFFFFF00),
45-
decorationStyle: TextDecorationStyle.double,
46-
debugLabel: 'fallback style; consider putting your text in a Material',
47-
);
48-
4910
/// Wraps the [child] in a [Directionality] and [DefaultTextStyle] to provide
5011
/// the necessary context for rendering tests.
5112
Widget _buildTestWidget(Widget child) {
5213
return Directionality(
5314
textDirection: TextDirection.ltr,
54-
child: DefaultTextStyle(style: _materialAppFallbackTextStyle, child: child),
15+
child: DefaultTextStyle(
16+
style: const TextStyle(
17+
color: Color(0xFF000000),
18+
fontFamily: 'monospace',
19+
fontSize: 48.0,
20+
fontWeight: FontWeight.w900,
21+
decoration: TextDecoration.underline,
22+
decorationColor: Color(0xFFFFFF00),
23+
decorationStyle: TextDecorationStyle.double,
24+
debugLabel: 'fallback style',
25+
),
26+
child: child,
27+
),
5528
);
5629
}
5730

0 commit comments

Comments
 (0)