Skip to content

Application fully stucked when use ShaderMask on Web iPhone #128349

@Vovanella95

Description

@Vovanella95

Is there an existing issue for this?

Steps to reproduce

  1. Add ShaderMask widget to your app (or copy-paste code example)
  2. Deploy app to Web
  3. Run it in Safari iPhone (in my case iPhone 11 Pro Max iOS 16.5)

NOTE: I deployed this site to my temporary hosting https://knowledge-party.ru. You can check it out just running this site on iPhone.

Expected results

Application is not fully stucked

Actual results

Application not responding

Code sample

Code sample
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: Scaffold(
        backgroundColor: Colors.black,
        body: const ShaderMaskTest(),
        floatingActionButton: Builder(
          builder: (context) {
            return FloatingActionButton(
              onPressed: () {
                showDialog(
                  context: context,
                  builder: (_) => const Scaffold(
                    body: Center(child: Text('Dialog!')),
                  ),
                );
              },
              child: const Text('+'),
            );
          }
        ),
      ),
    );
  }
}

class ShaderMaskTest extends StatelessWidget {
  const ShaderMaskTest({super.key});

  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        ShaderMask(
          shaderCallback: (rect) {
            const gradientColor = Colors.black;

            return LinearGradient(
              begin: Alignment.topCenter,
              end: Alignment.bottomCenter,
              colors: [
                gradientColor,
                gradientColor.withOpacity(0),
              ],
              stops: const [0.51, 1.0],
            ).createShader(
              Rect.fromLTRB(
                0,
                0,
                rect.width,
                rect.height,
              ),
            );
          },
          blendMode: BlendMode.dstIn,
          child: Image.asset(
            'assets/2.png',
            fit: BoxFit.cover,
          ),
        ),
      ],
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

Android behavior: Samsung Galaxy S20
iPhone behavior: iPhone 11 Pro Max iOS 16.5

Logs

Logs
Sorry no logs :(

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.10.3, on Microsoft Windows [Version 10.0.19045.2965], locale ru-RU)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.6.2)
[√] Android Studio (version 2022.2)
[√] VS Code (version 1.78.2)
[√] Connected device (3 available)
[√] Network resources

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listbrowser: safari-iosonly manifests in Safari on iOSc: renderingUI glitches reported at the engine/skia or impeller rendering levele: web_htmlHTML rendering backend for Webengineflutter/engine related. See also e: labels.found in release: 3.10Found to occur in 3.10found in release: 3.12Found to occur in 3.12frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyplatform-webWeb applications specificallyr: solvedIssue is closed as solvedteam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions