fix: resolve all warnings (59 warnings → 0)
- Fix bloc_lint include_file_not_found by removing unneeded include - Add explicit type annotations to callback parameters in activeFires.dart - Add explicit type parameters to MaterialPageRoute<void> constructors - Add explicit type parameters to Future<void>.delayed() calls - Fix error handler signatures: (Object err, StackTrace stack) - Remove 'const' from genericMap() widget construction (StatefulWidget) All strict analysis errors and warnings now resolved (0 errors, 0 warnings). Remaining 339 issues are info-level linting suggestions.
This commit is contained in:
parent
7a4c9fb3bc
commit
a5e0335f72
8 changed files with 71 additions and 42 deletions
|
|
@ -17,7 +17,6 @@ import 'redux/actions.dart';
|
|||
|
||||
@immutable
|
||||
class _ViewModel {
|
||||
|
||||
const _ViewModel(
|
||||
{required this.isLoaded,
|
||||
required this.onTap,
|
||||
|
|
@ -69,7 +68,8 @@ class _FireNotificationListState extends State<FireNotificationList> {
|
|||
String prefix = '';
|
||||
|
||||
// FIXME (this can fails if you don't have a location for this notif, for instance during tests)
|
||||
final YourLocation yl = yourLocations.singleWhere((YourLocation yl) => yl.id == notif.subsId);
|
||||
final YourLocation yl =
|
||||
yourLocations.singleWhere((YourLocation yl) => yl.id == notif.subsId);
|
||||
prefix = '${yl.description}. ';
|
||||
|
||||
return ListTile(
|
||||
|
|
@ -127,15 +127,14 @@ class _FireNotificationListState extends State<FireNotificationList> {
|
|||
decoration: BoxDecoration(
|
||||
color: theme.canvasColor,
|
||||
border: Border(
|
||||
bottom:
|
||||
BorderSide(color: theme.dividerColor))),
|
||||
bottom: BorderSide(color: theme.dividerColor))),
|
||||
child: _buildRow(context, yourLocations,
|
||||
notifList.elementAt(i), onDeleted, onTap)));
|
||||
}));
|
||||
}
|
||||
|
||||
Future<void> _handleRefresh() async {
|
||||
await Future.delayed(const Duration(seconds: 1));
|
||||
await Future<void>.delayed(const Duration(seconds: 1));
|
||||
|
||||
setState(() {});
|
||||
|
||||
|
|
@ -166,8 +165,8 @@ class _FireNotificationListState extends State<FireNotificationList> {
|
|||
},
|
||||
onTap: (FireNotification notif) {
|
||||
if (!notif.read) {
|
||||
store.dispatch(ReadFireNotificationAction(
|
||||
notif.copyWith(read: true)));
|
||||
store.dispatch(
|
||||
ReadFireNotificationAction(notif.copyWith(read: true)));
|
||||
}
|
||||
Timer(const Duration(milliseconds: 500), () {
|
||||
gotoMap(store, notif, context);
|
||||
|
|
@ -194,9 +193,12 @@ class _FireNotificationListState extends State<FireNotificationList> {
|
|||
},
|
||||
),
|
||||
actions: <Widget?>[
|
||||
if (hasFireNotifications) IconButton(
|
||||
icon: const Icon(Icons.delete),
|
||||
onPressed: () => _showConfirmDialog(view)) else null
|
||||
if (hasFireNotifications)
|
||||
IconButton(
|
||||
icon: const Icon(Icons.delete),
|
||||
onPressed: () => _showConfirmDialog(view))
|
||||
else
|
||||
null
|
||||
].where((Widget? w) => w != null).cast<Widget>().toList()),
|
||||
body: !view.isLoaded
|
||||
? const FiresSpinner()
|
||||
|
|
@ -232,7 +234,9 @@ class _FireNotificationListState extends State<FireNotificationList> {
|
|||
Store<AppState> store, FireNotification notif, BuildContext context) {
|
||||
store.dispatch(ShowFireNotificationMapAction(notif));
|
||||
Navigator.push(
|
||||
context, MaterialPageRoute(builder: (BuildContext context) => const genericMap()));
|
||||
context,
|
||||
MaterialPageRoute<void>(
|
||||
builder: (BuildContext context) => genericMap()));
|
||||
}
|
||||
|
||||
Future<void> _showConfirmDialog(_ViewModel view) {
|
||||
|
|
@ -245,8 +249,7 @@ class _FireNotificationListState extends State<FireNotificationList> {
|
|||
content: SingleChildScrollView(
|
||||
child: ListBody(
|
||||
children: <Widget>[
|
||||
Text(
|
||||
S.of(context).deleteAllFireNotificationsAlertDescription)
|
||||
Text(S.of(context).deleteAllFireNotificationsAlertDescription)
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue