FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
111 stars 19 forks source link

iPad code reformatter clears custom code (Custom Function, Custom Widget & Custom Action) #1511

Closed ToddHerron closed 10 months ago

ToddHerron commented 11 months ago

Has your issue been reported?

Current Behavior

When using the iPad app to edit custom code and you press the “format code” icon, all the code disappears from the editor and it only shows line numbers 1 and 2 with no code content.

Expected Behavior

Custom code should reformat.

Steps to Reproduce

  1. Using an iPad, go to custom code
  2. Select any of “New Function”, “New Widget”, or “New Action”.
  3. Press the code reformat icon.

Reproducible from Blank

Bug Report Code (Required)

https://app.flutterflow.io/project/test-project-e1hto6?tab=customCode&customCodeTab=functions

Context

Unable to edit projects on iPad.

Visual documentation

https://share.icloud.com/photos/00bjPG19kkEpp9xJJCVgpSktw

Additional Info

No response

Environment

- FlutterFlow version: 4.0
- Platform: iPad 
- Browser name and version: n/a
- Operating system and version affected: iPadOS 16.7 (20H19)
hariprasadms commented 11 months ago

Hi @ToddHerron - Thanks for posting the issue. I can reproduce the issue.

Dev note - Below is the quick video showing the issue. https://github.com/FlutterFlow/flutterflow-issues/assets/17435678/b7e6e7b3-45e2-4f56-b519-86e2ee596111

ToddHerron commented 10 months ago

Unfortunately, this still isn't working for me. Now I get "Code is improperly formatted" when I press the REFORMAT button.

To recreate:

  1. Add a Custom Function
  2. Add the line of code return "Hello World!";
  3. Press REFORMAT

Addendum: This may be limited to type string as it doesn't seem to happen with type int or double. I haven't tried other types.

Screenshot 2023-10-16 at 15 10 08

ToddHerron commented 10 months ago

It turns out that you need to turn OFF "Smart Punctuation" on an iPad so the single and double quotes remain the vertical ones (' and " are the only ones accepted by the Dart compiler) instead of the slanted ones (‘ and “).

To turn OFF Smart Punctuation:

  1. On your iPad, go to Settings > General > Keyboards
  2. Under the All Keyboards section, toggle OFF Smart Punctuation
sbis04 commented 10 months ago

Thanks @ToddHerron for confirming that works! I was trying to figure out if there's a way to fix that without turning off the "Smart Punctuation" (since a lot of people might not be able to figure out this), but haven't got anything yet. I'll update this thread if there's a solution!

sbis04 commented 10 months ago

Hey @ToddHerron, this should be fixed in the next FlutterFlow iPad app update! It should now work properly even with "Smart Punctuation" ON.

ToddHerron commented 9 months ago

Works perfectly now! Thanks! :)