I am trying to use Apple's CoreML with my Flutter app using Platform Channels. With a straight iOS app, to use a CoreML model we drag the CoreML .mlmodel file into Xcode and Xcode autogenerates a Swift model class. We can then access that class directly in a SwiftUi view without any other configuration. However, with a Flutter app, when I try to access the model class as I would from a normal SwiftUI project after dragging the file into Xcode into the Runner folder where the AppDelegate.swift file is, I get a "Cannot find "model" in scope" error. It is as if the class isn't being autogenerated or wherever the class is autogenerated isn't accessible from AppDelegate.swift.

enter image description here

Ive included a screenshot on my setup. "model3" is the coreML model I am trying to use. And I try to use what would be the auto generated class in a function getPrediction. That error is present regardless of where I try to initialize the model (it is present even if I try to initialize it after line 18, for example.

Does someone have an idea how I would get CoreML working with Flutter with a Platform Channel? Thanks.