Recreate Flutter's ios and android folder with Swift and Kotlin

*爱你&永不变心* 提交于 2021-01-21 07:05:10

问题


Hi I just found out that it is possible to create Flutter project with Swift and Kotlin. However, I'm already invested in my current projects and want to recreate the ios and android as Swift and Kotlin (currently they are default to Java and ObjC).

Thanks.


回答1:


use -i and -a to create new project, like this:

flutter create -i swift -a kotlin project_name

see also:https://flutter.io/docs/development/platform-integration/platform-channels#step-1-create-a-new-app-project

then replace with lib folder from old project.


update 2020.01.13
swift and kotlin are default now. you can use those command to update exist project:

cd project
flutter create .

this command will update your project. then you can merge you old code into new project, and remove old code.
make sure you backup your project before run it, and you know what are you exactly doing




回答2:


You can also run flutter create -i swift . inside your app folder, to regenerate ios folder.

I've not tested android, but I guess the same should works for it too - flutter create -a kotlin .



来源:https://stackoverflow.com/questions/53294148/recreate-flutters-ios-and-android-folder-with-swift-and-kotlin

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!