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

Merge branch '60-use-flutter-linter-and-apply-lints' into 'master'

Resolve "Use flutter linter and apply lints"

Closes #60

See merge request !56
parents fadd6108 bec180f9
No related branches found
Tags Release_0.0.53_53
1 merge request!56Resolve "Use flutter linter and apply lints"
Pipeline #5120 passed
...@@ -5,14 +5,15 @@ import 'package:flutter/material.dart'; ...@@ -5,14 +5,15 @@ import 'package:flutter/material.dart';
import 'package:scrobbles/config/app_colors.dart'; import 'package:scrobbles/config/app_colors.dart';
import 'package:scrobbles/models/heatmap.dart'; import 'package:scrobbles/models/heatmap.dart';
import 'package:scrobbles/ui/widgets/abstracts/custom_chart.dart'; import 'package:scrobbles/ui/widgets/abstracts/custom_chart.dart';
import 'package:scrobbles/utils/color_extensions.dart';
class ChartHeatmap extends CustomChart { class ChartHeatmap extends CustomChart {
final HeatmapData chartData; final HeatmapData chartData;
const ChartHeatmap({super.key, required this.chartData}); const ChartHeatmap({super.key, required this.chartData});
@override
final double chartHeight = 150.0; final double chartHeight = 150.0;
@override
final double titleFontSize = 9; final double titleFontSize = 9;
final Color baseColor = AppColors.contentColorPink; final Color baseColor = AppColors.contentColorPink;
final double scale = 8.0; final double scale = 8.0;
...@@ -20,9 +21,9 @@ class ChartHeatmap extends CustomChart { ...@@ -20,9 +21,9 @@ class ChartHeatmap extends CustomChart {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (this.chartData.data.keys.length == 0) { if (chartData.data.keys.isEmpty) {
return SizedBox( return SizedBox(
height: this.chartHeight, height: chartHeight,
); );
} }
...@@ -36,7 +37,7 @@ class ChartHeatmap extends CustomChart { ...@@ -36,7 +37,7 @@ class ChartHeatmap extends CustomChart {
minY: 0, minY: 0,
maxY: 7, maxY: 7,
borderData: FlBorderData(show: false), borderData: FlBorderData(show: false),
gridData: FlGridData(show: false), gridData: const FlGridData(show: false),
titlesData: getTitlesData(), titlesData: getTitlesData(),
scatterTouchData: ScatterTouchData(enabled: false), scatterTouchData: ScatterTouchData(enabled: false),
), ),
...@@ -54,7 +55,7 @@ class ChartHeatmap extends CustomChart { ...@@ -54,7 +55,7 @@ class ChartHeatmap extends CustomChart {
int getMaxCount() { int getMaxCount() {
int maxValue = 0; int maxValue = 0;
this.chartData.data.forEach((day, hours) { chartData.data.forEach((day, hours) {
hours.forEach((hour, count) { hours.forEach((hour, count) {
if (count > maxValue) { if (count > maxValue) {
maxValue = count; maxValue = count;
...@@ -70,7 +71,7 @@ class ChartHeatmap extends CustomChart { ...@@ -70,7 +71,7 @@ class ChartHeatmap extends CustomChart {
final int maxCount = getMaxCount(); final int maxCount = getMaxCount();
this.chartData.data.forEach((day, hours) { chartData.data.forEach((day, hours) {
hours.forEach((hour, count) { hours.forEach((hour, count) {
double normalizedValue = count / maxCount; double normalizedValue = count / maxCount;
...@@ -89,8 +90,9 @@ class ChartHeatmap extends CustomChart { ...@@ -89,8 +90,9 @@ class ChartHeatmap extends CustomChart {
return spots; return spots;
} }
@override
FlTitlesData getTitlesData() { FlTitlesData getTitlesData() {
const AxisTitles none = const AxisTitles( const AxisTitles none = AxisTitles(
sideTitles: SideTitles(showTitles: false), sideTitles: SideTitles(showTitles: false),
); );
...@@ -121,6 +123,7 @@ class ChartHeatmap extends CustomChart { ...@@ -121,6 +123,7 @@ class ChartHeatmap extends CustomChart {
); );
} }
@override
Widget getVerticalTitlesWidgetWithValue(double value, TitleMeta meta) { Widget getVerticalTitlesWidgetWithValue(double value, TitleMeta meta) {
final String dayShortName = getDayShortName(8 - value.toInt()); final String dayShortName = getDayShortName(8 - value.toInt());
...@@ -131,7 +134,7 @@ class ChartHeatmap extends CustomChart { ...@@ -131,7 +134,7 @@ class ChartHeatmap extends CustomChart {
tr(dayShortName), tr(dayShortName),
style: TextStyle( style: TextStyle(
color: AppColors.mainTextColor1, color: AppColors.mainTextColor1,
fontSize: this.titleFontSize, fontSize: titleFontSize,
), ),
), ),
); );
......
...@@ -10,25 +10,26 @@ class ChartTimelineCounts extends CustomBarChart { ...@@ -10,25 +10,26 @@ class ChartTimelineCounts extends CustomBarChart {
const ChartTimelineCounts({super.key, required this.chartData}); const ChartTimelineCounts({super.key, required this.chartData});
@override
final double verticalTicksInterval = 50; final double verticalTicksInterval = 50;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (this.chartData.data.keys.length == 0) { if (chartData.data.keys.isEmpty) {
return SizedBox( return SizedBox(
height: this.chartHeight, height: chartHeight,
); );
} }
return Container( return SizedBox(
height: this.chartHeight, height: chartHeight,
child: LayoutBuilder( child: LayoutBuilder(
builder: (context, constraints) { builder: (context, constraints) {
final double maxWidth = constraints.maxWidth; final double maxWidth = constraints.maxWidth;
final int barsCount = this.chartData.data.keys.length; final int barsCount = chartData.data.keys.length;
return getBarChart( return getBarChart(
barWidth: this.getBarWidth(maxWidth, barsCount), barWidth: getBarWidth(maxWidth, barsCount),
backgroundColor: Theme.of(context).colorScheme.onSurface, backgroundColor: Theme.of(context).colorScheme.onSurface,
); );
}, },
...@@ -36,45 +37,48 @@ class ChartTimelineCounts extends CustomBarChart { ...@@ -36,45 +37,48 @@ class ChartTimelineCounts extends CustomBarChart {
); );
} }
@override
double getMaxCountsValue() { double getMaxCountsValue() {
double maxValue = 0; double maxValue = 0;
this.chartData.data.keys.forEach((key) { for (var key in chartData.data.keys) {
TimelineDataValue? value = this.chartData.data[key]; TimelineDataValue? value = chartData.data[key];
if (value != null) { if (value != null) {
double counts = value.counts.toDouble(); double counts = value.counts.toDouble();
if (counts > maxValue) { if (counts > maxValue) {
maxValue = counts; maxValue = counts;
} }
} }
}); }
return maxValue; return maxValue;
} }
@override
List<BarChartGroupData> getDataCounts(double barWidth) { List<BarChartGroupData> getDataCounts(double barWidth) {
List<BarChartGroupData> data = []; List<BarChartGroupData> data = [];
final barColor = AppColors.contentColorOrange; const barColor = AppColors.contentColorOrange;
this.chartData.data.keys.forEach((key) { for (var key in chartData.data.keys) {
TimelineDataValue? value = this.chartData.data[key]; TimelineDataValue? value = chartData.data[key];
if (value != null) { if (value != null) {
final int date = DateTime.parse(key).millisecondsSinceEpoch; final int date = DateTime.parse(key).millisecondsSinceEpoch;
final double counts = value.counts.toDouble(); final double counts = value.counts.toDouble();
data.add(this.getBarItem( data.add(getBarItem(
x: date, x: date,
values: [counts], values: [counts],
barColors: [barColor], barColors: [barColor],
barWidth: barWidth, barWidth: barWidth,
)); ));
} }
}); }
return data; return data;
} }
@override
Widget getVerticalLeftTitlesWidget(double value, TitleMeta meta) { Widget getVerticalLeftTitlesWidget(double value, TitleMeta meta) {
return getVerticalTitlesSpacerWidget(value, meta); return getVerticalTitlesSpacerWidget(value, meta);
} }
......
...@@ -11,23 +11,24 @@ class ChartTimelineEclecticism extends CustomLineChart { ...@@ -11,23 +11,24 @@ class ChartTimelineEclecticism extends CustomLineChart {
const ChartTimelineEclecticism({super.key, required this.chartData}); const ChartTimelineEclecticism({super.key, required this.chartData});
@override
final String verticalAxisTitleSuffix = '%'; final String verticalAxisTitleSuffix = '%';
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (this.chartData.data.keys.length == 0) { if (chartData.data.keys.isEmpty) {
return SizedBox( return SizedBox(
height: this.chartHeight, height: chartHeight,
); );
} }
final horizontalScale = getHorizontalScaleFromDates(this.chartData.data.keys); final horizontalScale = getHorizontalScaleFromDates(chartData.data.keys);
// Left/right margins: 12h, in milliseconds // Left/right margins: 12h, in milliseconds
const double margin = 12 * 60 * 60 * 1000; const double margin = 12 * 60 * 60 * 1000;
return Container( return SizedBox(
height: this.chartHeight, height: chartHeight,
child: LineChart( child: LineChart(
LineChartData( LineChartData(
lineBarsData: getDataEclecticism(), lineBarsData: getDataEclecticism(),
...@@ -48,17 +49,17 @@ class ChartTimelineEclecticism extends CustomLineChart { ...@@ -48,17 +49,17 @@ class ChartTimelineEclecticism extends CustomLineChart {
List<LineChartBarData> getDataEclecticism() { List<LineChartBarData> getDataEclecticism() {
List<FlSpot> spots = []; List<FlSpot> spots = [];
this.chartData.data.keys.forEach((element) { for (var element in chartData.data.keys) {
TimelineDataValue? value = this.chartData.data[element]; TimelineDataValue? value = chartData.data[element];
if (value != null) { if (value != null) {
final double date = DateTime.parse(element).millisecondsSinceEpoch.toDouble(); final double date = DateTime.parse(element).millisecondsSinceEpoch.toDouble();
final double eclecticism = value.eclecticism.toDouble(); final double eclecticism = value.eclecticism.toDouble();
spots.add(FlSpot(date, eclecticism)); spots.add(FlSpot(date, eclecticism));
} }
}); }
final baseColor = AppColors.contentColorCyan; const baseColor = AppColors.contentColorCyan;
final borderColor = baseColor.darken(20); final borderColor = baseColor.darken(20);
return [ return [
...@@ -73,6 +74,7 @@ class ChartTimelineEclecticism extends CustomLineChart { ...@@ -73,6 +74,7 @@ class ChartTimelineEclecticism extends CustomLineChart {
]; ];
} }
@override
Widget getVerticalRightTitlesWidget(double value, TitleMeta meta) { Widget getVerticalRightTitlesWidget(double value, TitleMeta meta) {
return getVerticalTitlesSpacerWidget(value, meta); return getVerticalTitlesSpacerWidget(value, meta);
} }
......
...@@ -54,7 +54,7 @@ class ChartTopArtists extends CustomChart { ...@@ -54,7 +54,7 @@ class ChartTopArtists extends CustomChart {
int index = 0; int index = 0;
this.chartData.topArtists.forEach((element) { for (var element in chartData.topArtists) {
final Color baseColor = getColorFromIndex(index++); final Color baseColor = getColorFromIndex(index++);
final PieChartSectionData item = PieChartSectionData( final PieChartSectionData item = PieChartSectionData(
...@@ -74,7 +74,7 @@ class ChartTopArtists extends CustomChart { ...@@ -74,7 +74,7 @@ class ChartTopArtists extends CustomChart {
); );
items.add(item); items.add(item);
}); }
return items; return items;
} }
...@@ -85,7 +85,7 @@ class ChartTopArtists extends CustomChart { ...@@ -85,7 +85,7 @@ class ChartTopArtists extends CustomChart {
List<Widget> items = []; List<Widget> items = [];
int index = 0; int index = 0;
this.chartData.topArtists.forEach((element) { for (var element in chartData.topArtists) {
final Color baseColor = getColorFromIndex(index++); final Color baseColor = getColorFromIndex(index++);
final Widget item = Row( final Widget item = Row(
...@@ -104,8 +104,8 @@ class ChartTopArtists extends CustomChart { ...@@ -104,8 +104,8 @@ class ChartTopArtists extends CustomChart {
), ),
const SizedBox(width: 4), const SizedBox(width: 4),
Text( Text(
element.artistName + ' (' + element.count.toString() + ')', '${element.artistName} (${element.count})',
style: TextStyle( style: const TextStyle(
fontSize: itemSize - 2, fontSize: itemSize - 2,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
...@@ -114,7 +114,7 @@ class ChartTopArtists extends CustomChart { ...@@ -114,7 +114,7 @@ class ChartTopArtists extends CustomChart {
); );
items.add(item); items.add(item);
}); }
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
......
...@@ -10,21 +10,23 @@ class ChartTopArtistsStream extends CustomLineChart { ...@@ -10,21 +10,23 @@ class ChartTopArtistsStream extends CustomLineChart {
const ChartTopArtistsStream({super.key, required this.chartData}); const ChartTopArtistsStream({super.key, required this.chartData});
@override
final double verticalTicksInterval = 10; final double verticalTicksInterval = 10;
@override
final String verticalAxisTitleSuffix = '%'; final String verticalAxisTitleSuffix = '%';
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (this.chartData.topArtistsStream.keys.isEmpty) { if (chartData.topArtistsStream.keys.isEmpty) {
return SizedBox( return SizedBox(
height: this.chartHeight, height: chartHeight,
); );
} }
final horizontalScale = getHorizontalScaleFromDates(this.chartData.topArtistsStream.keys); final horizontalScale = getHorizontalScaleFromDates(chartData.topArtistsStream.keys);
return Container( return SizedBox(
height: this.chartHeight, height: chartHeight,
child: LineChart( child: LineChart(
LineChartData( LineChartData(
lineBarsData: getDataStreamLine(), lineBarsData: getDataStreamLine(),
...@@ -35,7 +37,7 @@ class ChartTopArtistsStream extends CustomLineChart { ...@@ -35,7 +37,7 @@ class ChartTopArtistsStream extends CustomLineChart {
lineTouchData: const LineTouchData(enabled: false), lineTouchData: const LineTouchData(enabled: false),
minX: horizontalScale['min'], minX: horizontalScale['min'],
maxX: horizontalScale['max'], maxX: horizontalScale['max'],
maxY: getNextRoundNumber(getMaxVerticalValue(), this.verticalTicksInterval), maxY: getNextRoundNumber(getMaxVerticalValue(), verticalTicksInterval),
minY: 0, minY: 0,
), ),
duration: const Duration(milliseconds: 250), duration: const Duration(milliseconds: 250),
...@@ -46,27 +48,27 @@ class ChartTopArtistsStream extends CustomLineChart { ...@@ -46,27 +48,27 @@ class ChartTopArtistsStream extends CustomLineChart {
double getMaxVerticalValue() { double getMaxVerticalValue() {
double maxValue = 0; double maxValue = 0;
this.chartData.topArtistsStream.keys.forEach((dateAsString) { for (var dateAsString in chartData.topArtistsStream.keys) {
double totalValue = 0.0; double totalValue = 0.0;
final List<TopArtistsStreamDataValue> artists = final List<TopArtistsStreamDataValue> artists =
this.chartData.topArtistsStream[dateAsString] ?? []; chartData.topArtistsStream[dateAsString] ?? [];
artists.forEach((artist) { for (var artist in artists) {
final double value = artist.value; final double value = artist.value;
totalValue = totalValue + value; totalValue = totalValue + value;
}); }
if (totalValue > maxValue) { if (totalValue > maxValue) {
maxValue = totalValue; maxValue = totalValue;
} }
}); }
return maxValue; return maxValue;
} }
List<LineChartBarData> getDataStreamLine() { List<LineChartBarData> getDataStreamLine() {
final int artistsCount = final int artistsCount =
this.chartData.topArtistsStream[this.chartData.topArtistsStream.keys.first]?.length ?? chartData.topArtistsStream[chartData.topArtistsStream.keys.first]?.length ??
0; 0;
List<LineChartBarData> lines = []; List<LineChartBarData> lines = [];
...@@ -77,10 +79,10 @@ class ChartTopArtistsStream extends CustomLineChart { ...@@ -77,10 +79,10 @@ class ChartTopArtistsStream extends CustomLineChart {
List<FlSpot> spots = []; List<FlSpot> spots = [];
this.chartData.topArtistsStream.keys.forEach((dateAsString) { for (var dateAsString in chartData.topArtistsStream.keys) {
final double date = DateTime.parse(dateAsString).millisecondsSinceEpoch.toDouble(); final double date = DateTime.parse(dateAsString).millisecondsSinceEpoch.toDouble();
spots.add(FlSpot(date, 0)); spots.add(FlSpot(date, 0));
}); }
return LineChartBarData( return LineChartBarData(
color: borderColor, color: borderColor,
...@@ -98,11 +100,11 @@ class ChartTopArtistsStream extends CustomLineChart { ...@@ -98,11 +100,11 @@ class ChartTopArtistsStream extends CustomLineChart {
List<FlSpot> spots = []; List<FlSpot> spots = [];
this.chartData.topArtistsStream.keys.forEach((dateAsString) { for (var dateAsString in chartData.topArtistsStream.keys) {
final double date = DateTime.parse(dateAsString).millisecondsSinceEpoch.toDouble(); final double date = DateTime.parse(dateAsString).millisecondsSinceEpoch.toDouble();
List<TopArtistsStreamDataValue> artists = List<TopArtistsStreamDataValue> artists =
this.chartData.topArtistsStream[dateAsString] ?? []; chartData.topArtistsStream[dateAsString] ?? [];
double value = 0; double value = 0;
for (int i = 0; i <= index; i++) { for (int i = 0; i <= index; i++) {
...@@ -110,7 +112,7 @@ class ChartTopArtistsStream extends CustomLineChart { ...@@ -110,7 +112,7 @@ class ChartTopArtistsStream extends CustomLineChart {
} }
spots.add(FlSpot(date, value)); spots.add(FlSpot(date, value));
}); }
return LineChartBarData( return LineChartBarData(
isCurved: true, isCurved: true,
...@@ -131,7 +133,7 @@ class ChartTopArtistsStream extends CustomLineChart { ...@@ -131,7 +133,7 @@ class ChartTopArtistsStream extends CustomLineChart {
List<BetweenBarsData> getBetweenBarsData() { List<BetweenBarsData> getBetweenBarsData() {
final int artistsCount = final int artistsCount =
this.chartData.topArtistsStream[this.chartData.topArtistsStream.keys.first]?.length ?? chartData.topArtistsStream[chartData.topArtistsStream.keys.first]?.length ??
0; 0;
return Iterable<int>.generate(artistsCount) return Iterable<int>.generate(artistsCount)
...@@ -144,6 +146,7 @@ class ChartTopArtistsStream extends CustomLineChart { ...@@ -144,6 +146,7 @@ class ChartTopArtistsStream extends CustomLineChart {
.toList(); .toList();
} }
@override
Widget getHorizontalTitlesWidget(double value, TitleMeta meta) { Widget getHorizontalTitlesWidget(double value, TitleMeta meta) {
return getHorizontalTitlesWidgetWithDate(value, meta); return getHorizontalTitlesWidgetWithDate(value, meta);
} }
......
...@@ -22,8 +22,8 @@ class ContentStatisticsGlobal extends StatelessWidget { ...@@ -22,8 +22,8 @@ class ContentStatisticsGlobal extends StatelessWidget {
style: textTheme.bodyMedium, style: textTheme.bodyMedium,
).tr( ).tr(
namedArgs: { namedArgs: {
'count': this.statistics.totalCount != null 'count': statistics.totalCount != null
? this.statistics.totalCount.toString() ? statistics.totalCount.toString()
: placeholder, : placeholder,
}, },
), ),
...@@ -32,8 +32,8 @@ class ContentStatisticsGlobal extends StatelessWidget { ...@@ -32,8 +32,8 @@ class ContentStatisticsGlobal extends StatelessWidget {
style: textTheme.bodyMedium, style: textTheme.bodyMedium,
).tr( ).tr(
namedArgs: { namedArgs: {
'datetime': this.statistics.lastScrobble != null 'datetime': statistics.lastScrobble != null
? DateFormat().format(this.statistics.lastScrobble ?? DateTime.now()) ? DateFormat().format(statistics.lastScrobble ?? DateTime.now())
: placeholder, : placeholder,
}, },
), ),
......
...@@ -17,17 +17,17 @@ class ContentStatisticsRecent extends StatelessWidget { ...@@ -17,17 +17,17 @@ class ContentStatisticsRecent extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text( Text(
(this.statistics.recentCount != null && (statistics.recentCount != null &&
this.statistics.firstPlayedArtistsCount != null && statistics.firstPlayedArtistsCount != null &&
this.statistics.firstPlayedTracksCount != null) statistics.firstPlayedTracksCount != null)
? 'statistics_recent_scrobbles_count_and_discoveries' ? 'statistics_recent_scrobbles_count_and_discoveries'
: '', : '',
style: textTheme.bodyMedium, style: textTheme.bodyMedium,
).tr( ).tr(
namedArgs: { namedArgs: {
'count': this.statistics.recentCount.toString(), 'count': statistics.recentCount.toString(),
'artistsCount': this.statistics.firstPlayedArtistsCount.toString(), 'artistsCount': statistics.firstPlayedArtistsCount.toString(),
'tracksCount': this.statistics.firstPlayedTracksCount.toString(), 'tracksCount': statistics.firstPlayedTracksCount.toString(),
}, },
), ),
], ],
......
...@@ -11,9 +11,9 @@ class ShowErrorWidget extends StatelessWidget { ...@@ -11,9 +11,9 @@ class ShowErrorWidget extends StatelessWidget {
print(message); print(message);
return Text( return Text(
'⚠️ ' + tr(message), '⚠️ ${tr(message)}',
textAlign: TextAlign.start, textAlign: TextAlign.start,
style: TextStyle(color: Colors.red), style: const TextStyle(color: Colors.red),
); );
} }
} }
...@@ -98,22 +98,22 @@ class _SettingsFormState extends State<SettingsForm> { ...@@ -98,22 +98,22 @@ class _SettingsFormState extends State<SettingsForm> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
SizedBox(height: 8), const SizedBox(height: 8),
AppTitle2(text: tr('settings_title_global')), AppTitle2(text: tr('settings_title_global')),
// Username // Username
Text('settings_label_username').tr(), const Text('settings_label_username').tr(),
TextFormField( TextFormField(
controller: usernameController, controller: usernameController,
decoration: InputDecoration( decoration: InputDecoration(
border: UnderlineInputBorder(), border: const UnderlineInputBorder(),
suffixIcon: ElevatedButton( suffixIcon: ElevatedButton(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
shape: new RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(6.0), borderRadius: BorderRadius.circular(6.0),
), ),
), ),
child: Icon(UniconsLine.save), child: const Icon(UniconsLine.save),
onPressed: () { onPressed: () {
saveSettings(); saveSettings();
}, },
...@@ -121,7 +121,7 @@ class _SettingsFormState extends State<SettingsForm> { ...@@ -121,7 +121,7 @@ class _SettingsFormState extends State<SettingsForm> {
), ),
), ),
SizedBox(height: 8), const SizedBox(height: 8),
AppTitle2(text: tr('settings_title_days_count')), AppTitle2(text: tr('settings_title_days_count')),
// Statistics (recent) // Statistics (recent)
...@@ -129,7 +129,7 @@ class _SettingsFormState extends State<SettingsForm> { ...@@ -129,7 +129,7 @@ class _SettingsFormState extends State<SettingsForm> {
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text('settings_label_statistics_recent_days_count').tr(), const Text('settings_label_statistics_recent_days_count').tr(),
ToggleButtons( ToggleButtons(
onPressed: (int index) { onPressed: (int index) {
setState(() { setState(() {
...@@ -155,7 +155,7 @@ class _SettingsFormState extends State<SettingsForm> { ...@@ -155,7 +155,7 @@ class _SettingsFormState extends State<SettingsForm> {
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text('settings_label_timeline_days_count').tr(), const Text('settings_label_timeline_days_count').tr(),
ToggleButtons( ToggleButtons(
onPressed: (int index) { onPressed: (int index) {
setState(() { setState(() {
...@@ -181,7 +181,7 @@ class _SettingsFormState extends State<SettingsForm> { ...@@ -181,7 +181,7 @@ class _SettingsFormState extends State<SettingsForm> {
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text('settings_label_top_artists_days_count').tr(), const Text('settings_label_top_artists_days_count').tr(),
ToggleButtons( ToggleButtons(
onPressed: (int index) { onPressed: (int index) {
setState(() { setState(() {
...@@ -207,7 +207,7 @@ class _SettingsFormState extends State<SettingsForm> { ...@@ -207,7 +207,7 @@ class _SettingsFormState extends State<SettingsForm> {
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text('settings_label_discoveries_days_count').tr(), const Text('settings_label_discoveries_days_count').tr(),
ToggleButtons( ToggleButtons(
onPressed: (int index) { onPressed: (int index) {
setState(() { setState(() {
...@@ -233,7 +233,7 @@ class _SettingsFormState extends State<SettingsForm> { ...@@ -233,7 +233,7 @@ class _SettingsFormState extends State<SettingsForm> {
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text('settings_label_distribution_days_count').tr(), const Text('settings_label_distribution_days_count').tr(),
ToggleButtons( ToggleButtons(
onPressed: (int index) { onPressed: (int index) {
setState(() { setState(() {
...@@ -254,7 +254,7 @@ class _SettingsFormState extends State<SettingsForm> { ...@@ -254,7 +254,7 @@ class _SettingsFormState extends State<SettingsForm> {
], ],
), ),
SizedBox(height: 8), const SizedBox(height: 8),
AppTitle2(text: tr('settings_title_counts')), AppTitle2(text: tr('settings_title_counts')),
// New artists count // New artists count
...@@ -262,7 +262,7 @@ class _SettingsFormState extends State<SettingsForm> { ...@@ -262,7 +262,7 @@ class _SettingsFormState extends State<SettingsForm> {
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text('settings_label_new_artists_count').tr(), const Text('settings_label_new_artists_count').tr(),
ToggleButtons( ToggleButtons(
onPressed: (int index) { onPressed: (int index) {
setState(() { setState(() {
...@@ -287,7 +287,7 @@ class _SettingsFormState extends State<SettingsForm> { ...@@ -287,7 +287,7 @@ class _SettingsFormState extends State<SettingsForm> {
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text('settings_label_new_tracks_count').tr(), const Text('settings_label_new_tracks_count').tr(),
ToggleButtons( ToggleButtons(
onPressed: (int index) { onPressed: (int index) {
setState(() { setState(() {
......
...@@ -21,10 +21,10 @@ packages: ...@@ -21,10 +21,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: bloc name: bloc
sha256: "3820f15f502372d979121de1f6b97bfcf1630ebff8fe1d52fb2b0bfa49be5b49" sha256: f53a110e3b48dcd78136c10daa5d51512443cea5e1348c9d80a320095fa2db9e
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "8.1.2" version: "8.1.3"
characters: characters:
dependency: transitive dependency: transitive
description: description:
...@@ -61,10 +61,10 @@ packages: ...@@ -61,10 +61,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: easy_localization name: easy_localization
sha256: de63e3b422adfc97f256cbb3f8cf12739b6a4993d390f3cadb3f51837afaefe5 sha256: "9c86754b22aaa3e74e471635b25b33729f958dd6fb83df0ad6612948a7b231af"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.3" version: "3.0.4"
easy_logger: easy_logger:
dependency: transitive dependency: transitive
description: description:
...@@ -85,10 +85,10 @@ packages: ...@@ -85,10 +85,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: ffi name: ffi
sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.0" version: "2.1.2"
file: file:
dependency: transitive dependency: transitive
description: description:
...@@ -101,10 +101,10 @@ packages: ...@@ -101,10 +101,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: fl_chart name: fl_chart
sha256: fe6fec7d85975a99c73b9515a69a6e291364accfa0e4a5b3ce6de814d74b9a1c sha256: "00b74ae680df6b1135bdbea00a7d1fc072a9180b7c3f3702e4b19a9943f5ed7d"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.66.0" version: "0.66.2"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
...@@ -114,10 +114,18 @@ packages: ...@@ -114,10 +114,18 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: flutter_bloc name: flutter_bloc
sha256: e74efb89ee6945bcbce74a5b3a5a3376b088e5f21f55c263fc38cbdc6237faae sha256: "87325da1ac757fcc4813e6b34ed5dd61169973871fdf181d6c2109dd6935ece1"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "8.1.3" version: "8.1.4"
flutter_lints:
dependency: "direct dev"
description:
name: flutter_lints
sha256: e2a421b7e59244faef694ba7b30562e489c2b489866e505074eb005cd7060db7
url: "https://pub.dev"
source: hosted
version: "3.0.1"
flutter_localizations: flutter_localizations:
dependency: transitive dependency: transitive
description: flutter description: flutter
...@@ -137,7 +145,7 @@ packages: ...@@ -137,7 +145,7 @@ packages:
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
hive: hive:
dependency: transitive dependency: "direct main"
description: description:
name: hive name: hive
sha256: "8dcf6db979d7933da8217edcec84e9df1bdb4e4edc7fc77dbd5aa74356d6d941" sha256: "8dcf6db979d7933da8217edcec84e9df1bdb4e4edc7fc77dbd5aa74356d6d941"
...@@ -148,10 +156,10 @@ packages: ...@@ -148,10 +156,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: http name: http
sha256: d4872660c46d929f6b8a9ef4e7a7eff7e49bbf0c4ec3f385ee32df5119175139 sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.1.2" version: "1.2.1"
http_parser: http_parser:
dependency: transitive dependency: transitive
description: description:
...@@ -164,10 +172,10 @@ packages: ...@@ -164,10 +172,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: hydrated_bloc name: hydrated_bloc
sha256: c925e49704c052a8f249226ae7603f86bfa776b910816390763b956c71d2cbaf sha256: "00a2099680162e74b5a836b8a7f446e478520a9cae9f6032e028ad8129f4432d"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "9.1.3" version: "9.1.4"
intl: intl:
dependency: transitive dependency: transitive
description: description:
...@@ -184,22 +192,30 @@ packages: ...@@ -184,22 +192,30 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.2.2" version: "0.2.2"
lints:
dependency: transitive
description:
name: lints
sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290
url: "https://pub.dev"
source: hosted
version: "3.0.0"
material_color_utilities: material_color_utilities:
dependency: transitive dependency: transitive
description: description:
name: material_color_utilities name: material_color_utilities
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.5.0" version: "0.8.0"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.10.0" version: "1.11.0"
nested: nested:
dependency: transitive dependency: transitive
description: description:
...@@ -212,18 +228,18 @@ packages: ...@@ -212,18 +228,18 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: path name: path
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.8.3" version: "1.9.0"
path_provider: path_provider:
dependency: "direct main" dependency: "direct main"
description: description:
name: path_provider name: path_provider
sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa sha256: b27217933eeeba8ff24845c34003b003b2b22151de3c908d0e679e8fe1aa078b
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.1" version: "2.1.2"
path_provider_android: path_provider_android:
dependency: transitive dependency: transitive
description: description:
...@@ -236,10 +252,10 @@ packages: ...@@ -236,10 +252,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: path_provider_foundation name: path_provider_foundation
sha256: "19314d595120f82aca0ba62787d58dde2cc6b5df7d2f0daf72489e38d1b57f2d" sha256: "5a7999be66e000916500be4f15a3633ebceb8302719b47b9cc49ce924125350f"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.3.1" version: "2.3.2"
path_provider_linux: path_provider_linux:
dependency: transitive dependency: transitive
description: description:
...@@ -252,10 +268,10 @@ packages: ...@@ -252,10 +268,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: path_provider_platform_interface name: path_provider_platform_interface
sha256: "94b1e0dd80970c1ce43d5d4e050a9918fce4f4a775e6142424c30a29a363265c" sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.1" version: "2.1.2"
path_provider_windows: path_provider_windows:
dependency: transitive dependency: transitive
description: description:
...@@ -268,18 +284,18 @@ packages: ...@@ -268,18 +284,18 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: platform name: platform
sha256: "0a279f0707af40c890e80b1e9df8bb761694c074ba7e1d4ab1bc4b728e200b59" sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.1.3" version: "3.1.4"
plugin_platform_interface: plugin_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: plugin_platform_interface name: plugin_platform_interface
sha256: f4f88d4a900933e7267e2b353594774fc0d07fb072b47eedcd5b54e1ea3269f8 sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.7" version: "2.1.8"
provider: provider:
dependency: transitive dependency: transitive
description: description:
...@@ -308,10 +324,10 @@ packages: ...@@ -308,10 +324,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_foundation name: shared_preferences_foundation
sha256: "7bf53a9f2d007329ee6f3df7268fd498f8373602f943c975598bbb34649b62a7" sha256: "7708d83064f38060c7b39db12aefe449cb8cdc031d6062280087bc4cdb988f5c"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.3.4" version: "2.3.5"
shared_preferences_linux: shared_preferences_linux:
dependency: transitive dependency: transitive
description: description:
...@@ -324,18 +340,18 @@ packages: ...@@ -324,18 +340,18 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_platform_interface name: shared_preferences_platform_interface
sha256: d4ec5fc9ebb2f2e056c617112aa75dcf92fc2e4faaf2ae999caa297473f75d8a sha256: "22e2ecac9419b4246d7c22bfbbda589e3acf5c0351137d87dd2939d984d37c3b"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.3.1" version: "2.3.2"
shared_preferences_web: shared_preferences_web:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_web name: shared_preferences_web
sha256: "7b15ffb9387ea3e237bb7a66b8a23d2147663d391cafc5c8f37b2e7b4bde5d21" sha256: d762709c2bbe80626ecc819143013cc820fa49ca5e363620ee20a8b15a3e3daf
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.2.2" version: "2.2.1"
shared_preferences_windows: shared_preferences_windows:
dependency: transitive dependency: transitive
description: description:
...@@ -409,26 +425,26 @@ packages: ...@@ -409,26 +425,26 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: web name: web
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 sha256: "1d9158c616048c38f712a6646e317a3426da10e884447626167240d45209cbad"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.3.0" version: "0.5.0"
win32: win32:
dependency: transitive dependency: transitive
description: description:
name: win32 name: win32
sha256: b0f37db61ba2f2e9b7a78a1caece0052564d1bc70668156cf3a29d676fe4e574 sha256: "464f5674532865248444b4c3daca12bd9bf2d7c47f759ce2617986e7229494a8"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "5.1.1" version: "5.2.0"
xdg_directories: xdg_directories:
dependency: transitive dependency: transitive
description: description:
name: xdg_directories name: xdg_directories
sha256: "589ada45ba9e39405c198fe34eb0f607cddb2108527e658136120892beac46d2" sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.0.3" version: "1.0.4"
sdks: sdks:
dart: ">=3.2.0 <4.0.0" dart: ">=3.3.0 <4.0.0"
flutter: ">=3.16.0" flutter: ">=3.16.0"
...@@ -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.52+52 version: 0.0.53+53
environment: environment:
sdk: '^3.0.0' sdk: '^3.0.0'
...@@ -16,6 +16,7 @@ dependencies: ...@@ -16,6 +16,7 @@ dependencies:
equatable: ^2.0.5 equatable: ^2.0.5
fl_chart: ^0.66.0 fl_chart: ^0.66.0
flutter_bloc: ^8.1.1 flutter_bloc: ^8.1.1
hive: ^2.2.3
http: ^1.1.0 http: ^1.1.0
path_provider: ^2.0.11 path_provider: ^2.0.11
hydrated_bloc: ^9.0.0 hydrated_bloc: ^9.0.0
...@@ -23,6 +24,9 @@ dependencies: ...@@ -23,6 +24,9 @@ dependencies:
unicons: ^2.1.1 unicons: ^2.1.1
flutter_swipe: ^1.0.1 flutter_swipe: ^1.0.1
dev_dependencies:
flutter_lints: ^3.0.1
flutter: flutter:
uses-material-design: false uses-material-design: false
assets: assets:
......
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