When someone picks your app out of the iOS share sheet, your Dart code isn't running. A second binary is, with its own memory ceiling.
Flutter's own docs are blunt: the containing app and the extension never talk directly, and the app might not be running at all.
So design for the harshest state, where the app has never launched on this device. The extension writes into the App Group container and exits. The app drains it next time it runs, in a second or in three days.
I wrote up the Xcode steps and the memory numbers behind that call.
https://www.duskolicanin.com/blog/flutter-ios-share-extension-app-groups