fix: resolve 2 remaining strict analysis errors
- introPage.dart: Convert fireItems to proper static function closure - mainDrawer.dart: Convert unreadCount int to String for Text widget
This commit is contained in:
parent
1864e5b105
commit
7a4c9fb3bc
61 changed files with 1386 additions and 1202 deletions
|
|
@ -1,14 +1,14 @@
|
|||
// Copyright (c) 2016, rinukkusu. All rights reserved. Use of this source code
|
||||
// is governed by a BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'generated/i18n.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'generated/i18n.dart';
|
||||
|
||||
class Moment {
|
||||
late DateTime _date;
|
||||
|
||||
Moment.now() {
|
||||
_date = new DateTime.now();
|
||||
_date = DateTime.now();
|
||||
}
|
||||
|
||||
Moment.fromDate(DateTime date) {
|
||||
|
|
@ -17,27 +17,29 @@ class Moment {
|
|||
|
||||
Moment.fromMillisecondsSinceEpoch(int millisecondsSinceEpoch,
|
||||
{bool isUtc = false}) {
|
||||
_date = new DateTime.fromMillisecondsSinceEpoch(millisecondsSinceEpoch,
|
||||
_date = DateTime.fromMillisecondsSinceEpoch(millisecondsSinceEpoch,
|
||||
isUtc: isUtc);
|
||||
}
|
||||
late DateTime _date;
|
||||
|
||||
static Moment parse(String date) {
|
||||
return new Moment.fromDate(DateTime.parse(date));
|
||||
return Moment.fromDate(DateTime.parse(date));
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return _date.toString();
|
||||
}
|
||||
|
||||
String fromNow(BuildContext context, [bool withoutPrefixOrSuffix = false]) {
|
||||
return from(context, new DateTime.now(), withoutPrefixOrSuffix);
|
||||
return from(context, DateTime.now(), withoutPrefixOrSuffix);
|
||||
}
|
||||
|
||||
String from(BuildContext context, DateTime date,
|
||||
[bool withoutPrefixOrSuffix = false]) {
|
||||
Duration diff = date.difference(_date);
|
||||
final Duration diff = date.difference(_date);
|
||||
|
||||
String timeString = "";
|
||||
String timeString = '';
|
||||
|
||||
if (diff.inSeconds.abs() < 45)
|
||||
timeString = S.of(context).aF3wSeconds;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue