Subs/unsubs optimistic

This commit is contained in:
Vicente J. Ruiz Jurado 2018-08-15 05:56:48 +02:00
parent e8b2a6d0c0
commit d5bb87af27
4 changed files with 14 additions and 3 deletions

View file

@ -5,7 +5,6 @@ import 'package:fires_flutter/models/yourLocation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_fab_dialer/flutter_fab_dialer.dart';
import 'package:flutter_redux/flutter_redux.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:redux/src/store.dart';
import 'colors.dart';
@ -95,6 +94,8 @@ class _ActiveFiresPageState extends State<ActiveFiresPage> {
onPressed: () {
loc.subscribed = !loc.subscribed;
onToggle(loc);
setState(() {});
showSnackMsg(loc.subscribed? S.of(context).subscribedToFires: S.of(context).unsubscribedToFires);
}),
title: new Text(loc.description, style: new TextStyle(fontSize: 16.0)),
subtitle: loc.currentNumFires == YourLocation.withoutStats

View file

@ -75,6 +75,7 @@ class S implements WidgetsLocalizations {
String get privacyPolicy => "Privacy Policy";
String get shareAppBtn => "Share our app";
String get starAppBtn => "Rate our app";
String get subscribedToFires => "Subscribed to fires notifications";
String get supportPageDescription => "You can support this initiative, spreading the word, helping us to develop our software, translating this app to your language, suggesting other public data sources of fires to use, etc.";
String get supportThisInitiative => "Support this initiative";
String get thanksForParticipating => "Thanks for participating";
@ -85,6 +86,7 @@ class S implements WidgetsLocalizations {
String get tweetAboutAFireTitle => "Tweet about";
String get typeTheNameOfAPlace => "Type the name of a place, region, etc";
String get unsubscribe => "Unsubscribe";
String get unsubscribedToFires => "Unsubscribed to fires notifications";
String get warningThisIsAVeryLargeArea => "Warning: this is a very large area";
String get youDeletedThisNotification => "You deleted this notification";
String get youDeletedThisPlace => "You deleted this place";
@ -177,6 +179,8 @@ class es extends S {
@override
String get aYear => "un año";
@override
String get unsubscribedToFires => "Desuscrito a notificaciones de fuegos";
@override
String get itSeemsNotAtForesFire => "Parece que este fuego no es un fuego forestal.";
@override
String get UNDO => "DESHACER";
@ -193,6 +197,8 @@ class es extends S {
@override
String get NASAAck => "Reconocemos el uso de datos e imágenes de LANCE FIRMS operadas por NASA/GSFC/Earth Science Data and Information System (ESDIS) con fondos proporcionados por NASA/HQ.";
@override
String get subscribedToFires => "Suscrito a notificaciones de fuegos";
@override
String get isYourUbicationEnabled => "No podemos saber tu ubicación actual. ¿Están los servicios de ubicación en tu móvil activados?";
@override
String get thanksForParticipating => "Gracias por Participar";

View file

@ -79,5 +79,7 @@
"mapPrivacy": "In order to preserve the privacy of our users, the reflected data are randomly altered and are only indicative.",
"comunesSupportBtn": "Know and support our work",
"shareAppBtn": "Share our app",
"starAppBtn": "Rate our app"
"starAppBtn": "Rate our app",
"unsubscribedToFires": "Unsubscribed to fires notifications",
"subscribedToFires": "Subscribed to fires notifications"
}

View file

@ -79,5 +79,7 @@
"mapPrivacy": "Para preservar la privacidad de nuestros usuarios/as, los datos reflejados están aleatoriamente alterados y son solo orientativos.",
"comunesSupportBtn": "Conoce y apoya nuestro trabajo",
"shareAppBtn": "Comparte nuestra app",
"starAppBtn": "Puntúa nuestra app"
"starAppBtn": "Puntúa nuestra app",
"unsubscribedToFires": "Desuscrito a notificaciones de fuegos",
"subscribedToFires": "Suscrito a notificaciones de fuegos"
}