[英]Sharing constants between Android , iOS and Dart in a Flutter Project
Is there any workaround to share constant variables between the android,iOS and dart code? android、iOS 和 dart 代码之间是否有共享常量变量的解决方法? This can be especially useful when using Platform Channels as the Channel name, method names and argument key names are kept in a constants file and alternately the same file is created in kotlin and swift to match.这在使用平台通道时特别有用,因为通道名称、方法名称和参数键名称保存在常量文件中,并且在 kotlin 和 swift 中创建相同的文件以进行匹配。 Can we avoid this duplication by keeping a common file that can be shared and accessed by the 3 platforms?我们能否通过保留一个可由 3 个平台共享和访问的公共文件来避免这种重复?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.