fromJson static method
Implementation
static InlineTimerInstant? fromJson(
Map<String, dynamic>? json,
) {
if (json == null) return null;
switch (json['source']) {
case 'fixed':
final parsed = _parseTimerInstant(json['at']);
return parsed == null
? null
: InlineTimerInstant._(
source: InlineTimerDeadlineSource.fixed,
fixedAt: parsed,
);
case 'fromVariable':
final token = json['token'];
if (token is! String || token.trim().isEmpty) return null;
final normalized = token.trim();
return InlineTimerInstant._(
source: InlineTimerDeadlineSource.fromVariable,
token: normalized,
);
default:
return null;
}
}