简体   繁体   English

Flutter:使用 Kotlin 创建一个 flutter 项目

[英]Flutter: Create a flutter project with Kotlin

Flutter allows supporting of Kotlin language. Flutter 允许支持 Kotlin 语言。

在此处输入图像描述

How can I integrate my Kotlin file with Flutter project?如何将我的 Kotlin 文件与 Flutter 项目集成?

There is no option to add/create a Kotlin file (in New menu) in Android Studio.在 Android Studio 中没有添加/创建 Kotlin 文件的选项(在New菜单中)。

在此处输入图像描述

I think the kotlin files can only be used in the platform-specific plugins.我认为 kotlin 文件只能在特定于平台的插件中使用。 Eg you have platform-specific implementation for both iOS and android and you can use kotlin for the Android part.例如,您有适用于 iOS 和 android 的特定于平台的实现,并且您可以将 kotlin 用于 Android 部分。 The Flutter SDK is used directly with Dart . Flutter SDK 直接与Dart一起使用。

按照这个

Open your Android module in android so you can add your kotlin files在 android 中打开你的 Android 模块,这样你就可以添加你的 kotlin 文件

Flutter does not support Kotlin and it looks it will not allow Flutter to be written in Kotlin language. Flutter 不支持 Kotlin,看起来它不会允许 Flutter 用 Kotlin 语言编写。 The biggest advantage of using Dart language is the management of the object.使用Dart语言最大的优势就是对对象的管理。 It has a great garbage collector.它有一个很棒的垃圾收集器。 Don't you think google developers didn't think about that before?你不认为谷歌开发者之前没有考虑过这个吗? Of course, they did.当然,他们做到了。 But Dart is chosen as the one language of Flutter.但是 Dart 被选为 Flutter 的一种语言。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM