Skip to content

Application freezes completely when rapidly switching between multiple QuillEditors #2324

Open
@bmmshayan

Description

@bmmshayan

Is there an existing issue for this?

Flutter Quill version

10.8.4

Steps to reproduce

  1. Create a ListView with multiple QuillEditor instances.
  2. Rapidly switch focus between these editors, particularly during typing. The issue occurs intermittently, often at the moment of typing.

Expected results

The application should handle rapid focus switches smoothly without freezing, and it should not affect the responsiveness of the system keyboard.

Actual results

The application completely freezes when rapidly switching between QuillEditor instances, requiring a force close of the app. Furthermore, the system keyboard remains unresponsive for about a minute after the application is closed, affecting the usability of other apps.

Additional Context

Minimal Reproducible Code
import 'package:flutter/material.dart';
import 'package:flutter_quill/flutter_quill.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(home: MyHomePage());
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  late List<QuillController> _controllers;

  @override
  void initState() {
    super.initState();

    _controllers = List.generate(5, (_) => QuillController.basic());
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: ListView.builder(
        itemCount: _controllers.length,
        itemBuilder: (context, index) {
          return Padding(
            padding: const EdgeInsets.all(8.0),
            child: QuillEditor.basic(
              controller: _controllers[index],
              scrollController: ScrollController(),
              configurations: const QuillEditorConfigurations(
                placeholder: 'Enter text here...',
                padding: EdgeInsets.symmetric(vertical: 4),
              ),
            ),
          );
        },
      ),
    );
  }
}
Logs
D/InputMethodManagerUtils(32218): startInputInner - Id : 0
I/InputMethodManager(32218): startInputInner - IInputMethodManagerGlobalInvoker.startInputOrWindowGainedFocus
I/InputMethodManager_LC(32218): showSoftInput(View,I)
I/ImeTracker(32218): com.testquill.untitled:4b572492: onRequestShow at ORIGIN_CLIENT_SHOW_SOFT_INPUT reason SHOW_SOFT_INPUT
I/InputMethodManager_LC(32218): ssi(): flags=0 view=com.testquill.untitled reason = SHOW_SOFT_INPUT
I/InputMethodManager_LC(32218): ssi() view is not EditText
D/InputMethodManager(32218): showSoftInput() view=io.flutter.embedding.android.FlutterView{4ba62a6 VFE...... .F...... 0,0-1080,2273 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InputMethodManagerUtils(32218): startInputInner - Id : 0
I/InputMethodManager(32218): startInputInner - IInputMethodManagerGlobalInvoker.startInputOrWindowGainedFocus
I/InputMethodManager_LC(32218): showSoftInput(View,I)
I/ImeTracker(32218): com.testquill.untitled:4a13bf1e: onRequestShow at ORIGIN_CLIENT_SHOW_SOFT_INPUT reason SHOW_SOFT_INPUT
I/InputMethodManager_LC(32218): ssi(): flags=0 view=com.testquill.untitled reason = SHOW_SOFT_INPUT
I/InputMethodManager_LC(32218): ssi() view is not EditText
D/InputMethodManager(32218): showSoftInput() view=io.flutter.embedding.android.FlutterView{4ba62a6 VFE...... .F...... 0,0-1080,2273 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InputMethodManagerUtils(32218): startInputInner - Id : 0
I/InputMethodManager(32218): startInputInner - IInputMethodManagerGlobalInvoker.startInputOrWindowGainedFocus
I/InputMethodManager_LC(32218): showSoftInput(View,I)
I/ImeTracker(32218): com.testquill.untitled:27660ef0: onRequestShow at ORIGIN_CLIENT_SHOW_SOFT_INPUT reason SHOW_SOFT_INPUT
I/InputMethodManager_LC(32218): ssi(): flags=0 view=com.testquill.untitled reason = SHOW_SOFT_INPUT
I/InputMethodManager_LC(32218): ssi() view is not EditText
D/InputMethodManager(32218): showSoftInput() view=io.flutter.embedding.android.FlutterView{4ba62a6 VFE...... .F...... 0,0-1080,2273 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
... infinity ...
Flutter doctor
[√] Flutter (Channel stable, 3.24.3, on Microsoft Windows [Version 10.0.22631.4317], locale ru-UA)
    • Flutter version 3.24.3 on channel stable at C:\Flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2663184aa7 (5 weeks ago), 2024-09-11 16:27:48 -0500
    • Engine revision 36335019a8
    • Dart version 3.5.3
    • DevTools version 2.37.3

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\MainUser\AppData\Local\Android\sdk
    • Platform android-35, build-tools 34.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.11+0--11852314)
    • All Android licenses accepted.

[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.9.3)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.9.34701.34
    • Windows 10 SDK version 10.0.22621.0

[√] Android Studio (version 2024.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.11+0--11852314)

[√] VS Code (version 1.92.1)
    • VS Code at C:\Users\MainUser\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension can be installed from:
       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (2 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22631.4317]
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 129.0.2792.89

[√] Network resources
    • All expected network resources are available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions