Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The getter 'estimatedLineHeight' isn't defined for the class 'ProseTextLayout' #710

Closed
hillelcoren opened this issue Jul 21, 2022 · 12 comments · Fixed by #750
Closed

The getter 'estimatedLineHeight' isn't defined for the class 'ProseTextLayout' #710

hillelcoren opened this issue Jul 21, 2022 · 12 comments · Fixed by #750
Assignees

Comments

@hillelcoren
Copy link

hillelcoren commented Jul 21, 2022

When trying use the main branch of the code from GitHub we're seeing the following error when trying to build the app:

  super_editor:
    dependency: "direct main"
    description:
      path: super_editor
      ref: HEAD
      resolved-ref: "23b6a079fdb21f9f733f05862fbff024d91348fe"
      url: "https://github.com/superlistapp/super_editor.git"
    source: git
    version: "0.2.0"
../../AppData/Roaming/Pub/Cache/git/super_editor-23b6a079fdb21f9f733f05862fbff024d91348fe/super_editor/lib/src/infrastructure/super_textfield/infrastructure/text_scrollview.dart(191,87): error GD65BB2B6: The getter 'estimatedLineHeight' isn't defined for the class 'ProseTextLayout'. [C:\Users\hillel\Documents\invoiceninja_client\build\windows\flutter\flutter_assemble.vcxproj]
../../AppData/Roaming/Pub/Cache/git/super_editor-23b6a079fdb21f9f733f05862fbff024d91348fe/super_editor/lib/src/infrastructure/super_textfield/infrastructure/text_scrollview.dart(204,37): warning GBC99161D: Operand of null-aware operation '?.' has type 'TextBox' which excludes null. [C:\Users\hillel\Documents\invoiceninja_client\build\windows\flutter\flutter_assemble.vcxproj]
../../AppData/Roaming/Pub/Cache/git/super_editor-23b6a079fdb21f9f733f05862fbff024d91348fe/super_editor/lib/src/infrastructure/super_textfield/infrastructure/text_scrollview.dart(206,12): warning GBC99161D: Operand of null-aware operation '?.' has type 'TextBox' which excludes null. [C:\Users\hillel\Documents\invoiceninja_client\build\windows\flutter\flutter_assemble.vcxproj]
../../AppData/Roaming/Pub/Cache/git/super_editor-23b6a079fdb21f9f733f05862fbff024d91348fe/super_editor/lib/src/infrastructure/super_textfield/infrastructure/text_scrollview.dart(206,48): error GD65BB2B6: The getter 'estimatedLineHeight' isn't defined for the class 'ProseTextLayout'. [C:\Users\hillel\Documents\invoiceninja_client\build\windows\flutter\flutter_assemble.vcxproj]
../../AppData/Roaming/Pub/Cache/git/super_editor-23b6a079fdb21f9f733f05862fbff024d91348fe/super_editor/lib/src/infrastructure/super_textfield/infrastructure/text_scrollview.dart(251,24): warning GBC99161D: Operand of null-aware operation '?.' has type 'TextBox' which excludes null. [C:\Users\hillel\Documents\invoiceninja_client\build\windows\flutter\flutter_assemble.vcxproj]
../../AppData/Roaming/Pub/Cache/git/super_editor-23b6a079fdb21f9f733f05862fbff024d91348fe/super_editor/lib/src/infrastructure/super_textfield/infrastructure/text_scrollview.dart(251,98): error GD65BB2B6: The getter 'estimatedLineHeight' isn't defined for the class 'ProseTextLayout'. [C:\Users\hillel\Documents\invoiceninja_client\build\windows\flutter\flutter_assemble.vcxproj]
../../AppData/Roaming/Pub/Cache/git/super_editor-23b6a079fdb21f9f733f05862fbff024d91348fe/super_editor/lib/src/infrastructure/super_textfield/infrastructure/text_scrollview.dart(299,22): warning GBC99161D: Operand of null-aware operation '?.' has type 'TextBox' which excludes null. [C:\Users\hillel\Documents\invoiceninja_client\build\windows\flutter\flutter_assemble.vcxproj]
../../AppData/Roaming/Pub/Cache/git/super_editor-23b6a079fdb21f9f733f05862fbff024d91348fe/super_editor/lib/src/infrastructure/super_textfield/infrastructure/text_scrollview.dart(299,86): error GD65BB2B6: The getter 'estimatedLineHeight' isn't defined for the class 'ProseTextLayout'. [C:\Users\hillel\Documents\invoiceninja_client\build\windows\flutter\flutter_assemble.vcxproj]
../../AppData/Roaming/Pub/Cache/git/super_editor-23b6a079fdb21f9f733f05862fbff024d91348fe/super_editor/lib/src/infrastructure/super_textfield/infrastructure/text_scrollview.dart(338,71): error GD65BB2B6: The getter 'estimatedLineHeight' isn't defined for the class 'ProseTextLayout'. [C:\Users\hillel\Documents\invoiceninja_client\build\windows\flutter\flutter_assemble.vcxproj]
../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/flutter_slidable-1.2.0/lib/src/auto_close_behavior.dart(391,24): warning GBC99161D: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null. [C:\Users\hillel\Documents\invoiceninja_client\build\windows\flutter\flutter_assemble.vcxproj]
../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/cached_network_image-3.0.0/lib/src/image_provider/_image_provider_io.dart(128,25): warning GBC99161D: Operand of null-aware operation '?.' has type 'PaintingBinding' which excludes null. [C:\Users\hillel\Documents\invoiceninja_client\build\windows\flutter\flutter_assemble.vcxproj]
../../AppData/Roaming/Pub/Cache/git/super_editor-23b6a079fdb21f9f733f05862fbff024d91348fe/super_editor/lib/src/infrastructure/super_textfield/android/_editing_controls.dart(357,41): warning GBC99161D: Operand of null-aware operation '?.' has type 'TextBox' which excludes null. [C:\Users\hillel\Documents\invoiceninja_client\build\windows\flutter\flutter_assemble.vcxproj]
../../AppData/Roaming/Pub/Cache/git/super_editor-23b6a079fdb21f9f733f05862fbff024d91348fe/super_editor/lib/src/infrastructure/super_textfield/android/_editing_controls.dart(357,98): error GD65BB2B6: The getter 'estimatedLineHeight' isn't defined for the class 'ProseTextLayout'. [C:\Users\hillel\Documents\invoiceninja_client\build\windows\flutter\flutter_assemble.vcxproj]
../../AppData/Roaming/Pub/Cache/git/super_editor-23b6a079fdb21f9f733f05862fbff024d91348fe/super_editor/lib/src/infrastructure/super_textfield/android/_editing_controls.dart(519,21): warning GBC99161D: Operand of null-aware operation '?.' has type 'TextBox' which excludes null. [C:\Users\hillel\Documents\invoiceninja_client\build\windows\flutter\flutter_assemble.vcxproj]
../../AppData/Roaming/Pub/Cache/git/super_editor-23b6a079fdb21f9f733f05862fbff024d91348fe/super_editor/lib/src/infrastructure/super_textfield/android/_editing_controls.dart(519,89): error GD65BB2B6: The getter 'estimatedLineHeight' isn't defined for the class 'ProseTextLayout'. [C:\Users\hillel\Documents\invoiceninja_client\build\windows\flutter\flutter_assemble.vcxproj]
../../AppData/Roaming/Pub/Cache/git/super_editor-23b6a079fdb21f9f733f05862fbff024d91348fe/super_editor/lib/src/infrastructure/super_textfield/android/_editing_controls.dart(563,21): warning GBC99161D: Operand of null-aware operation '?.' has type 'TextBox' which excludes null. [C:\Users\hillel\Documents\invoiceninja_client\build\windows\flutter\flutter_assemble.vcxproj]
../../AppData/Roaming/Pub/Cache/git/super_editor-23b6a079fdb21f9f733f05862fbff024d91348fe/super_editor/lib/src/infrastructure/super_textfield/android/_editing_controls.dart(563,91): error GD65BB2B6: The getter 'estimatedLineHeight' isn't defined for the class 'ProseTextLayout'. [C:\Users\hillel\Documents\invoiceninja_client\build\windows\flutter\flutter_assemble.vcxproj]
../../AppData/Roaming/Pub/Cache/git/super_editor-23b6a079fdb21f9f733f05862fbff024d91348fe/super_editor/lib/src/infrastructure/super_textfield/android/_editing_controls.dart(570,21): warning GBC99161D: Operand of null-aware operation '?.' has type 'TextBox' which excludes null. [C:\Users\hillel\Documents\invoiceninja_client\build\windows\flutter\flutter_assemble.vcxproj]
../../AppData/Roaming/Pub/Cache/git/super_editor-23b6a079fdb21f9f733f05862fbff024d91348fe/super_editor/lib/src/infrastructure/super_textfield/android/_editing_controls.dart(570,93): error GD65BB2B6: The getter 'estimatedLineHeight' isn't defined for the class 'ProseTextLayout'. [C:\Users\hillel\Documents\invoiceninja_client\build\windows\flutter\flutter_assemble.vcxproj]
../../AppData/Roaming/Pub/Cache/git/super_editor-23b6a079fdb21f9f733f05862fbff024d91348fe/super_editor/lib/src/infrastructure/super_textfield/android/_user_interaction.dart(460,21): warning GBC99161D: Operand of null-aware operation '?.' has type 'TextBox' which excludes null. [C:\Users\hillel\Documents\invoiceninja_client\build\windows\flutter\flutter_assemble.vcxproj]
../../AppData/Roaming/Pub/Cache/git/super_editor-23b6a079fdb21f9f733f05862fbff024d91348fe/super_editor/lib/src/infrastructure/super_textfield/android/_user_interaction.dart(460,85): error GD65BB2B6: The getter 'estimatedLineHeight' isn't defined for the class 'ProseTextLayout'. [C:\Users\hillel\Documents\invoiceninja_client\build\windows\flutter\flutter_assemble.vcxproj]
../../AppData/Roaming/Pub/Cache/git/super_editor-23b6a079fdb21f9f733f05862fbff024d91348fe/super_editor/lib/src/infrastructure/super_textfield/ios/_editing_controls.dart(418,21): warning GBC99161D: Operand of null-aware operation '?.' has type 'TextBox' which excludes null. [C:\Users\hillel\Documents\invoiceninja_client\build\windows\flutter\flutter_assemble.vcxproj]
../../AppData/Roaming/Pub/Cache/git/super_editor-23b6a079fdb21f9f733f05862fbff024d91348fe/super_editor/lib/src/infrastructure/super_textfield/ios/_editing_controls.dart(418,91): error GD65BB2B6: The getter 'estimatedLineHeight' isn't defined for the class 'ProseTextLayout'. [C:\Users\hillel\Documents\invoiceninja_client\build\windows\flutter\flutter_assemble.vcxproj]
../../AppData/Roaming/Pub/Cache/git/super_editor-23b6a079fdb21f9f733f05862fbff024d91348fe/super_editor/lib/src/infrastructure/super_textfield/ios/_editing_controls.dart(425,21): warning GBC99161D: Operand of null-aware operation '?.' has type 'TextBox' which excludes null. [C:\Users\hillel\Documents\invoiceninja_client\build\windows\flutter\flutter_assemble.vcxproj]
../../AppData/Roaming/Pub/Cache/git/super_editor-23b6a079fdb21f9f733f05862fbff024d91348fe/super_editor/lib/src/infrastructure/super_textfield/ios/_editing_controls.dart(425,93): error GD65BB2B6: The getter 'estimatedLineHeight' isn't defined for the class 'ProseTextLayout'. [C:\Users\hillel\Documents\invoiceninja_client\build\windows\flutter\flutter_assemble.vcxproj]
../../AppData/Roaming/Pub/Cache/git/super_editor-23b6a079fdb21f9f733f05862fbff024d91348fe/super_editor/lib/src/infrastructure/super_textfield/ios/_caret.dart(125,37): warning GBC99161D: Operand of null-aware operation '?.' has type 'TextBox' which excludes null. [C:\Users\hillel\Documents\invoiceninja_client\build\windows\flutter\flutter_assemble.vcxproj]
Exception: Build process failed.
Exited (sigterm)

