Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task #301 Switches daily vs total numbers #306

Merged
merged 1 commit into from
Mar 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/generated/intl/messages_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class MessageLookup extends MessageLookupByLibrary {
"male" : MessageLookupByLibrary.simpleMessage("Masculino"),
"measuresHomepageButton" : MessageLookupByLibrary.simpleMessage("Medidas excecionais de resposta À COVID-19"),
"measuresPageMeasures" : MessageLookupByLibrary.simpleMessage("Medidas Excecionais"),
"newPlural" : MessageLookupByLibrary.simpleMessage("Novos"),
"newPlural" : MessageLookupByLibrary.simpleMessage("Total"),
"noConnection" : MessageLookupByLibrary.simpleMessage("Sem conexão"),
"notificationsPageDescription" : MessageLookupByLibrary.simpleMessage("Que notificações vai receber?\nInformações importantes sobre atualização dos dados constantes nesta aplicação e avisos/alertas das entidades oficiais."),
"notificationsPageOpenSettings" : MessageLookupByLibrary.simpleMessage("Abrir definições"),
Expand Down
8 changes: 4 additions & 4 deletions lib/generated/l10n.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"noConnection": "Sem conexão",
"buttonTryAgain": "Tentar novamente",
"cannotConnectInternetDescription": "Não conseguimos aceder à Internet para obter os dados mais recentes. Verifica a tua conexão.",
"newPlural": "Novos",
"newPlural": "Total",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

"seeDetails": "Ver Detalhes",
"publishedAt": "Publicada às",
"dateOf": "de",
Expand Down
12 changes: 6 additions & 6 deletions lib/ui/screens/statistics/components/statistics_horizontal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ class StatisticHorizontalWidget extends StatelessWidget {
final String label;
final int value;
final double percentage;
final int absolute;
final String absoluteLabel;
final int secondaryValue;
final String secondaryValueLabel;
final VoidCallback onTap;

StatisticHorizontalWidget({
@required this.label,
@required this.value,
@required this.percentage,
@required this.absolute,
this.absoluteLabel,
@required this.secondaryValue,
this.secondaryValueLabel,
@required this.onTap,
});

Expand Down Expand Up @@ -68,8 +68,8 @@ class StatisticHorizontalWidget extends StatelessWidget {
child: Container(
padding: const EdgeInsets.only(left: 17.0),
alignment: Alignment.centerLeft,
child: StatisticsNewAbsolute(
value: absolute, label: absoluteLabel),
child: StatisticsTotal(
value: secondaryValue, label: secondaryValueLabel),
),
),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import 'package:covid19mobile/ui/screens/statistics/components/statistics_square
import 'package:flutter/material.dart';

/// Statistics widget to show a squared new absolute values
class StatisticsNewAbsolute extends StatelessWidget {
class StatisticsTotal extends StatelessWidget {
final int value;
final String label;

StatisticsNewAbsolute({@required this.value, this.label});
StatisticsTotal({@required this.value, this.label});

@override
Widget build(BuildContext context) {
Expand All @@ -36,7 +36,7 @@ class StatisticsNewAbsolute extends StatelessWidget {
width: 3,
),
Text(
(label == null) ? S.of(context).newPlural : label,
(label == null) ? S.of(context).total : label,
style: TextStyles.h3Number(),
)
],
Expand Down
6 changes: 3 additions & 3 deletions lib/ui/screens/statistics/components/statistics_vertical.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class StatisticVerticalWidget extends StatelessWidget {
final String label;
final double percentage;
final int value;
final int valueDifference;
final int secondaryValue;
final VoidCallback onTap;
final bool shouldWrapContent;

Expand All @@ -41,7 +41,7 @@ class StatisticVerticalWidget extends StatelessWidget {
@required this.value,

///Absolute different of the value with the previous day
@required this.valueDifference,
@required this.secondaryValue,

/// Adds a possible callback on tap
this.onTap,
Expand Down Expand Up @@ -71,7 +71,7 @@ class StatisticVerticalWidget extends StatelessWidget {
),
Container(
margin: const EdgeInsets.only(bottom: 8.0),
child: StatisticsNewAbsolute(value: valueDifference)),
child: StatisticsTotal(value: secondaryValue)),
SeeDetailsWidget()
],
),
Expand Down
14 changes: 7 additions & 7 deletions lib/ui/screens/statistics/statistics_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ class _StatisticsPageState extends BaseState<StatisticsPage, AppBloc> {
// Horizontal - Confirmed Cases
StatisticHorizontalWidget(
label: S.of(context).statisticsPageConfirmed,
value: currentStatistics.confirmed,
value: currentStatistics.confirmedAbsolut,
percentage: currentStatistics.confirmedPercentage,
absolute: currentStatistics.confirmedAbsolut,
secondaryValue: currentStatistics.confirmed,
onTap: () {
Navigator.pushNamed(context, routeStatisticsConfirmed);
},
Expand All @@ -80,9 +80,9 @@ class _StatisticsPageState extends BaseState<StatisticsPage, AppBloc> {
Expanded(
child: StatisticVerticalWidget(
label: S.of(context).statisticsPageDeaths,
value: currentStatistics.death,
value: currentStatistics.deathAbsolute,
percentage: currentStatistics.deathPercentage,
valueDifference: currentStatistics.deathAbsolute,
secondaryValue: currentStatistics.death,
shouldWrapContent:
_shouldWrapContentBasedOnScreenWith(context),
onTap: () {
Expand All @@ -103,7 +103,7 @@ class _StatisticsPageState extends BaseState<StatisticsPage, AppBloc> {
label: S.of(context).statisticsPageRecovered,
value: currentStatistics.recovered,
percentage: currentStatistics.recoveredPercentage,
valueDifference:
secondaryValue:
currentStatistics.recoveredAbsolute,
shouldWrapContent:
_shouldWrapContentBasedOnScreenWith(context),
Expand All @@ -121,8 +121,8 @@ class _StatisticsPageState extends BaseState<StatisticsPage, AppBloc> {
label: S.of(context).statisticsPageHospitalized,
value: currentStatistics.hospitalized,
percentage: currentStatistics.hospitalizedPercentage,
absolute: currentStatistics.hospitalizedUCI,
absoluteLabel:
secondaryValue: currentStatistics.hospitalizedUCI,
secondaryValueLabel:
S.of(context).statisticsPageHospitalizedUCI,
onTap: () {
Navigator.pushNamed(
Expand Down