I was wondering if (since I can use Obj-C code in Swift using the proper manners) can I use Java or Kotlin in Flutter apps?
Like import a plugin or framework or just create a function or method using another language and expose it to Dart/Flutter.
You can always use platform channels. https://flutter.dev/docs/development/platform-integration/platform-channels
Flutter's Main Language: Flutter primarily uses a language called Dart. Think of Dart as the main builder of your Flutter app.
Java and Kotlin as Helpers: You can't directly use Java or Kotlin to build your entire Flutter app. However, they can lend Flutter a hand with special tasks.
How They Help:
Phone Calls: Imagine you want your Flutter app to make a call. Flutter can ask Java or Kotlin (who know how to work the Android phone features) to do this.
Fancy Camera Tricks: Flutter might need Java or Kotlin's help if you want to do advanced things with your phone's camera.
Plugins: Sometimes, Java or Kotlin code is already bundled into handy packages called "plugins" that you can plug into your Flutter app to do cool things.
Important: Use Flutter and Dart as much as possible. Think of Java and Kotlin as backup helpers for special occasions when Flutter needs their specific skills.
And check this: https://flutter.dev/docs/development/platform-integration/platform-channels
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With