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

Sys - Upgrade to latest Flutter/Dart 3, Update libs #234

Closed
LuchoTurtle opened this issue Sep 6, 2023 · 12 comments
Closed

Sys - Upgrade to latest Flutter/Dart 3, Update libs #234

LuchoTurtle opened this issue Sep 6, 2023 · 12 comments
Assignees

Comments

@LuchoTurtle
Copy link

Hello visual-editor team! 👋

Thanks for the package! It looks awesome! 🥳

I'm trying to get it working on a project that uses flutter-quill and I'm migrating it to visual-editor. This project has the following constraints:

environment:
  sdk: '>=3.0.5 <4.0.0'

Initially, I was using flutter_quill_extensions and, when installing visual_editor, I'm prompted with the following error:

Because every version of visual_editor from git depends on string_validator ^0.3.0 and flutter_quill_extensions >=0.2.0 depends on string_validator ^1.0.0, visual_editor from git is incompatible with flutter_quill_extensions
  >=0.2.0.
So, because app depends on both flutter_quill_extensions ^0.4.0 and visual_editor from git, version solving failed.

I've removed flutter_quill_extensions to surpass this obstacle but, after trying to install again, I got the following error:

Because no versions of mockito match >5.4.2 <6.0.0 and mockito 5.4.2 depends on analyzer ^5.11.0, mockito ^5.4.2 requires analyzer ^5.11.0.
And because every version of visual_editor from git depends on i18n_extension ^4.2.1 which depends on analyzer ^3.0.0, mockito ^5.4.2 is incompatible with visual_editor from git.
So, because app depends on both visual_editor from git and mockito ^5.4.2, version solving failed.

Because I'm using mockito for testing purposes, and it depends on a newer version of analyzer, it fails.

I propose upgrading visual_editor's dependencies so this issue is surpassed :)
I'll try to open a PR addressing these issues :D

@adrian-moisa
Copy link
Collaborator

Glad to hear it's making a good first impression. I wished it had more progress done by now, but you know, always juggling 10 plates. If you can run the update I'll gladly merge your PR. We kept pushing it because we did not upgrade our setup yet to Flutter 3. I think there are some new life cycle calls that need to be implemented, or at least stubbed. You could trace the Quill log and check what they had to do to get it working on F3. If you are stuck I'll jump in and try it myself. Cheers!

@adrian-moisa
Copy link
Collaborator

adrian-moisa commented Sep 6, 2023

I think we have it duped here: #202. We can continue work here, I just renamed. Quick info. We do one ticket one commit and we use rebase. Such that we keep the gitlog very clean.

@adrian-moisa adrian-moisa changed the title Dependencies - Error solving dependencies when installing visual-editor Sys - Upgrade to latest Flutter Sep 6, 2023
@LuchoTurtle
Copy link
Author

Thanks @adrian-moisa for the reply!
The PR seems simple. I'm taking a look at the erroring packages (e.g. https://github.com/marcglasberg/i18n_extension/blob/master/CHANGELOG.md) and the breaking changes seem to not affect visual-editor.

However, I'm having a bit of trouble getting the example app running 😥. I've cloned the repo and installed the dependencies but I keep stumbling upon errors like:

