TCICCustomStrings class

自定义字符串覆盖配置,按语言分别传入。

key 使用 StringEnum 的枚举名(即 StringEnum.xxx.name), value 为覆盖后的文本。

示例:

TCICConfig(
  customStrings: TCICCustomStrings(
    zh: {'endClass': '结束授课', 'startClass': '开始授课'},
    en: {'endClass': 'End Session'},
  ),
)

注意:含有占位符的字符串(如 trtcError)覆盖时,占位符 {0}、{1} 会在内部被替换为 getString 传入的 args 参数,无需手动处理。

Constructors

TCICCustomStrings({Map<String, String>? zh, Map<String, String>? en, Map<String, String>? ja, Map<String, String>? ko, Map<String, String>? zhTw})
const

Properties

en → Map<String, String>?
final
hashCode → int
The hash code for this object.
no setterinherited
ja → Map<String, String>?
final
ko → Map<String, String>?
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
zh → Map<String, String>?
final
zhTw → Map<String, String>?
final

Methods

mapForLang(String langCode) → Map<String, String>?
根据语言代码返回对应的覆盖 Map(不存在时返回 null)。
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

fromJson(Map<String, dynamic> json) → TCICCustomStrings