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
Branches
Tags
1 merge request!58Resolve "Avoid print calls in production code"
Pipeline #5257 passed
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,13 +43,11 @@ class ChartCountsByDay extends CustomBarChart {
double maxValue = 0;
for (var key in chartData.data.keys) {
double? counts = chartData.data[key];
if (counts != null) {
double counts = chartData.data[key] ?? 0;
if (counts > maxValue) {
maxValue = counts;
}
}
}
return maxValue;
}
......
......@@ -45,13 +45,11 @@ class ChartCountsByHour extends CustomBarChart {
double maxValue = 0;
for (var key in chartData.data.keys) {
double? counts = chartData.data[key];
if (counts != null) {
double counts = chartData.data[key] ?? 0;
if (counts > maxValue) {
maxValue = counts;
}
}
}
return maxValue;
}
......
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.
Please register or to comment