Skip to content

Commit

Permalink
Merge pull request #223 from covid19cuba/release/v0.7.1
Browse files Browse the repository at this point in the history
Release v0.7.1
  • Loading branch information
leynier authored May 4, 2020
2 parents 50fecf4 + a479920 commit 95a7cf6
Show file tree
Hide file tree
Showing 18 changed files with 521 additions and 600 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Covid19 Cuba Data Mobile Application Changelog

## [0.7.1] - May 4, 2020

### Added

* Information button in top right of the charts.

### Fixed

* Links in update page.

## [0.7.0] - May 3, 2020

### Added
Expand Down
14 changes: 6 additions & 8 deletions lib/src/pages/update_page.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import 'dart:developer';

import 'package:covid19cuba/src/data_providers/data_providers.dart';
import 'package:covid19cuba/src/models/models.dart';
import 'package:getflutter/getflutter.dart';
import 'package:flutter/material.dart';
import 'package:package_info/package_info.dart';
import 'package:preferences/preference_service.dart';

import 'package:covid19cuba/src/data_providers/data_providers.dart';
import 'package:covid19cuba/src/models/models.dart';
import 'package:covid19cuba/src/pages/pages.dart';
import 'package:covid19cuba/src/utils/utils.dart';
import 'package:covid19cuba/src/widgets/widgets.dart';
import 'package:package_info/package_info.dart';
import 'package:preferences/preference_service.dart';