Note: if I change to the typing-fade-prototype branch the error goes away.

Thanks for your help, let me know if you need any more details.

@angelosilvestre
Copy link
Collaborator

@matthew-carroll This getter was added in #616

SuperEditor is picking version 0.1.0 from pub.dev.

I think the only is missing is to publish a new version of super_text_layout to include the new getter.

@matthew-carroll
Copy link
Contributor

@angelosilvestre please check the original post. A specific commit hash is used in the pubspec, and according to the poster, that's a recent hash and it's causing the given failure.

@angelosilvestre
Copy link
Collaborator

The commit hash only applies to SuperEditor. In SuperEditor's pubspec the dependency on super_text_layout is:

super_text_layout: ^0.1.0

This version was published before estimatedLineHeight was added.

I think we need to publish a new version of super_text_layout and then update SuperEditor's pubspec to use the new version.

@matthew-carroll
Copy link
Contributor

Ok. Thanks. I'll do that sometime soon.

@matthew-carroll
Copy link
Contributor

I just released new versions for super_text_layout and attributed_text on pub. I also updated the version for super_editor_markdown on GitHub.

@hillelcoren please let me know if you're now able to compile and run your project.

@hillelcoren
Copy link
Author

I'm able to build our app now but I've noticed a different problem, when serializing/deserializing markdown it looks like the package isn't correctly handling double line breaks, ie.

