Skip to content
Snippets Groups Projects
Commit 7bfb4165 authored by Benoît Harrault's avatar Benoît Harrault
Browse files

Merge branch '62-avoid-print-calls-in-production-code' into 'master'

Resolve "Avoid print calls in production code"

Closes #62

See merge request !58
parents 86a2fbb0 3dfc4694
No related branches found
Tags Release_0.0.55_55
1 merge request!58Resolve "Avoid print calls in production code"
Pipeline #5336 passed
org.gradle.jvmargs=-Xmx1536M org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true android.useAndroidX=true
android.enableJetifier=true android.enableJetifier=true
app.versionName=0.0.54 app.versionName=0.0.55
app.versionCode=54 app.versionCode=55
Avoid print calls in production code.
Supprime les appels à print dans le code de production.
...@@ -216,8 +216,7 @@ class CustomChart extends StatelessWidget { ...@@ -216,8 +216,7 @@ class CustomChart extends StatelessWidget {
} }
Widget getVerticalTitlesWidgetWithValue(double value, TitleMeta meta) { Widget getVerticalTitlesWidgetWithValue(double value, TitleMeta meta) {
String suffix = String suffix = verticalAxisTitleSuffix != '' ? ' $verticalAxisTitleSuffix' : '';
verticalAxisTitleSuffix != '' ? ' $verticalAxisTitleSuffix' : '';
return SideTitleWidget( return SideTitleWidget(
axisSide: meta.axisSide, axisSide: meta.axisSide,
......
...@@ -43,11 +43,9 @@ class ChartCountsByDay extends CustomBarChart { ...@@ -43,11 +43,9 @@ class ChartCountsByDay extends CustomBarChart {
double maxValue = 0; double maxValue = 0;
for (var key in chartData.data.keys) { for (var key in chartData.data.keys) {
double? counts = chartData.data[key]; double counts = chartData.data[key] ?? 0;
if (counts != null) { if (counts > maxValue) {
if (counts > maxValue) { maxValue = counts;
maxValue = counts;
}
} }
} }
......
...@@ -45,11 +45,9 @@ class ChartCountsByHour extends CustomBarChart { ...@@ -45,11 +45,9 @@ class ChartCountsByHour extends CustomBarChart {
double maxValue = 0; double maxValue = 0;
for (var key in chartData.data.keys) { for (var key in chartData.data.keys) {
double? counts = chartData.data[key]; double counts = chartData.data[key] ?? 0;
if (counts != null) { if (counts > maxValue) {
if (counts > maxValue) { maxValue = counts;
maxValue = counts;
}
} }
} }
......
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:scrobbles/utils/tools.dart';
class ShowErrorWidget extends StatelessWidget { class ShowErrorWidget extends StatelessWidget {
const ShowErrorWidget({super.key, required this.message}); const ShowErrorWidget({super.key, required this.message});
...@@ -8,7 +10,7 @@ class ShowErrorWidget extends StatelessWidget { ...@@ -8,7 +10,7 @@ class ShowErrorWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
print(message); printlog(message);
return Text( return Text(
'⚠️ ${tr(message)}', '⚠️ ${tr(message)}',
......
import 'package:flutter/foundation.dart';
void printlog(String message) {
if (!kReleaseMode) {
debugPrint(message);
}
}
...@@ -300,10 +300,10 @@ packages: ...@@ -300,10 +300,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: provider name: provider
sha256: "9a96a0a19b594dbc5bf0f1f27d2bc67d5f95957359b461cd9feb44ed6ae75096" sha256: c8a055ee5ce3fd98d6fc872478b03823ffdb448699c6ebdbbc71d59b596fd48c
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "6.1.1" version: "6.1.2"
shared_preferences: shared_preferences:
dependency: transitive dependency: transitive
description: description:
......
...@@ -3,7 +3,7 @@ description: Display scrobbles data and charts ...@@ -3,7 +3,7 @@ description: Display scrobbles data and charts
publish_to: 'none' publish_to: 'none'
version: 0.0.54+54 version: 0.0.55+55
environment: environment:
sdk: '^3.0.0' sdk: '^3.0.0'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment