diff --git a/packages/flutter/lib/src/material/material.dart b/packages/flutter/lib/src/material/material.dart index 78f3a95e24..a81e22609e 100644 --- a/packages/flutter/lib/src/material/material.dart +++ b/packages/flutter/lib/src/material/material.dart @@ -246,6 +246,7 @@ class _MaterialState extends State { contents = new NotificationListener( onNotification: (LayoutChangedNotification notification) { _inkFeatureRenderer.currentContext.findRenderObject().markNeedsPaint(); + return true; }, child: new _InkFeatures( key: _inkFeatureRenderer, @@ -320,7 +321,7 @@ class _RenderInkFeatures extends RenderProxyBox implements MaterialInkController clipCallback = rectCallback; } else { size = referenceBox.size; - clipCallback = () => Point.origin & size; + clipCallback = () => Point.origin & referenceBox.size; } radius = _getSplashTargetSize(size, position); } else { diff --git a/packages/flutter/test/material/material_test.dart b/packages/flutter/test/material/material_test.dart new file mode 100644 index 0000000000..2633a5e5b2 --- /dev/null +++ b/packages/flutter/test/material/material_test.dart @@ -0,0 +1,24 @@ +// Copyright 2016 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/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +class NotifyMaterial extends StatelessWidget { + @override + Widget build(BuildContext context) { + new LayoutChangedNotification().dispatch(context); + return new Container(); + } +} + +void main() { + testWidgets('LayoutChangedNotificaion test', (WidgetTester tester) async { + await tester.pumpWidget( + new Material( + child: new NotifyMaterial() + ) + ); + }); +}