apple_intelligence 0.2.0
apple_intelligence: ^0.2.0 copied to clipboard
Apple Intelligence for Flutter: on-device image generation streamed as it is made, plus a native text field with Writing Tools and Genmoji.
0.2.0 #
Writing Tools and Genmoji, via a real system text view.
AppleIntelligenceTextFieldhosts a genuineUITextView/NSTextViewinside Flutter, which is what makes Apple's text features work at all: Writing Tools attaches to aUIViewand Genmoji is a property ofUITextInput, and a Flutter text field is neither as far as the system is concerned.NativeTextControllerreads and writes the contents, andcapabilities()asks the live view what it was actually granted rather than inferring it from the OS version.onChangedfires when the native view edits itself — which is the only way to notice that Writing Tools rewrote your text or a Genmoji was inserted.
This is deliberately not a drop-in for Flutter's TextField. It is a
platform view, so it composites differently and costs more; styling does not
inherit from your theme; and it exists on iOS and macOS only, rendering
fallback elsewhere. The README says so before it says anything else about it.
Verified on macOS: the hosted view reports writingTools: true, genmoji: true,
and text round-trips through the controller.
0.1.0 #
Initial release: Apple Intelligence image generation for Flutter.
ImageCreator.generateproduces images on device with no UI, delivered as aStreamso the first can be shown while the rest are still being made. Cancelling the subscription cancels the work on the device.ImagePlaygroundSheet.presentshows Apple's own generation UI and returns the file it wrote, or null if the user cancelled.ImageCreator.availabilityreports the sheet and streaming separately, because the sheet is iOS 18.1 and streaming is 18.4 — a device can offer one and not the other.ImageConcept.textnames a subject;ImageConcept.extractedFromasks the system to find the subjects in a passage.- Errors arrive as a typed hierarchy —
OsTooOldException,GenerationUnavailableException,GenerationRefusedExceptionwith a specific reason — never as a barePlatformException.
Verified against real Apple Intelligence hardware: two PNGs of about 4 MB, the first at 6.8s and the second at 10.3s.
Not included: Writing Tools and Genmoji. Both are planned; Writing Tools attaches to a native text view while Flutter renders its own text, so it needs a design decision rather than a wrapper.