class UpdatePage extends StatefulWidget {
final bool first;
Expand Down Expand Up @@ -123,9 +123,8 @@ class UpdatePageState extends State<UpdatePage> {
TouchableUrlImage(
Constants.apklisBanner,
() async {
var packageInfo = await PackageInfo.fromPlatform();
var apklisUrl =
'https://archive.apklis.cu/application/apk/club.postdata.covid19cuba-v${packageInfo.buildNumber}.apk';
'https://www.apklis.cu/application/club.postdata.covid19cuba';
getUrl(apklisUrl);
},
leftMargin: 50,
Expand All @@ -152,9 +151,8 @@ class UpdatePageState extends State<UpdatePage> {
TouchableUrlImage(
Constants.githubBanner,
() async {
var packageInfo = await PackageInfo.fromPlatform();
var gitHubUrl =
'https://github.com/covid19cuba/covid19cuba-app/releases/download/v${packageInfo.version}/app.apk';
'https://github.com/covid19cuba/covid19cuba-app/releases';
getUrl(gitHubUrl);
},
leftMargin: 50,
Expand Down
10 changes: 8 additions & 2 deletions lib/src/utils/notifications.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import 'dart:developer';
import 'package:background_fetch/background_fetch.dart';
import 'package:demoji/demoji.dart';
import 'package:preferences/preferences.dart';
import 'package:timezone/timezone.dart';
import 'package:timezone/data/latest.dart' as tz;

import 'package:covid19cuba/src/models/models.dart';
import 'package:covid19cuba/src/utils/utils.dart';

Expand Down Expand Up @@ -90,7 +93,7 @@ Future<void> showClaps() async {
id: Constants.clapsNotification,
title: 'Tiempo de aplausos!!!!!' + claps,
body:
'Ya casi son las 9 de la noche. Súmate a los aplausos por quienes trabajan por la salud y seguridad de todos. \n' +
'Ya casi es la hora de los aplausos. Súmate al agradecimiento para quienes trabajan por la salud y seguridad de todos. \n' +
claps +
claps,
);
Expand All @@ -103,7 +106,10 @@ bool timeToShowNotifications() {
}

bool clapsTime() {
DateTime date = DateTime.now();
tz.initializeTimeZones();
final havana = getLocation('America/Havana');
final havanaTime = new TZDateTime.now(havana);
DateTime date = havanaTime;

return date.hour >= Constants.startClapsHour &&
date.minute >= Constants.startClapsMinute &&
Expand Down
65 changes: 22 additions & 43 deletions lib/src/widgets/comparison_widget.dart
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import 'dart:math';
import 'dart:developer' as dev;

import 'package:charts_flutter/flutter.dart' as charts;
import 'package:country_pickers/country.dart';
import 'package:country_pickers/country_pickers.dart';
import 'package:flutter/material.dart';
import 'package:flutter_linkify/flutter_linkify.dart';
import 'package:preferences/preferences.dart';
import 'package:url_launcher/url_launcher.dart';

import 'package:covid19cuba/src/utils/utils.dart';
import 'package:covid19cuba/src/models/models.dart';
import 'package:covid19cuba/src/utils/utils.dart';
import 'package:covid19cuba/src/widgets/widgets.dart';

class ComparisonWidget extends StatefulWidget {
final ComparisonOfAccumulatedCases comparisonOfAccumulatedCases;
Expand Down Expand Up @@ -325,16 +323,27 @@ class ComparisonWidgetState extends State<ComparisonWidget> {
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 20, right: 20, top: 20),
child: Center(
child: Text(
'Comparación de Cuba',
textAlign: TextAlign.center,
style: TextStyle(
color: Constants.primaryColor,
fontWeight: FontWeight.bold,
fontSize: 18,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Expanded(
child: Text(
'Comparación de Cuba',
textAlign: TextAlign.center,
maxLines: 3,
style: TextStyle(
color: Constants.primaryColor,
fontWeight: FontWeight.bold,
fontSize: 18,
),
),
),
),
InfoDialogWidget(
title: 'Comparación de Cuba',
text: getFooter(),
)
],
),
),
Container(
Expand Down Expand Up @@ -484,36 +493,6 @@ class ComparisonWidgetState extends State<ComparisonWidget> {
),
),
),
Container(
margin: EdgeInsets.only(
left: 20,
right: 20,
top: 20,
bottom: 20,
),
child: Center(
child: Linkify(
text: getFooter(),
options: LinkifyOptions(humanize: true),
textAlign: TextAlign.center,
style: TextStyle(
color: Constants.primaryColor,
fontSize: 12,
),
linkStyle: TextStyle(
color: Constants.primaryColor,
fontSize: 12,
),
onOpen: (link) async {
if (await canLaunch(link.url)) {
await launch(link.url);
} else {
dev.log('Could not launch $link');
}
},
),
),
),
],
);
}
Expand Down
100 changes: 32 additions & 68 deletions lib/src/widgets/curves_evolution.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import 'dart:math';
import 'dart:developer' as dev;

import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
import 'package:flutter_linkify/flutter_linkify.dart';
import 'package:getflutter/getflutter.dart';
import 'package:random_color/random_color.dart';
import 'package:searchable_dropdown/searchable_dropdown.dart';
import 'package:url_launcher/url_launcher.dart';

import 'package:covid19cuba/src/utils/utils.dart';
import 'package:covid19cuba/src/widgets/widgets.dart';

class CurvesEvolutionWidget extends StatefulWidget {
final Map<String, dynamic> curvesEvolution;
Expand Down Expand Up @@ -77,39 +75,37 @@ class CurvesEvolutionWidgetState extends State<CurvesEvolutionWidget> {
right: 20,
top: 20,
),
child: Center(
child: Text(
'Evolución de la epidemia (paises seleccionados)',
textAlign: TextAlign.center,
style: TextStyle(
color: Constants.primaryColor,
fontWeight: FontWeight.bold,
fontSize: 18,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Expanded(
child: Text(
'Evolución de la epidemia (paises seleccionados)',
textAlign: TextAlign.center,
maxLines: 3,
style: TextStyle(
color: Constants.primaryColor,
fontWeight: FontWeight.bold,
fontSize: 18,
),
),
),
),
),
),
Container(
margin: EdgeInsets.only(
left: 20,
right: 20,
top: 20,
),
child: Center(
child: Text(
'El gráfico muestra a partir de 30 casos, en escala logarítmica '
'y agrupados cada siete días, los casos nuevos por el total '
'de casos confirmados de cada país. De esta manera, los países '
'mientras siguen una línea recta están en un crecimiento '
'exponencial y cuando se desvían de la recta comienzan a salir '
'del comportamiento exponencial.',
textAlign: TextAlign.center,
style: TextStyle(
color: Constants.primaryColor,
fontWeight: FontWeight.normal,
fontSize: 12,
),
),
InfoDialogWidget(
title: 'Evolución de la epidemia (paises seleccionados)',
text: 'El gráfico muestra a partir de 30 casos, en escala '
'logarítmica y agrupados cada siete días, los casos '
'nuevos por el total de casos confirmados de cada país. '
'De esta manera, los países mientras siguen una línea '
'recta están en un crecimiento exponencial y cuando '
'se desvían de la recta comienzan a salir '
'del comportamiento exponencial.\n\n'
'Datos de los países tomados '
'de\nhttps://github.com/pomber/covid19\ny '
'actualizado el '
'${updated.toStrPlus()}',
)
],
),
),
Container(
Expand Down Expand Up @@ -232,6 +228,7 @@ class CurvesEvolutionWidgetState extends State<CurvesEvolutionWidget> {
left: 20,
right: 20,
top: 20,
bottom: 20,
),
child: GFButton(
text: 'Seleccionar países iniciales',
Expand All @@ -255,39 +252,6 @@ class CurvesEvolutionWidgetState extends State<CurvesEvolutionWidget> {
},
),
),
Container(
margin: EdgeInsets.only(
left: 20,
right: 20,
top: 20,
bottom: 20,
),
child: Center(
child: Linkify(
text: 'Datos de los países tomados '
'de\nhttps://github.com/pomber/covid19\ny '
'actualizado el '
'${updated.toStrPlus()}',
options: LinkifyOptions(humanize: true),
textAlign: TextAlign.center,
style: TextStyle(
color: Constants.primaryColor,
fontSize: 12,
),
linkStyle: TextStyle(
color: Constants.primaryColor,
fontSize: 12,
),
onOpen: (link) async {
if (await canLaunch(link.url)) {
await launch(link.url);
} else {
dev.log('Could not launch $link');
}
},
),
),
),
],
);
}
Expand Down
Loading

0 comments on commit 95a7cf6

Please sign in to comment.