Can we use java/kotlin code in flutter with dart code?

81 Views Asked by At

I want to use java/kotlin in flutter with dart programming language. Java/kotlin has many functionalities which dart is lacking. But flutter is good in UI UX. So I want to use flutter with dart, but java/kotlin also for back-end programming. How can I do that?

2

There are 2 best solutions below

0
079_Vikash Rajpurohit On

You can pass the data from the flutter code to the native code and vice versa.

Please check this reference - https://tanya-anand.medium.com/data-pass-between-flutter-and-android-using-the-method-channel-f0e8f7655fe

But this process is used when we want to use some features that are not provided by Flutter but we can fulfill it using native code. for eg - https://pub.dev/packages/home_widget

however, it might not be so efficient to follow this in the complete app and keep the data logic in Java/swift and UI in Flutter using the above-mentioned way.

Thanks.

0
guegouoguiddel On

I think this can help:

Develop the frontend UI and logic using Flutter and Dart. Build a backend server using Java or Kotlin. Establish communication between the Flutter frontend and the backend server using APIs.