gpt4 book ai didi

javascript - 在 dart 中移植 js 映射

转载 作者:行者123 更新时间:2023-12-01 02:53:37 26 4
gpt4 key购买 nike

如何在 dart 中移植这个常量?

const CHANNEL_STATES = {
closed: "closed",
errored: "errored",
joined: "joined",
joining: "joining",
leaving: "leaving",
}

我需要它来给前男友打电话。 CHANNEL_STATES.关闭谢谢

最佳答案

您可以使用类和常量静态成员来做到这一点:

class CHANNEL_STATES {
static const String closed = "closed";
static const String errored = "errored";
static const String joined = "joined";
static const String joining = "joining";
static const String leaving = "leaving";
}

关于javascript - 在 dart 中移植 js 映射,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46844143/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com