Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[web][canvaskit] Scrollable emoji freezes the app  #79882

@lukepighetti

Description

@lukepighetti

We've run into an issue where if you place emojis in a grid on Web (CanvasKit renderer) and scroll the whole app will lock up.

Progress indicator is only to demonstrate when frames are being dropped by the app.

420p3.mov

Flutter doctor

% flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel dev, 2.1.0-12.1.pre, on macOS 11.2.3 20D91 darwin-x64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.55.0)
[✓] Connected device (2 available)

• No issues found!

MCVE

name: spike_emoji_grid
description: A new Flutter project.

publish_to: "none"

version: 1.0.0+1

environment:
  sdk: ">=2.10.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^1.0.2
  emojis: ^0.9.3

dev_dependencies:
  flutter_test:
    sdk: flutter

flutter:
  uses-material-design: true
import 'dart:ui';

import 'package:emojis/emoji.dart';

import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  final emojis = Emoji.all();

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Emoji CanvasKit Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
        body: Center(
          child: Container(
            height: 400,
            width: 400,
            color: Colors.red.shade100,
            child: Scrollbar(
              child: GridView.builder(
                itemCount: emojis.length,
                gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
                  crossAxisCount: 8,
                  mainAxisSpacing: 8,
                  crossAxisSpacing: 8,
                ),
                itemBuilder: (context, index) {
                  return Text(
                    emojis[index % emojis.length].char,
                    style: TextStyle(fontSize: 20),
                  );
                },
              ),
            ),
          ),
        ),
      ),
    );
  }
}

Metadata

Metadata

Labels

P1High-priority issues at the top of the work listc: performanceRelates to speed or footprint issues (see "perf:" labels)customer: crowdAffects or could affect many people, though not necessarily a specific customer.e: web_canvaskitCanvasKit (a.k.a. Skia-on-WebGL) rendering backend for Webengineflutter/engine related. See also e: labels.found in release: 2.0Found to occur in 2.0found in release: 2.1Found to occur in 2.1has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyr: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions