I am migrating existing iOS project to Flutter.
I am working on custom camera code for Flutter app. I have created simple version of it using plugins system. I can show my camera view in Flutter, take pictures, everything is OK. But very simplyfied version, my production code requires OpenCV and other low-level stuff.
My problem is that Flutter makes a Pod from each plugin with it's own podspec. And my legacy code is mixed Swift, C++, Objective-C. It works good when set up in the xcodeproject itself (and actually the configuration is extremely simple, it uses BridgingHeader and ObjC wrapper and it just works).
But when I extract this code and move it to the Plugin Pod, I get configuration errors which I can't solve, and don't really won't to spend time on it anymore because I don't need it to be a Pod at all.
My question is, can I just add my native code to the Runner project itself, configure C++/bridging stuff manually and then somehow call this code from Flutter Plugin? Or it there any other way around, without using plugins? (Actually I can add the code to the Runner just fine, but I can't call it from generate Pod because Pods can't import class definitions from main Xcode project. All I need is to create 1 class instance in the pod, and I can't even use NSClassNameFromString because type is undefined in the generated Pod environment)
I also have similar code for macOS and Android, so ideally I would just configure corresponding projects manually and then somehow call this from Flutter without using plugins' podspecs/cocoapods at all.
Ideally, I want to be able to completely get rid of Cocoapods.
Thank you!
I found the concept I needed: conditional imports in Flutter. I was able to eliminate plugin package and put all my Flutter code in lib/ and platform code in ios/macos/android projects.