flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
162.21k stars 26.65k forks source link

Error: Method not found: 'GlyphInfo'. Error: 'GlyphInfo' isn't a type. #147510

Closed KaranMehta3984 closed 2 weeks ago

KaranMehta3984 commented 2 weeks ago

Steps to reproduce

move to 3.19.6

Expected results

NA

Actual results

NA

Code sample

Code sample ```dart final ui.GlyphInfo? rawGlyphInfo = cachedLayout.paragraph.getClosestGlyphInfoForOffset(offset - cachedLayout.paintOffset); ^^^^^^^^^ ../../../../Documents/Flutter_SDK/flutter_3_19_6/packages/flutter/lib/src/painting/text_painter.dart:1512:15: Error: Method not found: 'GlyphInfo'. return ui.GlyphInfo(rawGlyphInfo.graphemeClusterLayoutBounds.shift(cachedLayout.paintOffset), rawGlyphInfo.graphemeClusterCodeUnitRange, rawGlyphInfo.writingDirection); ^^^^^^^^^ ../../../../Documents/Flutter_SDK/flutter_3_19_6/packages/flutter/lib/src/painting/text_painter.dart:1508:63: Error: The method 'getClosestGlyphInfoForOffset' isn't defined for the class 'Paragraph'. - 'Paragraph' is from 'dart:ui'. Try correcting the name to the name of an existing method, or defining a method named 'getClosestGlyphInfoForOffset'. final ui.GlyphInfo? rawGlyphInfo = cachedLayout.paragraph.getClosestGlyphInfoForOffset(offset - cachedLayout.paintOffset); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ../../../../Documents/Flutter_SDK/flutter_3_19_6/packages/flutter/lib/src/semantics/semantics.dart:2787:7: Error: No named parameter with the name 'identifier'. identifier: data.identifier, ^^^^^^^^^^ ../../../../Documents/Flutter_SDK/flutter_3_19_6/packages/flutter/lib/src/rendering/paragraph.dart:736:11: Error: 'GlyphInfo' isn't a type. final GlyphInfo? glyph = _textPainter.getClosestGlyphForOffset(position); ^^^^^^^^^ ../../../../Documents/Flutter_SDK/flutter_3_19_6/packages/flutter/lib/src/rendering/editable.dart:1951:11: Error: 'GlyphInfo' isn't a type. final GlyphInfo? glyph = _textPainter.getClosestGlyphForOffset(effectivePosition); ^^^^^^^^^ ../../../../Documents/Flutter_SDK/flutter_3_19_6/packages/flutter/lib/src/services/hardware_keyboard.dart:215:9: Error: Type 'ui.KeyEventDeviceType' not found. ```

Screenshots or Video

Screenshots / Video demonstration [Upload media here]

Logs

Logs ```console [Paste your logs here] ```

Flutter Doctor output

Doctor output ```console [✓] Flutter (Channel stable, 3.19.6, on macOS 14.0 23A344 darwin-arm64, locale en-IN) [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1) [✓] Xcode - develop for iOS and macOS (Xcode 15.0) [✓] Chrome - develop for the web [✓] Android Studio (version 2023.2) [✓] VS Code (version 1.87.2) [✓] Connected device (4 available) [✓] Network resources ```
danagbemava-nc commented 2 weeks ago

Hi @KaranMehta3984, this appears to be an issue with your flutter cache. Can you try running flutter pub cache clean and re-running flutter pub get in your project to see if you still experience this issue?

Thank you

KaranMehta3984 commented 2 weeks ago

Hi @KaranMehta3984, this appears to be an issue with your flutter cache. Can you try running flutter pub cache clean and re-running flutter pub get in your project to see if you still experience this issue?

Thank you

Works fine thanks @danagbemava-nc

github-actions[bot] commented 15 hours ago

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.