FireAlerts (wip)

This commit is contained in:
Vicente J. Ruiz Jurado 2018-07-15 09:33:32 +02:00
parent acf95b699d
commit 6d9ad379c4
11 changed files with 133 additions and 38 deletions

View file

@ -1,4 +1,4 @@
p# PRIVACY POLICY #
# PRIVACY POLICY #
*Last updated July 12, 2018*
@ -144,13 +144,13 @@ We may update this privacy policy from time to time. The updated version will be
If you have questions or comments about this policy, you may email us at info@comunes.org or by post to:
ASOCIACIÓN COMUNES
CL COLÓN, 21 PORTAL D 5ºD
C/ COLÓN 21, 5º DCHA, ESC DCHA
03001 ALICANTE
SPAIN
If you have any further questions or comments about us or our policies, email us at info@comunes.org or by post to:
ASOCIACIÓN COMUNES
CL COLÓN, 21 PORTAL D 5ºD
C/ COLÓN 21, 5º DCHA, ESC DCHA
03001 ALICANTE
SPAIN

View file

@ -143,13 +143,13 @@ Podemos actualizar esta política de privacidad de vez en cuando. La versión ac
Si tiene preguntas o comentarios sobre esta política, puede enviarnos un correo electrónico a info@comunes.org o por correo postal a:
ASOCIACIÓN COMUNES
CL COLÓN, 21 PORTAL D 5ºD
C/ COLÓN 21, 5º DCHA, ESC DCHA
03001 ALICANTE
ESPAÑA
Si tiene más preguntas o comentarios sobre nosotras/os o nuestras políticas, envíenos un correo electrónico a info@comunes.org o por correo postal a:
ASOCIACIÓN COMUNES
CL COLÓN, 21 PORTAL D 5ºD
C/ COLÓN 21, 5º DCHA, ESC DCHA
03001 ALICANTE
ESPAÑA

View file

@ -1,6 +1,5 @@
import 'dart:async';
import 'package:just_debounce_it/just_debounce_it.dart';
import 'package:comunes_flutter/comunes_flutter.dart';
import 'package:fires_flutter/models/yourLocation.dart';
import 'package:flutter/material.dart';

78
lib/fireAlert.dart Normal file
View file

@ -0,0 +1,78 @@
import 'package:community_material_icon/community_material_icon.dart';
import 'package:comunes_flutter/comunes_flutter.dart';
import 'package:flutter/material.dart';
import 'package:share/share.dart';
import 'package:url_launcher/url_launcher.dart';
import 'generated/i18n.dart';
import 'placesAutocompleteUtils.dart';
class FireAlert extends StatefulWidget {
static const String routeName = '/fireAlert';
@override
_FireAlertState createState() => _FireAlertState();
}
class _FireAlertState extends State<FireAlert> {
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
Widget buildCallButton() {
return new Align(
alignment: const Alignment(0.0, -0.2),
child: new FloatingActionButton(
heroTag: 'callAction',
child: const Icon(Icons.call),
onPressed: () {
launch("tel://112");
},
),
);
}
Widget buildTweetButton() {
return new Align(
alignment: const Alignment(0.0, -0.2),
child: new FloatingActionButton(
heroTag: 'tweetAction',
child: const Icon(CommunityMaterialIcons.twitter),
onPressed: () {
// In Android you can choose with app to use with setPackage but seems it's not implemented here
// https://stackoverflow.com/questions/6814268/android-share-on-facebook-twitter-mail-ecc
openPlacesDialog(_scaffoldKey).then((yourLocation) {
String where =
yourLocation.description.replaceAll(' ', '').split(',')[0];
print(where);
Share.share('#IF${where} FIXME');
}).catchError((onError) {
_scaffoldKey.currentState.showSnackBar(new SnackBar(
content: new Text(
S.of(_scaffoldKey.currentContext).errorFirePlaceDialog)));
});
},
),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
key: _scaffoldKey,
appBar: new AppBar(title: new Text(S.of(context).notifyAFire)),
body: new CenteredColumn(
children: <Widget>[
new Flexible(
child: new CenteredColumn(
children: <Widget>[
new Text(S.of(context).callEmergencyServicesDescription,
softWrap: true),
new Text(S.of(context).tweetAboutAFireDescription),
],
),
),
buildCallButton(),
buildTweetButton()
],
));
}
}

View file

@ -13,6 +13,7 @@ import 'redux/actions.dart';
import 'sandbox.dart';
import 'theme.dart';
import 'privacyPage.dart';
import 'fireAlert.dart';
class FiresApp extends StatelessWidget {
static final WidgetBuilder introWidget = (context) => new IntroPage();
@ -24,6 +25,7 @@ class FiresApp extends StatelessWidget {
PrivacyPage.routeName: (BuildContext context) => new PrivacyPage(context),
ActiveFiresPage.routeName: (BuildContext context) => new ActiveFiresPage(),
Sandbox.routeName: (BuildContext context) => new Sandbox(),
FireAlert.routeName: (BuildContext context) => new FireAlert()
};
final Store<AppState> store;

View file

@ -37,9 +37,11 @@ class S implements WidgetsLocalizations {
String get alertWhenThereIsAFire => "Alert when there is a fire";
String get anHour => "an hour";
String get appName => "All Against The Fire!";
String get callEmergencyServicesDescription => "You can call 112 if you have not already done so to notify the emergency services.";
String get chooseAPlace => "Choose a place";
String get chooseAWatchRadio => "Choose a watch radio";
String get confirm => "Confirm";
String get errorFirePlaceDialog => "We couldn't get the location of the fire";
String get firesInTheWorld => "Active fires in the world";
String get firesInYourPlaces => "Active fires in your places";
String get firesNearPlace => "Fires near other place";
@ -51,6 +53,7 @@ class S implements WidgetsLocalizations {
String get supportThisInitiative => "Support this initiative";
String get toDeleteThisPlace => "Slide horizontally to delete this place";
String get toFiresNotifications => "Subscribe to fires notifications";
String get tweetAboutAFireDescription => "Additionally if you use twitter you can notify them with additional information, for example, attaching photos to the tweet if you have good visibility of the fire, when you took the photos, exact location, etc. Use #hashtags type #IFMinicipalTerminal for example #IFJumilla (Forest Fire in Jumilla).";
String get typeTheNameOfAPlace => "Type the name of a place, region, etc";
String get unsubscribe => "Unsubscribe";
String get warningThisIsAVeryLargeArea => "Warning: this is a very large area";
@ -83,36 +86,50 @@ class es extends S {
@override
String get addYourCurrentPosition => "Añade tu ubicación actual";
@override
String get UNDO => "DESHACER";
@override
String get alertWhenThereIsAFire => "Alerta cuando hay un fuego";
@override
String get anHour => "una hora";
@override
String get aMinute => "un minuto";
@override
String get firesInYourPlaces => "Fuegos en tus lugares";
@override
String get notifyAFire => "Notificar un fuego";
@override
String get isYourUbicationEnabled => "No podemos saber tu ubicación actual. ¿Están los servicios de ubicación en tu móvil activados?";
String get callEmergencyServicesDescription => "Puedes llamar al 112 si no lo has hecho ya para avisar a los servicios de emergencia.";
@override
String get errorFirePlaceDialog => "No hemos podido obtener la ubicación del fuego";
@override
String get toDeleteThisPlace => "Desliza horizontalmente para borrar este lugar";
@override
String get tweetAboutAFireDescription => "Adicionalmente si usas twitter puedes notificarles con información adicional, por ejemplo, adjuntando fotos al tweet si tienes buena visibilidad del fuego, cuando tomaste las fotos, ubicación exacta, etc. Usa #hashtags tipo #IFTerminoMunicipal por ejemplo #IFJumilla (Incendio Forestal en Jumilla).";
@override
String get AvoidThisStringsIfisNotPlural => "Zero One Two Few Many Other";
@override
String get unsubscribe => "Desuscríbete";
@override
String get aDay => "un día";
@override
String get supportThisInitiative => "Apoya esta iniciativa";
@override
String get SAVE => "GUARDAR";
@override
String get toFiresNotifications => "Suscríbete a alertas de fuegos";
@override
String get notPermsUbication => "No tenemos permisos para conocer tu ubicación";
@override
String get youDeletedThisPlace => "Has borrado este lugar";
@override
String get chooseAPlace => "Elige un lugar";
@override
String get firesNearPlace => "Fuegos cercanos a ti";
@override
String get aYear => "un año";
@override
String get UNDO => "DESHACER";
@override
String get aMinute => "un minuto";
@override
String get firesInYourPlaces => "Fuegos en tus lugares";
@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 aDay => "un día";
@override
String get SAVE => "GUARDAR";
@override
String get addedThisLocation => "Ya has añadido este lugar antes";
@override
String get typeTheNameOfAPlace => "Escribe el nombre de un lugar, zona, etc";
@ -135,30 +152,18 @@ class es extends S {
@override
String get getAlertsOfFiresinThatArea => "Recibe alertas de fuegos en esa zona";
@override
String get youDeletedThisPlace => "Has borrado este lugar";
@override
String get warningThisIsAVeryLargeArea => "Cuidado: esta zona es muy grande";
@override
String get chooseAWatchRadio => "Elige un radio de vigilancia";
@override
String get CANCEL => "CANCELAR";
@override
String get chooseAPlace => "Elige un lugar";
@override
String get firesNearPlace => "Fuegos cercanos a ti";
@override
String get aYear => "un año";
@override
String inMonths(String value) => "$value meses";
@override
String inDays(String value) => "$value días";
@override
String inYears(String value) => "$value años";
@override
String noFiresAroundThisArea(String kmAround) => "No hay fuegos a $kmAround км a la redonda";
@override
String activeFiresWorldWide(String activeFires) => "$activeFires fuegos activos en el mundo";
@override
String firesAroundThisArea(String numFires, String kmAround) => "$numFires fuegos a $kmAround км a la redonda";
@override
String appLicense(String thisYear) => "(c) 2017-$thisYear Asociación Comunes bajo licencia GNU Affero GPL v3";
@ -171,6 +176,10 @@ class es extends S {
@override
String updatedLastCheck(String lastCheck) => "Actualizado $lastCheck";
@override
String inDays(String value) => "$value días";
@override
String activeFiresWorldWide(String activeFires) => "$activeFires fuegos activos en el mundo";
@override
String inSomething(String something) => "en $something";
@override
String inMinutes(String value) => "$value minutos";

View file

@ -2,6 +2,7 @@ import 'package:comunes_flutter/comunes_flutter.dart';
import 'package:flutter/material.dart';
import 'activeFires.dart';
import 'fireAlert.dart';
import 'colors.dart';
import 'generated/i18n.dart';
import 'mainDrawer.dart';
@ -45,7 +46,7 @@ class HomePage extends StatelessWidget {
child: FloatingActionButton.extended(
elevation: 0.0,
onPressed: () {
Navigator.pushNamed(context, ActiveFiresPage.routeName);
Navigator.pushNamed(context, FireAlert.routeName);
},
heroTag: 'notifyFire',
backgroundColor: fires600,

View file

@ -7,6 +7,7 @@ import 'globals.dart' as globals;
import 'generated/i18n.dart';
import 'package:comunes_flutter/comunes_flutter.dart';
import 'privacyPage.dart';
import 'fireAlert.dart';
class MainDrawer extends Drawer {
MainDrawer(BuildContext context, {key})
@ -58,7 +59,7 @@ Widget mainDrawer(BuildContext context) {
onTap: () {
// Then close the drawer
Navigator.pop(context);
Navigator.pushNamed(context, Sandbox.routeName);
Navigator.pushNamed(context, FireAlert.routeName);
},
),
new Divider(),

View file

@ -17,11 +17,13 @@ dependencies:
flutter_simple_dependency_injection: "^0.0.2"
sentry: "^2.0.2"
flutter_markdown: "^0.1.5"
url_launcher: "^3.0.2"
# net
http: "^0.11.3+16"
jaguar_resty: "^2.5.5"
connectivity: "^0.3.1"
share: "^0.5.2"
# data
json_annotation: ^0.2.3
@ -56,12 +58,9 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: "^0.1.2"
community_material_icon: "^0.1.2"
# not using yet
# community_material_icon: "^0.1.2"
# url_launcher: "^3.0.2"
# share: "^0.5.2"
# package_info: "^0.3.2"
dev_dependencies:

View file

@ -45,5 +45,8 @@
"inSomething": "in $something",
"SAVE": "SAVE",
"CANCEL": "CANCEL",
"privacyPolicy": "Privacy Policy"
"privacyPolicy": "Privacy Policy",
"errorFirePlaceDialog": "We couldn't get the location of the fire",
"callEmergencyServicesDescription": "You can call 112 if you have not already done so to notify the emergency services.",
"tweetAboutAFireDescription": "Additionally if you use twitter you can notify them with additional information, for example, attaching photos to the tweet if you have good visibility of the fire, when you took the photos, exact location, etc. Use #hashtags type #IFMinicipalTerminal for example #IFJumilla (Forest Fire in Jumilla)."
}

View file

@ -45,5 +45,8 @@
"inSomething": "en $something",
"SAVE": "GUARDAR",
"CANCEL": "CANCELAR",
"privacyPolicy": "Política de Privacidad"
"privacyPolicy": "Política de Privacidad",
"errorFirePlaceDialog": "No hemos podido obtener la ubicación del fuego",
"callEmergencyServicesDescription": "Puedes llamar al 112 si no lo has hecho ya para avisar a los servicios de emergencia.",
"tweetAboutAFireDescription": "Adicionalmente si usas twitter puedes notificarles con información adicional, por ejemplo, adjuntando fotos al tweet si tienes buena visibilidad del fuego, cuando tomaste las fotos, ubicación exacta, etc. Usa #hashtags tipo #IFTerminoMunicipal por ejemplo #IFJumilla (Incendio Forestal en Jumilla)."
}