Skip to content

Commit

Permalink
Revert "fix paint order of ink feature (flutter#59108)" (flutter#60530)
Browse files Browse the repository at this point in the history
This reverts commit 1e843bb.
  • Loading branch information
chunhtai authored Jun 29, 2020
1 parent ed05fd7 commit 163a09a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 49 deletions.
7 changes: 1 addition & 6 deletions packages/flutter/lib/src/material/app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -684,12 +684,7 @@ class _AppBarState extends State<AppBar> {
fit: StackFit.passthrough,
children: <Widget>[
widget.flexibleSpace,
// Creates a material widget to prevent the flexibleSpace from swallow
// the ink splash effect.
Material(
type: MaterialType.transparency,
child: appBar,
),
appBar,
],
);
}
Expand Down
43 changes: 0 additions & 43 deletions packages/flutter/test/material/app_bar_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';

import '../rendering/mock_canvas.dart';
import '../widgets/semantics_tester.dart';

Widget buildSliverAppBarApp({
Expand Down Expand Up @@ -1104,48 +1103,6 @@ void main() {
expect(find.byIcon(Icons.menu), findsNothing);
});

testWidgets('AppBar ink splash draw on the correct canvas', (WidgetTester tester) async {
// This is a regression test for https://github.com/flutter/flutter/issues/58665
final Key key = UniqueKey();
await tester.pumpWidget(
MaterialApp(
home: Center(
child: AppBar(
title: const Text('Abc'),
actions: <Widget>[
IconButton(
key: key,
icon: const Icon(Icons.add_circle),
tooltip: 'First button',
onPressed: () {},
),
],
flexibleSpace: DecoratedBox(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: const Alignment(0.0, -1.0),
end: const Alignment(-0.04, 1.0),
colors: <Color>[Colors.blue.shade500, Colors.blue.shade800],
),
),
),
),
),
),
);
final RenderObject painter = tester.renderObject(
find.descendant(
of: find.descendant(
of: find.byType(AppBar),
matching: find.byType(Stack),
),
matching: find.byType(Material)
)
);
await tester.tap(find.byKey(key));
expect(painter, paints..save()..translate()..save()..translate()..circle(x: 24.0, y: 28.0));
});

testWidgets('AppBar handles loose children 0', (WidgetTester tester) async {
final GlobalKey key = GlobalKey();
await tester.pumpWidget(
Expand Down

0 comments on commit 163a09a

Please sign in to comment.