Unverified Commit 310a7edb authored by auto-submit[bot]'s avatar auto-submit[bot] Committed by GitHub

Reverts "Activate InkSparkle on CanvasKit" (#143036)

Reverts flutter/flutter#138545

Initiated by: zanderso

Reason for reverting: Failing in post-submit: https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20web_long_running_tests_5_5/14975/overview

```
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞═════════════════
The following FormatException was thrown running a test:
Invalid Shader Data

When the exception was thrown, this was the stack:
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.da

Original PR Author: bleroux

Reviewed By: {Piinks}

This change reverts the following previous change:
Original Description:
## Description

This PR activates the M3 `InkSparkle` splash animation on Android + CanvasKit.
Before it `InkSparkle` was only activated on native Android.

## Related Issue

Fixes https://github.com/flutter/flutter/issues/138487

## Tests

Updates several existing tests.
parent 7f811fb4
......@@ -410,7 +410,7 @@ class ThemeData with Diagnosticable {
scrollbarTheme ??= const ScrollbarThemeData();
visualDensity ??= VisualDensity.defaultDensityForPlatform(platform);
useMaterial3 ??= true;
final bool useInkSparkle = platform == TargetPlatform.android && (!kIsWeb || isCanvasKit);
final bool useInkSparkle = platform == TargetPlatform.android && !kIsWeb;
splashFactory ??= useMaterial3
? useInkSparkle ? InkSparkle.splashFactory : InkRipple.splashFactory
: InkSplash.splashFactory;
......
......@@ -1514,7 +1514,7 @@ void main() {
matching: find.byType(InkWell),
));
if (debugDefaultTargetPlatformOverride! == TargetPlatform.android && (!kIsWeb || isCanvasKit)) {
if (debugDefaultTargetPlatformOverride! == TargetPlatform.android && !kIsWeb) {
expect(buttonInkWell.splashFactory, equals(InkSparkle.splashFactory));
} else {
expect(buttonInkWell.splashFactory, equals(InkRipple.splashFactory));
......
......@@ -1649,7 +1649,7 @@ void main() {
matching: find.byType(InkWell),
));
if (debugDefaultTargetPlatformOverride! == TargetPlatform.android && (!kIsWeb || isCanvasKit)) {
if (debugDefaultTargetPlatformOverride! == TargetPlatform.android && !kIsWeb) {
expect(buttonInkWell.splashFactory, equals(InkSparkle.splashFactory));
} else {
expect(buttonInkWell.splashFactory, equals(InkRipple.splashFactory));
......
......@@ -8,7 +8,6 @@
library;
import 'package:flutter/material.dart';
import 'package:flutter/src/foundation/capabilities.dart';
import 'package:flutter/src/foundation/constants.dart';
import 'package:flutter_test/flutter_test.dart';
......@@ -30,7 +29,7 @@ void main() {
await tester.pump();
await tester.pumpAndSettle();
},
skip: kIsWeb && !isCanvasKit, // [intended] shaders are not supported for the HTML renderer.
skip: kIsWeb, // [intended] shaders are not yet supported for web.
);
testWidgets('InkSparkle default splashFactory paints with drawRect when bounded', (WidgetTester tester) async {
......@@ -59,7 +58,7 @@ void main() {
// ink feature is disposed.
expect((material as dynamic).debugInkFeatures, isEmpty);
},
skip: kIsWeb && !isCanvasKit, // [intended] shaders are not supported for the HTML renderer.
skip: kIsWeb, // [intended] shaders are not yet supported for web.
);
testWidgets('InkSparkle default splashFactory paints with drawPaint when unbounded', (WidgetTester tester) async {
......@@ -82,7 +81,7 @@ void main() {
final MaterialInkController material = Material.of(tester.element(buttonFinder));
expect(material, paintsExactlyCountTimes(#drawPaint, 1));
},
skip: kIsWeb && !isCanvasKit, // [intended] shaders are not supported for the HTML renderer.
skip: kIsWeb, // [intended] shaders are not yet supported for web.
);
/////////////
......@@ -92,37 +91,37 @@ void main() {
testWidgets('Material2 - InkSparkle renders with sparkles when top left of button is tapped', (WidgetTester tester) async {
await _runTest(tester, 'top_left', 0.2);
},
skip: kIsWeb && !isCanvasKit, // [intended] shaders are not supported for the HTML renderer.
skip: kIsWeb, // [intended] shaders are not yet supported for web.
);
testWidgets('Material3 - InkSparkle renders with sparkles when top left of button is tapped', (WidgetTester tester) async {
await _runM3Test(tester, 'top_left', 0.2);
},
skip: kIsWeb && !isCanvasKit, // [intended] shaders are not supported for the HTML renderer.
skip: kIsWeb, // [intended] shaders are not yet supported for web.
);
testWidgets('Material2 - InkSparkle renders with sparkles when center of button is tapped', (WidgetTester tester) async {
await _runTest(tester, 'center', 0.5);
},
skip: kIsWeb && !isCanvasKit, // [intended] shaders are not supported for the HTML renderer.
skip: kIsWeb, // [intended] shaders are not yet supported for web.
);
testWidgets('Material3 - InkSparkle renders with sparkles when center of button is tapped', (WidgetTester tester) async {
await _runM3Test(tester, 'center', 0.5);
},
skip: kIsWeb && !isCanvasKit, // [intended] shaders are not supported for the HTML renderer.
skip: kIsWeb, // [intended] shaders are not yet supported for web.
);
testWidgets('Material2 - InkSparkle renders with sparkles when bottom right of button is tapped', (WidgetTester tester) async {
await _runTest(tester, 'bottom_right', 0.8);
},
skip: kIsWeb && !isCanvasKit, // [intended] shaders are not supported for the HTML renderer.
skip: kIsWeb, // [intended] shaders are not yet supported for web.
);
testWidgets('Material3 - InkSparkle renders with sparkles when bottom right of button is tapped', (WidgetTester tester) async {
await _runM3Test(tester, 'bottom_right', 0.8);
},
skip: kIsWeb && !isCanvasKit, // [intended] shaders are not supported for the HTML renderer.
skip: kIsWeb, // [intended] shaders are not yet supported for web.
);
}
......
......@@ -1691,7 +1691,7 @@ void main() {
matching: find.byType(InkWell),
));
if (debugDefaultTargetPlatformOverride! == TargetPlatform.android && (!kIsWeb || isCanvasKit)) {
if (debugDefaultTargetPlatformOverride! == TargetPlatform.android && !kIsWeb) {
expect(buttonInkWell.splashFactory, equals(InkSparkle.splashFactory));
} else {
expect(buttonInkWell.splashFactory, equals(InkRipple.splashFactory));
......
......@@ -1468,7 +1468,7 @@ void main() {
matching: find.byType(InkWell),
));
if (debugDefaultTargetPlatformOverride! == TargetPlatform.android && (!kIsWeb || isCanvasKit)) {
if (debugDefaultTargetPlatformOverride! == TargetPlatform.android && !kIsWeb) {
expect(buttonInkWell.splashFactory, equals(InkSparkle.splashFactory));
} else {
expect(buttonInkWell.splashFactory, equals(InkRipple.splashFactory));
......
......@@ -409,7 +409,7 @@ void main() {
switch (debugDefaultTargetPlatformOverride!) {
case TargetPlatform.android:
if (kIsWeb && !isCanvasKit) {
if (kIsWeb) {
expect(theme.splashFactory, equals(InkRipple.splashFactory));
} else {
expect(theme.splashFactory, equals(InkSparkle.splashFactory));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment