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:
vjrj 2026-03-06 11:28:04 +01:00
parent 7a4c9fb3bc
commit a5e0335f72
8 changed files with 71 additions and 42 deletions

View file

@ -20,7 +20,6 @@ import 'redux/actions.dart';
@immutable
class _ViewModel {
const _ViewModel(
{required this.onAdd,
required this.onDelete,
@ -93,7 +92,8 @@ class _ActiveFiresPageState extends State<ActiveFiresPage> {
];
}
Widget _buildRow(BuildContext context, YourLocation loc, onToggle, onTap) {
Widget _buildRow(BuildContext context, YourLocation loc,
ToggleSubscriptionFunction onToggle, OnLocationTapFunction onTap) {
const TextStyle fireStatsStyle = TextStyle(color: fires600);
return ListTile(
dense: true,
@ -144,7 +144,11 @@ class _ActiveFiresPageState extends State<ActiveFiresPage> {
}
Widget _buildSavedLocations(
BuildContext context, List<YourLocation> yl, onDeleted, onToggle, onTap) {
BuildContext context,
List<YourLocation> yl,
DeleteYourLocationFunction onDeleted,
ToggleSubscriptionFunction onToggle,
OnLocationTapFunction onTap) {
return ListView.builder(
padding: const EdgeInsets.all(16.0),
itemCount: yl.length,
@ -158,13 +162,13 @@ class _ActiveFiresPageState extends State<ActiveFiresPage> {
background: Container(
color: theme.primaryColor,
child: const ListTile(
leading: Icon(Icons.delete,
color: Colors.white, size: 36.0))),
leading:
Icon(Icons.delete, color: Colors.white, size: 36.0))),
secondaryBackground: Container(
color: theme.primaryColor,
child: const ListTile(
trailing: Icon(Icons.delete,
color: Colors.white, size: 36.0))),
trailing:
Icon(Icons.delete, color: Colors.white, size: 36.0))),
child: Container(
decoration: BoxDecoration(
color: theme.canvasColor,
@ -182,8 +186,8 @@ class _ActiveFiresPageState extends State<ActiveFiresPage> {
print('New ViewModel of Active Fires');
return _ViewModel(
onAdd: (YourLocation loc) {
if (store.state.yourLocations
.any((YourLocation l) => loc.lat == l.lat && loc.lon == l.lon)) {
if (store.state.yourLocations.any(
(YourLocation l) => loc.lat == l.lat && loc.lon == l.lon)) {
// Already added
showSnackMsg(S.of(context).addedThisLocation);
} else {
@ -283,7 +287,9 @@ class _ActiveFiresPageState extends State<ActiveFiresPage> {
Store<AppState> store, YourLocation loc, BuildContext context) {
store.dispatch(ShowYourLocationMapAction(loc));
Navigator.push(
context, MaterialPageRoute(builder: (BuildContext context) => const genericMap()));
context,
MaterialPageRoute<void>(
builder: (BuildContext context) => genericMap()));
}
void onAddYourLocation(AddYourLocationFunction onAdd) {