Skip to content

Crash when inputting devanagari halant #110343

Closed

Description

@cloudonlanapps

The TextField Widget create assertion when keying in halant character using Hindi/Devanagari-QWERTY keyboard.

The code has a single TextField.
This problem occurs on any TextField irrespective of setting the controller or not. also tried various combinations for controller settings for composition. Is this a bug or we need to add any additional parameters to make it working or any workaround?

Attached screen shot and also the main.dart file.

Screenshot 2022-08-26 at 7 48 30 PM

main.dart

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: 'TextField Devnagari keyboard',
      home: Scaffold(
        appBar: AppBar(
          title: const Text('TextField Devnagari keyboard'),
        ),
        body: const TextFieldWidget(),
      ),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Center(
        child: Column(
      mainAxisSize: MainAxisSize.min,
      children: const <Widget>[
        Padding(
          padding: EdgeInsets.all(8),
          child: TextField(
            decoration: InputDecoration(
                border: OutlineInputBorder(), hintText: 'EnterText'),
          ),
        ),
      ],
    ));
  }
}

Activity

  1. cloudonlanapps commented on Aug 26, 2022

    @cloudonlanapps
    Author

    System configurations:
    Flutter (Channel stable, 3.0.5, on macOS 12.5.1 21G83 darwin-x64, locale en-GB)
    macOS Monterey 12.5.1 (21G83)

  2. changed the title [-]Problem with keyboard input for devanagari halant[/-] [+][macOS] Crash when inputting devanagari halant[/+] on Aug 29, 2022
  3. changed the title [-][macOS] Crash when inputting devanagari halant[/-] [+]Crash when inputting devanagari halant[/+] on Aug 29, 2022
  4. danagbemava-nc commented on Aug 29, 2022

    @danagbemava-nc
    Member

    Issue is reproducible using the code sample provided above. I was able to reproduce this on both chrome and macOS.

    Steps to repro (copied from the image above)

    • Setup the devanagari input mode
    • Run the code sample provided
    • Type d followed by f to display द्
    • Observe a crash in the console
    exception

    macOS

    ════════ Exception caught by scheduler library ═════════════════════════════════
    The following assertion was thrown during a scheduler callback:
    'package:flutter/src/widgets/editable_text.dart': Failed assertion: line 3211 pos 16: '!composingRange.isValid || composingRange.isCollapsed': is not true.
    package:flutter/…/widgets/editable_text.dart:3211
    2
    
    Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
    In either case, please report this assertion by filing a bug on GitHub:
      https://github.com/flutter/flutter/issues/new?template=2_bug.md
    
    When the exception was thrown, this was the stack
    #2      EditableTextState._updateComposingRectIfNeeded
    package:flutter/…/widgets/editable_text.dart:3211
    #3      EditableTextState._updateComposingRectIfNeeded.<anonymous closure>
    package:flutter/…/widgets/editable_text.dart:3217
    #4      SchedulerBinding._invokeFrameCallback
    package:flutter/…/scheduler/binding.dart:1175
    #5      SchedulerBinding.handleDrawFrame
    package:flutter/…/scheduler/binding.dart:1113
    #6      SchedulerBinding._handleDrawFrame
    package:flutter/…/scheduler/binding.dart:1015
    #7      _invoke (dart:ui/hooks.dart:145:13)
    #8      PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:320:5)
    

    chrome

    ══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞═════════════════════════════════════════════════════════
    The following assertion was thrown during a scheduler callback:
    Assertion failed:
    file:///Users/nexus/dev/sdks/flutters/packages/flutter/lib/src/widgets/editable_text.dart:3211:16
    ../…/widgets/editable_text.dart:3211
    !composingRange.isValid || composingRange.isCollapsed
    is not true
    When the exception was thrown, this was the stack:
    dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 266:49      throw_
    dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 29:3        assertFailed
    packages/flutter/src/widgets/editable_text.dart 3211:57                           [_updateComposingRectIfNeeded]
    packages/flutter/src/widgets/editable_text.dart 3217:70                           <fn>
    packages/flutter/src/scheduler/binding.dart 1175:15                               [_invokeFrameCallback]
    packages/flutter/src/scheduler/binding.dart 1113:9                                handleDrawFrame
    packages/flutter/src/scheduler/binding.dart 1015:5                                [_handleDrawFrame]
    lib/_engine/engine/platform_dispatcher.dart 1145:13                               invoke
    lib/_engine/engine/platform_dispatcher.dart 218:5                                 invokeOnDrawFrame
    lib/_engine/engine/initialization.dart 186:45                                     <fn>
    dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 352:37  _checkAndCall
    dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 357:39  dcall
    ════════════════════════════════════════════════════════════════════════════════════════════════════
    
    flutter doctor -v
    [✓] Flutter (Channel stable, 3.0.5, on macOS 12.5 21G72 darwin-arm, locale en-GB)
        • Flutter version 3.0.5 at /Users/nexus/dev/sdks/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision f1875d570e (7 weeks ago), 2022-07-13 11:24:16 -0700
        • Engine revision e85ea0e79c
        • Dart version 2.17.6
        • DevTools version 2.12.2
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
        • Android SDK at /Users/nexus/Library/Android/sdk
        • Platform android-33, build-tools 33.0.0
        • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • CocoaPods version 1.11.3
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2021.2)
        • Android Studio at /Applications/Android Studio.app/Contents
        • 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 11.0.12+0-b1504.28-7817840)
    
    [✓] VS Code (version 1.70.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.46.0
    
    [✓] Connected device (2 available)
        • macOS (desktop) • macos  • darwin-arm64   • macOS 12.5 21G72 darwin-arm
        • Chrome (web)    • chrome • web-javascript • Google Chrome 104.0.5112.101
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    • No issues found!
    
    [✓] Flutter (Channel master, 3.1.0-0.0.pre.2552, on macOS 12.5 21G72 darwin-arm, locale en-GB)
        • Flutter version 3.1.0-0.0.pre.2552 on channel master at /Users/nexus/dev/sdks/flutters
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision f66a097919 (7 hours ago), 2022-08-28 20:20:36 -0400
        • Engine revision 4e36ebc1f3
        • Dart version 2.19.0 (build 2.19.0-146.0.dev)
        • DevTools version 2.16.0
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
        • Android SDK at /Users/nexus/Library/Android/sdk
        • Platform android-33, build-tools 33.0.0
        • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 13F100
        • CocoaPods version 1.11.3
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2021.2)
        • Android Studio at /Applications/Android Studio.app/Contents
        • 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 11.0.12+0-b1504.28-7817840)
    
    [✓] VS Code (version 1.70.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.46.0
    
    [✓] Connected device (2 available)
        • macOS (desktop) • macos  • darwin-arm64   • macOS 12.5 21G72 darwin-arm
        • Chrome (web)    • chrome • web-javascript • Google Chrome 104.0.5112.101
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    • No issues found!
    

    chrome.log
    macos.log

  5. added
    a: text inputEntering text in a text field or keyboard related problems
    c: crashStack traces logged to the console
    engineflutter/engine related. See also e: labels.
    platform-macosBuilding on or for macOS specifically
    a: internationalizationSupporting other languages or locales. (aka i18n)
    platform-webWeb applications specifically
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    and removed
    in triagePresently being triaged by the triage team
    on Aug 29, 2022
  6. 16 remaining items

  7. flutter-triage-bot commented on Feb 23, 2024

    @flutter-triage-bot

    This issue is assigned to @LongCatIsLooong but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!

  8. flutter-triage-bot commented on May 11, 2024

    @flutter-triage-bot

    This issue was assigned to @LongCatIsLooong but has had no status updates in a long time. To remove any ambiguity about whether the issue is being worked on, the assignee was removed.

  9. removed
    ⏳Bot is counting down the days until it unassigns the issue
    on May 11, 2024
  10. justinmc commented on May 17, 2024

    @justinmc
    Contributor

    Talking with @LongCatIsLooong in triage, we think we might be able to just remove the assert, since in devanagari it is apparently valid to have a grapheme partially in a composing region.

  11. github-actions commented on Jun 5, 2024

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  12. locked as resolved and limited conversation to collaborators on Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P2Important issues not at the top of the work lista: internationalizationSupporting other languages or locales. (aka i18n)a: text inputEntering text in a text field or keyboard related problemsc: crashStack traces logged to the consoledependency: skiaSkia team may need to help usfound in release: 3.0Found to occur in 3.0found in release: 3.1Found to occur in 3.1frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-text-inputOwned by Text Input teamtriaged-text-inputTriaged by Text Input team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions