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

Open URLs to launch browser - support across desktop and mobile? #2342

Open
1 task done
jaibyron opened this issue Oct 30, 2024 · 9 comments
Open
1 task done

Open URLs to launch browser - support across desktop and mobile? #2342

jaibyron opened this issue Oct 30, 2024 · 9 comments
Labels
question Further information is requested

Comments

@jaibyron
Copy link

jaibyron commented Oct 30, 2024

Is there an existing issue for this?

The question

I'm testing how URLs launch on different platforms at the moment and finding that clicking on URLs in the editor launches a URL (in another tab) if I run on Chrome but I get no response when I click on the URL for iOS or Android. Am I missing something obvious?

(I'm running v8.6.4 btw)


Widget _noteView() {
    return Container(
      height: screenHeight,
      width: MediaQuery.sizeOf(context).width * 2 / 3,
      color: Colors.white,
      child: QuillProvider(
        configurations: QuillConfigurations(
          controller: _controller,
          sharedConfigurations: const QuillSharedConfigurations(
            locale: Locale('en'),
          ),
        ),
        child: Column(
          children: [
            const QuillToolbar(),
            Expanded(
              child: QuillEditor.basic(
                configurations: QuillEditorConfigurations(
                  readOnly: false,
                  customStyles: const DefaultStyles(
                    link: TextStyle(
                        color: Colors.blue,
                        fontWeight: FontWeight.bold,
                        decoration: TextDecoration.underline,
                        decorationColor: Colors.blue),
                  ),
                  onLaunchUrl: (value) async {
                    debugPrint('You clicked on $value');
                    final Uri url = Uri.parse(value);
                    await launchUrl(url);
                  },
                ),
              ),
            )
          ],
        ),
      ),
    );
  }
@jaibyron jaibyron added the question Further information is requested label Oct 30, 2024
@EchoEllet
Copy link
Collaborator

(I'm running v8.6.4 btw)

Are there any blockers that prevent migrating to a newer version?

Am I missing something obvious?

We do use theurl_launcher plugin. Can you update the dependencies (including transitive ones) to their latest version and try again?

@jaibyron
Copy link
Author

(I'm running v8.6.4 btw)

Are there any blockers that prevent migrating to a newer version?

Am I missing something obvious?

We do use theurl_launcher plugin. Can you update the dependencies (including transitive ones) to their latest version and try again?

Still get the same issue.

Updated to version 9.3.11 (I'm constrained by Flutter version at the moment - 3.19.5 )

url_launcher is v6.3.1 which I think is the latest

@EchoEllet
Copy link
Collaborator

EchoEllet commented Oct 31, 2024

Can you share a video showing the issue on Android or iOS? Did you encounter this issue on the web?

Updated to version 9.3.11 (I'm constrained by Flutter version at the moment - 3.19.5 )

The pubspec.yaml constraints of flutter_quill support Flutter 3.19.5.

What is the blocker when using Flutter Quill 10.8.5 and Flutter 3.19.5?

@jaibyron
Copy link
Author

jaibyron commented Oct 31, 2024

Can you share a video showing the issue on Android or iOS? Did you encounter this issue on the web?

There is no issue on the web (as mentioned in the original post) - it just fails for iOS or Android mobile.

Updated to version 9.3.11 (I'm constrained by Flutter version at the moment - 3.19.5 )

The pubspec.yaml constraints of flutter_quill support Flutter 3.19.5.

What is the blocker when using Flutter Quill 10.8.5 and Flutter 3.19.5?

If I use Flutter Quill 10.8.5 with Flutter 3.19.5 then flutter pub get fails as below:

Resolving dependencies... 
Because flutter_quill >=9.3.12 depends on intl ^0.19.0 and su depends on intl 0.18.1, flutter_quill >=9.3.12 is forbidden.
So, because su depends on flutter_quill 10.8.5, version solving failed.


You can try the following suggestion to make the pubspec resolve:
* Consider downgrading your constraint on flutter_quill: flutter pub add flutter_quill:^9.3.11

If I try updating my intl package to 0.19.0 then I see:

Resolving dependencies...
The current Dart SDK version is 3.3.3.

Because flutter_quill >=10.6.1 depends on flutter_quill_delta_from_html >=1.1.5 which requires SDK version >=3.4.3 <4.0.0, flutter_quill >=10.6.1 is forbidden.
So, because su depends on flutter_quill 10.8.5, version solving failed.


You can try the following suggestion to make the pubspec resolve:
* Consider downgrading your constraint on flutter_quill: flutter pub add flutter_quill:^2.0.7
exit code 1


iPad Recording

Simulator.Screen.Recording.-.iPad.Air.5th.generation.-.2024-10-31.at.15.40.26.mp4

Web Recording

Screen.Recording.2024-10-31.at.15.43.41.mov

Any ideas?

@EchoEllet
Copy link
Collaborator

EchoEllet commented Oct 31, 2024

Any ideas?

It's solvable. We need to lower the version constraints in pubspec.yaml to a compatible one since we don't need any specific features in 0.19.0.

As for the flutter_quill_delta_from_html, we only need to update the pubspec.yaml constraints.

I will fix this issue soon.

@EchoEllet
Copy link
Collaborator

(I'm constrained by Flutter version at the moment - 3.19.5 )

You should be able to use the latest version now, though the issue was only fixed in the pre-release (see #2338). It will become stable once we do more tests.

@jaibyron
Copy link
Author

jaibyron commented Nov 4, 2024

(I'm constrained by Flutter version at the moment - 3.19.5 )

You should be able to use the latest version now, though the issue was only fixed in the pre-release (see #2338). It will become stable once we do more tests.

thanks for the update but could do with some help to test the pre-release

I deleted my pubspec.lock

In my pubspec.yaml I have:

dependencies:

  intl: 0.18.1
  flutter_quill: 10.8.5
  
dependency_overrides:
  flutter_quill:
    git:
      url: https://github.com/singerdmx/flutter-quill.git
      ref: release/v11
  flutter_quill_extensions:
    git:
      url: https://github.com/singerdmx/flutter-quill.git
      ref: release/v11
      path: flutter_quill_extensions

But running flutter pub get seems to indicate the flutter-quill.git still depends on intl 0.19.0? as I get the following output:

Because every version of flutter_quill from git depends on intl ^0.19.0 and su depends on intl 0.18.1, flutter_quill from git is forbidden.
So, because su depends on flutter_quill from git, version solving failed.

@EchoEllet
Copy link
Collaborator

EchoEllet commented Nov 4, 2024

I was unable to use a version other than 0.19.0 of intl to avoid CI failure.

Use the latest version from the release/v11 branch. The changes that fix this issue are not published as pre-release yet.

# TODO: Remove once https://github.com/singerdmx/flutter-quill/pull/2338 is published
dependency_overrides:
  flutter_quill:
    git:
      url: https://github.com/singerdmx/flutter-quill.git
      ref: release/v11
  flutter_quill_extensions:
    git:
      url: https://github.com/singerdmx/flutter-quill.git
      ref: release/v11
      path: flutter_quill_extensions

Refer to the migration guide to migrate from 10.0.0 to 11.0.0.

  • flutter pub upgrade to update the dependencies to their latest version.
  • Try to force usage of the latest intl dependency:
dependency_overrides:
  intl: ^0.19.0

Ensure that the dependencies dart_quill_delta and flutter_quill_delta_from_html use their latest versions (10.8.2 and 1.4.2 at the time) since the constraints has been improved in those versions.

After following all those steps, if you're still facing this issue, share the pubspec.lock file, and the error.

@jaibyron
Copy link
Author

jaibyron commented Nov 7, 2024

@EchoEllet - thanks for the feedback.

FYI:
I tried with flutter_quill: 10.8.5 and installed the latest stable flutter SDK - Flutter - 3.24.4. and the issue with URLs not opening on mobile also seems to be with this version. URLs open from flutter web just fine though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants