Skip to content
Snippets Groups Projects
Commit 3b5067fa 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
No related merge requests found
Pipeline #5249 passed
......@@ -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:
......
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