simolus3 / fluttie

Easily display stunning Lottie animations in flutter apps with this plugin.
Other
453 stars 54 forks source link

iOS support? #3

Open kentcb opened 6 years ago

kentcb commented 6 years ago

Hi,

This is more a query than an issue. I noticed that the README specifically states that iOS isn't yet supported, but it doesn't make it clear whether iOS support is planned/will be added.

Can you elaborate please?

Thanks

simolus3 commented 6 years ago

Thanks for your interest. The plugin doesn't support iOS because I don't have any experience with iOS development and I don't have access to a Mac which would be required to add support for it. Thus, iOS support is unlikely to be implemented soon, sorry.

jlouage commented 6 years ago

I will take a look to the code and i will try to implement the iOS part

simolus3 commented 6 years ago

Great, thank you for considering to do this, I really appreciate it :thumbsup: If you need any clarifications on the internal methods / platform channels, please let me know where I can improve the documentation.

nadenf commented 6 years ago

I will also be looking into this as well. Really need it :)

nadenf commented 6 years ago

Making excellent progress on this. The animations are appearing on the iPhone.

So expect a pull request in the next couple of days đź‘Ť

nadenf commented 6 years ago

Thought I would give a status update since it's been an interesting adventure.

So I am new to Flutter and wasn't aware that there was no way to really mix/match iOS UIView with Flutter Texture. It was at one point on their list but due to the complexity has been largely dropped: https://github.com/flutter/flutter/issues/14927

This makes the iOS implementation a giant "hack" since what I am doing is taking the animation UIView, converting to a UIImage and finally to a CVPixelBuffer. And the time it takes for this is around 40ms (not enough to hit 60fps). And there is nothing in Lottie iOS that lets me get the raw image data.

Anyway I have a hit a bug with Flutter so will be blocked until that is fixed.

Code is available at http://github.com/harana/fluttie for now.

simolus3 commented 6 years ago

Well that's unfortunate. Still, thank you for trying this out!

HallerPatrick commented 6 years ago

@baank This is maybe a stupid question, but isnt it possible to use a package like https://github.com/airbnb/lottie-ios for iOS to use its api to make it work? Or is this a "flutter to ios communication" problem?

nadenf commented 6 years ago

You can see the code in my fork. I already use Lottie-ios. The problem is that it outputs to a UIView whilst Flutter needs it in a CV buffer. I have an implementation that might already work and am in the process of testing it now.

HallerPatrick commented 6 years ago

@baank Thanks for the enlightenment. Looking forward to it!

lukepighetti commented 6 years ago

I don’t think I can be of much help as I am very new to iOS dev but I want you to know that I am very interested in your progress!

nakashima-koki commented 6 years ago

@baank Thank you for your contiribution despite being extremely busy:bow: I would like to know the current status. If you push your current to the branch, it may be helpful to you!

nadenf commented 6 years ago

@nakashima-koki .. I don't want to push anything to this repo unless it actually works.

Unfortunately I am pretty much stuck as I just don't know enough about the internals of how Fluttie works to know whether I am on the write track or not. Hopefully what I have can be helpful to someone though.

panuavakul commented 5 years ago

I'm wondering if anyone is still working on this?

Maybe after the PlatformView for iOS released, we can just call the iOS Native lottie library and wrap it in a Widget.

gtupak commented 5 years ago

Also interested in this. Would love to see some love for the iOS users <3

lukepighetti commented 5 years ago

Also, Skia has native Lottie support, there is an issue regarding adding native support. https://github.com/flutter/flutter/issues/20438

aroblast commented 5 years ago

To anyone still wanting to use Lottie animations on iOS, I had the same thoughts a few days ago, and I decided to create a new iOS Lottie animations plugin for Flutter. It is still in the very early stage of development, but uses PlatformViews and works fine for now, so it is a 'native' approach to Lottie on iOS. It is written in Swift, so you have to fix a few things on your XCode files before, but it's worth it. I will be working on improvements during the next few days, to release a fuller version than the current v0.2.0. You can still try to use it via pub, or on github.

NicolasDionB commented 4 years ago

Any update on this? @aroblast do you think you will/could merge your code for iOS with this plugin? An all featured plugin for Lottie on Flutter would be really useful! There's still the web version but adding one brick at a time, iOS would be great!

aroblast commented 4 years ago

@NicolasDionB I am currently trying to find time to improve flotter but I don't think I'll be able to merge it, because it seems fluttie doesn't use the new PlatformViews as I'm using in flotter. I'm still working on Android integration slowly though, I hope I'll be able to implement it soon!