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

Avoid print calls in production code

parent 86a2fbb0
No related branches found
No related tags found
1 merge request!58Resolve "Avoid print calls in production code"
Pipeline #5257 passed
This commit is part of merge request !58. Comments created here will be created in the context of that merge request.
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
app.versionName=0.0.54
app.versionCode=54
app.versionName=0.0.55
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 {
}
Widget getVerticalTitlesWidgetWithValue(double value, TitleMeta meta) {
String suffix =
verticalAxisTitleSuffix != '' ? ' $verticalAxisTitleSuffix' : '';
String suffix = verticalAxisTitleSuffix != '' ? ' $verticalAxisTitleSuffix' : '';
return SideTitleWidget(
axisSide: meta.axisSide,
......
......@@ -43,11 +43,9 @@ class ChartCountsByDay extends CustomBarChart {
double maxValue = 0;
for (var key in chartData.data.keys) {
double? counts = chartData.data[key];
if (counts != null) {
if (counts > maxValue) {
maxValue = counts;
}
double counts = chartData.data[key] ?? 0;
if (counts > maxValue) {
maxValue = counts;
}
}
......
......@@ -45,11 +45,9 @@ class ChartCountsByHour extends CustomBarChart {
double maxValue = 0;
for (var key in chartData.data.keys) {
double? counts = chartData.data[key];
if (counts != null) {
if (counts > maxValue) {
maxValue = counts;
}
double counts = chartData.data[key] ?? 0;
if (counts > maxValue) {
maxValue = counts;
}
}
......
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:scrobbles/utils/tools.dart';
class ShowErrorWidget extends StatelessWidget {
const ShowErrorWidget({super.key, required this.message});
......@@ -8,7 +10,7 @@ class ShowErrorWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
print(message);
printlog(message);
return Text(
'⚠️ ${tr(message)}',
......
import 'package:flutter/foundation.dart';
void printlog(String message) {
if (!kReleaseMode) {
debugPrint(message);
}
}
......@@ -300,10 +300,10 @@ packages:
dependency: transitive
description:
name: provider
sha256: "9a96a0a19b594dbc5bf0f1f27d2bc67d5f95957359b461cd9feb44ed6ae75096"
sha256: c8a055ee5ce3fd98d6fc872478b03823ffdb448699c6ebdbbc71d59b596fd48c
url: "https://pub.dev"
source: hosted
version: "6.1.1"
version: "6.1.2"
shared_preferences:
dependency: transitive
description:
......
......@@ -3,7 +3,7 @@ description: Display scrobbles data and charts
publish_to: 'none'
version: 0.0.54+54
version: 0.0.55+55
environment:
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