ios customkeybord has 40M memory limit,so can not use Flutter in this kind of extension.
Due to the memory limitations of app extensions, it is only recommended to use Flutter to build app extension UI for extension types that have memory limits larger than 100MB. For example, share extensions which have a 120MB memory limit.
In addition, Flutter uses extra memory in debug mode. Therefore, Flutter does not fully support running app extensions in debug mode on physical devices when used to build extension UI. As an alternative, use an iOS simulator to test your extension in debug mode.
So this code can only run in simulation, not in the real device.