Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

flutter

dart

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.

like image 379
Inquisitor K Avatar asked Nov 14 '18 06:11

Inquisitor K


3 Answers

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

flutter create -i swift -a kotlin project_name

see also:https://docs.flutter.dev/development/platform-integration/platform-channels#example-project enter image description here 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

like image 61
dujianchi Avatar answered Nov 01 '22 23:11

dujianchi


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 work for it too - flutter create -a kotlin .

like image 26
Igor Zboichik Avatar answered Nov 01 '22 23:11

Igor Zboichik


I just deleted default ios and android folder in my flutter project. now in order to generate these default folder again you can use this below command :

flutter create .

Note : "." is also part of command , also make sure that your project folder name should not contain spaces or special characters which are invalid for package name.

like image 3
MANISH Avatar answered Nov 02 '22 01:11

MANISH