Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • android/org.benoitharrault.scrobbles
1 result
Show changes
Commits on Source (4)
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
app.versionName=0.0.42
app.versionCode=42
app.versionName=0.0.44
app.versionCode=44
Auto save settings.
Fix parse heatmap data.
Sauvegarde automatique du paramétrage.
Correction sur le traitement des données de la heatmap.
......@@ -13,10 +13,6 @@ class DataHeatmapCubit extends HydratedCubit<DataHeatmapState> {
emit(state);
}
HeatmapData? getValue() {
return state.heatmap;
}
void update(HeatmapData? heatmapData) {
if ((heatmapData != null) && (state.heatmap.toString() != heatmapData.toString())) {
setValue(heatmapData);
......
......@@ -31,9 +31,8 @@ class HeatmapData {
this.data.keys.forEach((day) {
Map<String, int> dayMap = {};
this.data.keys.forEach((hour) {
int? value = this.data[day]?[hour];
dayMap[hour.toString()] = value != null ? value.toInt() : 0;
this.data[day]?.forEach((hour, count) {
dayMap[hour.toString()] = count;
});
map[day.toString()] = dayMap;
});
......
......@@ -30,7 +30,7 @@ class CardHeatmap extends StatelessWidget {
'daysCount': daysCount.toString(),
},
),
loader: updateCountsByHour(daysCount),
loader: updateHeatmapData(daysCount),
content: ChartHeatmap(
chartData: heatmap,
),
......@@ -39,7 +39,7 @@ class CardHeatmap extends StatelessWidget {
);
}
Widget updateCountsByHour(int daysCount) {
Widget updateHeatmapData(int daysCount) {
final Widget loading = const Text('⏳');
final Widget done = const Text('');
......
import 'dart:math';
import 'package:easy_localization/easy_localization.dart';
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
......
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:unicons/unicons.dart';
import 'package:scrobbles/config/default_settings.dart';
import 'package:scrobbles/cubit/settings_cubit.dart';
......@@ -116,6 +115,7 @@ class _SettingsFormState extends State<SettingsForm> {
_selectedDiscoveriesDaysCount[i] = i == index;
}
});
saveSettings();
},
borderRadius: const BorderRadius.all(Radius.circular(8)),
constraints: const BoxConstraints(minHeight: 30.0, minWidth: 30.0),
......@@ -139,6 +139,7 @@ class _SettingsFormState extends State<SettingsForm> {
_selectedDistributionDaysCount[i] = i == index;
}
});
saveSettings();
},
borderRadius: const BorderRadius.all(Radius.circular(8)),
constraints: const BoxConstraints(minHeight: 30.0, minWidth: 30.0),
......@@ -162,6 +163,7 @@ class _SettingsFormState extends State<SettingsForm> {
_selectedStatisticsRecentDaysCount[i] = i == index;
}
});
saveSettings();
},
borderRadius: const BorderRadius.all(Radius.circular(8)),
constraints: const BoxConstraints(minHeight: 30.0, minWidth: 30.0),
......@@ -185,6 +187,7 @@ class _SettingsFormState extends State<SettingsForm> {
_selectedTimelineDaysCount[i] = i == index;
}
});
saveSettings();
},
borderRadius: const BorderRadius.all(Radius.circular(8)),
constraints: const BoxConstraints(minHeight: 30.0, minWidth: 30.0),
......@@ -208,6 +211,7 @@ class _SettingsFormState extends State<SettingsForm> {
_selectedTopArtistsDaysCount[i] = i == index;
}
});
saveSettings();
},
borderRadius: const BorderRadius.all(Radius.circular(8)),
constraints: const BoxConstraints(minHeight: 30.0, minWidth: 30.0),
......@@ -218,18 +222,18 @@ class _SettingsFormState extends State<SettingsForm> {
),
// Save
ElevatedButton(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Icon(UniconsLine.save),
SizedBox(width: 8),
Text('settings_button_save').tr(),
],
),
onPressed: () => saveSettings(),
),
// ElevatedButton(
// child: Row(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Icon(UniconsLine.save),
// SizedBox(width: 8),
// Text('settings_button_save').tr(),
// ],
// ),
// onPressed: () => saveSettings(),
// ),
],
);
}
......
......@@ -3,7 +3,7 @@ description: Display scrobbles data and charts
publish_to: 'none'
version: 0.0.42+42
version: 0.0.44+44
environment:
sdk: '^3.0.0'
......