: Error: Type 'BidirectionalIterator' not found.
vertical-caret-movement-run.controller.dart:10
    extends BidirectionalIterator<TextPosition> {
            ^^^^^^^^^^^^^^^^^^^^^
: Error: 'AssetManifest' is imported from both 'package:flutter/src/services/asset_manifest.dart' and 'package:google_fonts/src/asset_manifest.dart'.
google_fonts_base.dart:14
import 'asset_manifest.dart';

I've noticed that while installing, some classes are not available. For example:

image

I don't know if this is related to the dependencies or to the example app running a specific version of Flutter. I was in the process of opening an issue on this. Am I missing something? 👀

@CristiSch
Copy link
Collaborator

CristiSch commented Sep 6, 2023

Hi @LuchoTurtle! I'm one of the maintainers of visual-editor.

We are currently running this repo using:
Flutter: 3.7.7
Dart: 2.19.4

Downgrading to this version should enable you to run the example app.

If you are unsure how to downgrade:

  • Open terminal/cmd to Flutter root folder.
  • git checkout 3.7.7
    • HEAD is now at 2ad6cd72c0 Update Engine revision to 1837b5be5f0f1376a1ccf383950e83a80177fb4e for stable release 3.7.7 (#122206) - should appear, this means Flutter was successfully downgraded.
  • Dart is automatically handled when running flutter pub get.

We can chat over our discord server if you need more assistance as well, ping @CRYSTONE2 over there.

@adrian-moisa
Copy link
Collaborator

@LuchoTurtle I think this is the one of the changes we have to make due to upgrade to Flutter 3. If you are stuck on it and can't find your way I'll check it myself. Though Today and tomorrow I'm under unusual circumstances, can't spend much time on it. No promise. Soonest will ne Thursday. Until then if you are stuck you can attempt to revert Flutter to a prior versions if it's possible. Drop me an update with your situation.

@LuchoTurtle
Copy link
Author

Hey @CristiSch , thanks for helping out!

I have downgraded according to your instructions and I've inclusively ran flutter clean and flutter pub get again just to be sure and I can't get the example going :(

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> Compilation error. See log for more details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 17s
┌─ Flutter Fix ──────────────────────────────────────────────────────────────────────────────┐
│ [!] Your project requires a newer version of the Kotlin Gradle plugin.                     │
│ Find the latest version on https://kotlinlang.org/docs/releases.html#release-details, then │
│ update /Users/lucho/Documents/dwyl/visual-editor/example/android/build.gradle:             │
│ ext.kotlin_version = '<latest-version>'                                                    │
└────────────────────────────────────────────────────────────────────────────────────────────┘
Exception: Gradle task assembleDebug failed with exit code 1
Exited

UPDATE:

Got it working by downgrading Flutter and Dart to the given version in the comment.

Notice that I got it working **on Android **(I'm going to try and see if it works on iOS and web next). Though I had to make some updates to the Gradle code:

  • in example/android/build.gradle:
    ext.kotlin_version = '1.9.10'

	...

    classpath 'com.android.tools.build:gradle:7.2.0'

	...

	tasks.register("clean", Delete) {
	    delete rootProject.buildDir
	}
  • in example/android/gradle/wrapper/gradle-wrapper.properties.
...
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip

Should I open a PR for this? Is it perhaps an "on my computer only" type thing? I can work on this PR and upgrade dependencies all in one go, if y'all want :D

@adrian-moisa
Copy link
Collaborator

adrian-moisa commented Sep 6, 2023

image

I've just upgraded my setup to latest

image

I'll take a stab at it to see if I can fix it with minimal intervention. Though I have limited time today. I'll keep you posted. Fingers crossed.

As expected:
image

@LuchoTurtle
Copy link
Author

@adrian-moisa cheers for that. Though I can also give it a whirl as well and create a PR solely for updating Flutter incrementally. It might take some time but I think it's well worth it

@adrian-moisa
Copy link
Collaborator

adrian-moisa commented Sep 6, 2023

One way or another we have to bring this repo up to speed. People are needing it. This upgrade is overdue. Since we have new stakeholders there's more motivation to get it done. Teamwork.

Edit Also upgraded repo to latest libs. To make sure we are not missing out on smth.

@adrian-moisa
Copy link
Collaborator

Ok, I've upgraded to latest dart. Now it should be working. There are still some deprecation warnings in the console but they are not show stoppers. I don't have time to fix them now. It's second prio for me.

image

I'm not sure if your PR is now valid. If it's still valid let's move it to a different ticket. We have a policy of on ticket one commit. I'm not entirely sure if you need the changes or not. Or what was the task there. So please open a new one if you still have code to commit from that one. I'll close this one since the upgrade was done.

LuchoTurtle added a commit to dwyl/visual-editor that referenced this issue Sep 6, 2023
LuchoTurtle added a commit to dwyl/visual-editor that referenced this issue Sep 6, 2023
This was made because `gallery_saver` was "stuck" with a dependency of `http` at 0.13, not allowing to upgrade other dependencies. Check CarnegieTechnologies/gallery_saver#205 for more information.

This commit adds `gal`, which does the same thing. `dio` and `path` were needed to recreate the behaviour of `gallery_saver`. `gal`, however, is updated and uses the latest versions of packages.
@LuchoTurtle
Copy link
Author

Cheers @adrian-moisa !
My PR indeed mostly overlaps with the changes you've made. So I'm closing it.

I was working on getting the dependencies updated, as well, to resolve the dependency issues I was having prior. Perhaps it makes sense to copy and shift into a new PR 👌

@adrian-moisa
Copy link
Collaborator

What's your timezone? I'm going out. I have to wakeup again in 6h. GMT+1 here

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

Successfully merging a pull request may close this issue.

3 participants