Last changes not published

This commit is contained in:
vjrj 2026-03-05 01:18:27 +01:00
parent ac65ccf990
commit 21ec08303a
43 changed files with 607 additions and 613 deletions

View file

@ -5,15 +5,15 @@ import 'package:fires_flutter/models/fireNotification.dart';
import 'package:fires_flutter/models/yourLocation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_redux/flutter_redux.dart';
import 'package:redux/src/store.dart';
import 'package:redux/redux.dart';
import 'customMoment.dart';
import 'firesSpinner.dart';
import 'generated/i18n.dart';
import 'genericMap.dart';
import 'mainDrawer.dart';
import 'models/appState.dart';
import 'redux/actions.dart';
import 'firesSpinner.dart';
@immutable
class _ViewModel {
@ -76,7 +76,7 @@ class _FireNotificationListState extends State<FireNotificationList> {
return new ListTile(
dense: true,
leading: const Icon(Icons.whatshot),
title: new Text('${prefix}${notif.description}',
title: new Text('$prefix${notif.description}',
style: new TextStyle(
fontWeight: notif.read ? FontWeight.normal : FontWeight.bold)),
subtitle: new Text(Moment.now().from(context, notif.when)),
@ -89,7 +89,7 @@ class _FireNotificationListState extends State<FireNotificationList> {
}
void showSnackMsg(String msg) {
_scaffoldKey.currentState.showSnackBar(new SnackBar(
ScaffoldMessenger.of(context).showSnackBar(new SnackBar(
content: new Text(msg),
));
}
@ -149,8 +149,8 @@ class _FireNotificationListState extends State<FireNotificationList> {
return new StoreConnector<AppState, _ViewModel>(
distinct: true,
converter: (store) {
print('New ViewModel of Fires Notifications (unread: ${store.state
.fireNotificationsUnread})');
print(
'New ViewModel of Fires Notifications (unread: ${store.state.fireNotificationsUnread})');
return new _ViewModel(
isLoaded: store.state.isLoaded,
onDeleteAll: () {
@ -158,7 +158,7 @@ class _FireNotificationListState extends State<FireNotificationList> {
},
onDelete: (notif) {
store.dispatch(new DeleteFireNotificationAction(notif));
_scaffoldKey.currentState.showSnackBar(new SnackBar(
ScaffoldMessenger.of(context).showSnackBar(new SnackBar(
content: new Text(S.of(context).youDeletedThisNotification),
action: new SnackBarAction(
label: S.of(context).UNDO,
@ -202,25 +202,33 @@ class _FireNotificationListState extends State<FireNotificationList> {
onPressed: () => _showConfirmDialog(view))
: null
])),
body: !view.isLoaded ? new FiresSpinner() : !hasFireNotifications
? Padding(
padding: const EdgeInsets.all(20.0),
child: new Card(
child: new Padding(
padding: const EdgeInsets.all(20.0),
child: new CenteredColumn(children: <Widget>[
new Icon(Icons.notifications_none,
size: 150.0, color: Colors.black26),
new SizedBox(height: 20.0),
new Text(
S.of(context).fireNotificationsDescription,
textAlign: TextAlign.center,
textScaleFactor: 1.1,
style: new TextStyle(
height: 1.3, color: Colors.black45))
]))))
: _buildSavedFireNotifications(context, view.yourLocations,
view.fireNotifications, view.onDelete, view.onTap));
body: !view.isLoaded
? new FiresSpinner()
: !hasFireNotifications
? Padding(
padding: const EdgeInsets.all(20.0),
child: new Card(
child: new Padding(
padding: const EdgeInsets.all(20.0),
child: new CenteredColumn(children: <Widget>[
new Icon(Icons.notifications_none,
size: 150.0, color: Colors.black26),
new SizedBox(height: 20.0),
new Text(
S
.of(context)
.fireNotificationsDescription,
textAlign: TextAlign.center,
textScaleFactor: 1.1,
style: new TextStyle(
height: 1.3, color: Colors.black45))
]))))
: _buildSavedFireNotifications(
context,
view.yourLocations,
view.fireNotifications,
view.onDelete,
view.onTap));
});
}