Skip to content

Commit 6ca02e8

Browse files
authored
[material_ui] Remove widgets/ import in flexible_space_bar_test.dart, app_bar_sliver_test.dart and partial fix in chip_test.dart (#12004)
Part of flutter/flutter#182636 and flutter/flutter#188395 This PR: * Removed the cross-import of `widgets/semantics_tester.dart`. * Removed @Skip tag, all tests in this file has passed. `semantics_tester.dart` has existed in material_ui, so we can directly import `semantics_tester.dart`; * Moved the file to `test/` folder. Note: `chip_test.dart` only partially remove the widgets/ dependency and still stay in `temporarily_disabled_tests` folder. Once flutter/flutter#184279 is ported over, this file can be move out of the folder. ## Pre-Review Checklist
1 parent 4bea773 commit 6ca02e8

3 files changed

Lines changed: 26 additions & 27 deletions

File tree

packages/material_ui/temporarily_disabled_tests/chip_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import 'package:flutter/services.dart';
1919
import 'package:flutter_test/flutter_test.dart';
2020

2121
import '../widgets/feedback_tester.dart';
22-
import '../widgets/semantics_tester.dart';
22+
import '../test/semantics_tester.dart';
2323

2424
Finder findRenderChipElement() {
2525
return find.byElementPredicate((Element e) => '${e.renderObject.runtimeType}' == '_RenderChip');

packages/material_ui/temporarily_disabled_tests/app_bar_sliver_test.dart renamed to packages/material_ui/test/app_bar_sliver_test.dart

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

5-
@Skip(
6-
'This file is skipped due to a cross-import that needs to be fixed. Tracked in https://github.com/flutter/flutter/issues/177028.',
7-
)
8-
import 'package:material_ui/material_ui.dart';
5+
import 'dart:async' show unawaited;
6+
97
import 'package:flutter/rendering.dart';
108
import 'package:flutter_test/flutter_test.dart';
9+
import 'package:material_ui/material_ui.dart';
1110

12-
import '../widgets/semantics_tester.dart';
1311
import 'app_bar_utils.dart';
12+
import 'semantics_tester.dart';
1413

1514
Widget buildSliverAppBarApp({
1615
bool floating = false,
@@ -71,22 +70,24 @@ void main() {
7170
return Center(
7271
child: FilledButton(
7372
onPressed: () {
74-
Navigator.push(
75-
context,
76-
MaterialPageRoute<void>(
77-
builder: (BuildContext context) {
78-
return Scaffold(
79-
body: CustomScrollView(
80-
primary: true,
81-
slivers: <Widget>[
82-
const SliverAppBar.large(title: Text(title)),
83-
SliverToBoxAdapter(
84-
child: Container(height: 1200, color: Colors.orange[400]),
85-
),
86-
],
87-
),
88-
);
89-
},
73+
unawaited(
74+
Navigator.push(
75+
context,
76+
MaterialPageRoute<void>(
77+
builder: (BuildContext context) {
78+
return Scaffold(
79+
body: CustomScrollView(
80+
primary: true,
81+
slivers: <Widget>[
82+
const SliverAppBar.large(title: Text(title)),
83+
SliverToBoxAdapter(
84+
child: Container(height: 1200, color: Colors.orange[400]),
85+
),
86+
],
87+
),
88+
);
89+
},
90+
),
9091
),
9192
);
9293
},

packages/material_ui/temporarily_disabled_tests/flexible_space_bar_test.dart renamed to packages/material_ui/test/flexible_space_bar_test.dart

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

5-
@Skip(
6-
'This file is skipped due to a cross-import that needs to be fixed. Tracked in https://github.com/flutter/flutter/issues/177028.',
7-
)
85
// This file is run as part of a reduced test set in CI on Mac and Windows
96
// machines.
107
@Tags(<String>['reduced-test-set'])
118
library;
129

13-
import 'package:material_ui/material_ui.dart';
1410
import 'package:flutter/rendering.dart';
1511
import 'package:flutter_test/flutter_test.dart';
16-
import '../widgets/semantics_tester.dart';
12+
import 'package:material_ui/material_ui.dart';
13+
14+
import 'semantics_tester.dart';
1715

1816
void main() {
1917
testWidgets('FlexibleSpaceBar centers title on iOS', (WidgetTester tester) async {

0 commit comments

Comments
 (0)