mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-19 23:31:03 +10:00
wrap returns from if blocks
fixes two analyzer errors for return blocks on new lines from if blocks
This commit is contained in:
@@ -673,8 +673,9 @@ class _ChatScreenState extends State<ChatScreen> {
|
|||||||
String _formatRelativeTime(DateTime time) {
|
String _formatRelativeTime(DateTime time) {
|
||||||
final diff = DateTime.now().difference(time);
|
final diff = DateTime.now().difference(time);
|
||||||
if (diff.inSeconds < 60) return context.l10n.time_justNow;
|
if (diff.inSeconds < 60) return context.l10n.time_justNow;
|
||||||
if (diff.inMinutes < 60)
|
if (diff.inMinutes < 60) {
|
||||||
return context.l10n.time_minutesAgo(diff.inMinutes);
|
return context.l10n.time_minutesAgo(diff.inMinutes);
|
||||||
|
}
|
||||||
if (diff.inHours < 24) return context.l10n.time_hoursAgo(diff.inHours);
|
if (diff.inHours < 24) return context.l10n.time_hoursAgo(diff.inHours);
|
||||||
return context.l10n.time_daysAgo(diff.inDays);
|
return context.l10n.time_daysAgo(diff.inDays);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -646,8 +646,9 @@ class _RepeaterStatusScreenState extends State<RepeaterStatusScreen> {
|
|||||||
final direct = _formatValue(_dupDirect);
|
final direct = _formatValue(_dupDirect);
|
||||||
return l10n.repeater_duplicatesFloodDirect(flood, direct);
|
return l10n.repeater_duplicatesFloodDirect(flood, direct);
|
||||||
}
|
}
|
||||||
if (_packetsRecv == null || _floodRx == null || _directRx == null)
|
if (_packetsRecv == null || _floodRx == null || _directRx == null) {
|
||||||
return '—';
|
return '—';
|
||||||
|
}
|
||||||
final dupTotal = _packetsRecv! - _floodRx! - _directRx!;
|
final dupTotal = _packetsRecv! - _floodRx! - _directRx!;
|
||||||
if (dupTotal < 0) return '—';
|
if (dupTotal < 0) return '—';
|
||||||
return l10n.repeater_duplicatesTotal(dupTotal);
|
return l10n.repeater_duplicatesTotal(dupTotal);
|
||||||
|
|||||||
Reference in New Issue
Block a user