ZhInfo class

  • @Author: chuxiong
  • @Created at: 04-08-2025 10:49
  • @Email:
  • description 中文时间线文案。keepOneDay / keepTwoDays 均为 true,因此 1~2 天 会显示「x天前」样式。locale key:'zh'。
Implemented types

Constructors

ZhInfo()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

anHour(int hours) → String
「1 小时」文案(hours 恒为 1)。
override
customYesterday() → String
自定义「昨天」文案;返回空串表示禁用(优先级高于 keepOneDay)。
override
days(int days) → String
「x 天」文案。
override
hours(int hours) → String
「x 小时」文案。
override
keepOneDay() → bool
是否在 1 天时显示「1 天前」样式;为 false 时回退到 MM-dd。
override
keepTwoDays() → bool
是否在 2 天时显示「2 天前」样式;为 false 时回退到 MM-dd。
override
lessThanOneMinute() → String
「刚刚」/「just now」文案;返回空串表示不显示该项。
override
maxJustNowSecond() → int
「刚刚」判定的最大秒数(默认 30 秒以内显示「刚刚」)。
override
minutes(int minutes) → String
「x 分钟」文案。
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
oneDay(int days) → String
「1 天」文案(days 恒为 1)。
override
oneMinute(int minutes) → String
「1 分钟」文案(minutes 恒为 1,便于单复数区分)。
override
suffixAfter() → String
未来时间的后缀(如中文「后」、英文 ' after')。
override
suffixAgo() → String
过去时间的后缀(如中文「前」、英文 ' ago')。
override
toString() → String
A string representation of this object.
inherited

Operators

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