Line 1

Line 2

Becomes

Line 1
Line 2

@matthew-carroll
Copy link
Contributor

What document structure are you serializing in this example? Are you serializing a single ParagraphNode or two ParagraphNodes?

@hillelcoren
Copy link
Author

Here's the basic usage, input should equal output.

final String input = 'Line1\n\nLine2';
final String output = serializeDocumentToMarkdown(deserializeMarkdownToDocument(input));

@matthew-carroll
Copy link
Contributor

Can you try compiling against this PR and see if it fixes the issue? This PR includes some serialization changes: #704

You may need to explicitly depend on that PR for super_editor_markdown, too.

@hillelcoren
Copy link
Author

I believe the problem is still there. Are you able to try this code, if you also see the problem this could make a good unit test.

  final String input = 'Line1\n\nLine2';
  final String output =
      serializeDocumentToMarkdown(deserializeMarkdownToDocument(input));
  log('## INPUT:\n$input');
  log('## OUPUT:\n$output');
[log] ## INPUT:
      Line1
      
      Line2
[log] ## OUPUT:
      Line1
      Line2

@matthew-carroll
Copy link
Contributor

@hillelcoren - are you sure that was ever working? I've dug into it a little bit, and it looks like the Markdown parsing package, itself, gets rid of empty lines.

Here's the code that I believe is running within the markdown parser: https://github.com/dart-lang/markdown/blob/master/lib/src/block_syntaxes/empty_block_syntax.dart#L21

@hillelcoren
Copy link
Author

I'm pretty sure this used to work correctly, once I upgraded the package it was immediately apparent that this had changed.

Our app has an editor window and preview window, making any change now breaks the underlying markdown due to this issue.

I've tried to use an older version of the package to test it but haven't been able to get the app to run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants