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

How to integrate this library? #5

Open
hasnainusti opened this issue Dec 14, 2021 · 16 comments
Open

How to integrate this library? #5

hasnainusti opened this issue Dec 14, 2021 · 16 comments

Comments

@hasnainusti
Copy link

Hi, please guide me how can I integrate this library into my project? I cloned the example project and I was able to run it successfully but I don't know how to integrate it into my project. I'm having issue with adding the line animator in pubspec.yaml file.Please help

@ibrierley
Copy link
Owner

Hi, I think you would have something like...

flutter_map_line_editor:
  git:
    url: https://github.com/ibrierley/flutter_map_line_editor.git

@hasnainusti
Copy link
Author

Thanks. I've successfully integrated it but when I import the library its giving me this warning:

The library 'package:line_animator/line_animator.dart' is legacy, and should not be imported into a null safe library.
Try migrating the imported library.

@ibrierley
Copy link
Owner

Strange, it should be updated to nullsafety. Are you using the master branch ?

@hasnainusti
Copy link
Author

hasnainusti commented Dec 14, 2021

No. I'm on 2.5.3. Also getting this error on console .

Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:

  • package:line_animator

For solutions, see https://dart.dev/go/unsound-null-safety

@ibrierley
Copy link
Owner

Strange, it should be updated to null safety, and I've tested it with flutter sdk 2.5.2 and 2.8.0.

What happens if you run flutter pub outdated --mode=null-safety ?

(I get direct dependencies: all support null safety. All dependencies opt in to null-safety.)

What does flutter pub deps show out of interest ?

@hasnainusti
Copy link
Author

This is the output:

Showing dependencies that are currently not opted in to null-safety.
[✗] indicates versions without null safety support.
[✓] indicates versions opting in to null safety.

Package Name Current Upgradable Resolvable Latest

direct dependencies:
line_animator ✗1.0.0+1 (git) ✗1.0.0+1 (git) ✗1.0.0+1 (git) ✗1.0.0+1 (git)

dev_dependencies: all support null safety.
You are already using the newest resolvable versions listed in the 'Resolvable' column.
Newer versions, listed in 'Latest', may not be mutually compatible.

@ibrierley
Copy link
Owner

Doh ignore me, I didn't even read this as the right github repo, I was looking at line_editor which I do, not line_animator. My stupid mistake. Thanks for this. I'll take a look later, probably won't be such a quick fix, but I will take a look when I get time within the next day or so hopefully.

@ibrierley
Copy link
Owner

I've done some updates, so you could try it now.

@hasnainusti
Copy link
Author

That was quick. Well still getting errors. I think you updated the code but didn't upgrade the environment sdk to the null safety one in pubspec.yaml file.

@ibrierley
Copy link
Owner

Ah yes, well spotted, see if that's better.

@hasnainusti
Copy link
Author

Thanks. It's working. Can you please also update the example with null safety?

@ibrierley
Copy link
Owner

Is it ok now ?

@hasnainusti
Copy link
Author

Yes but I'm getting null error on LatLng markerPoint and List points.

@ibrierley
Copy link
Owner

Sure you have updated it correctly, as line 36 initialises it, so not sure it can be null (and I don't get an error, so seems odd), but maybe I'm looking at something different ?

https://github.com/ibrierley/line_animator/blob/master/example/lib/flutter_map_line_animator.dart

Are you running example/lib/flutter_map_line_animator.dart ?

@hasnainusti
Copy link
Author

hasnainusti commented Dec 15, 2021

It's working now. I was using the old code. Thanks man

@ibrierley
Copy link
Owner

Super, thanks for the update and the patience.

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

No branches or pull requests

2 participants