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
Showing
with 19 additions and 62 deletions
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
import 'package:scrobbles/cubit/data_counts_by_day_cubit.dart'; import 'package:scrobbles/cubit/data_counts_by_day_cubit.dart';
import 'package:scrobbles/cubit/settings_global_cubit.dart'; import 'package:scrobbles/cubit/settings_global_cubit.dart';
......
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
import 'package:scrobbles/cubit/data_counts_by_hour_cubit.dart'; import 'package:scrobbles/cubit/data_counts_by_hour_cubit.dart';
import 'package:scrobbles/cubit/settings_global_cubit.dart'; import 'package:scrobbles/cubit/settings_global_cubit.dart';
......
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
import 'package:scrobbles/cubit/data_discoveries_cubit.dart'; import 'package:scrobbles/cubit/data_discoveries_cubit.dart';
import 'package:scrobbles/cubit/settings_global_cubit.dart'; import 'package:scrobbles/cubit/settings_global_cubit.dart';
......
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
import 'package:scrobbles/cubit/data_heatmap_cubit.dart'; import 'package:scrobbles/cubit/data_heatmap_cubit.dart';
import 'package:scrobbles/cubit/settings_global_cubit.dart'; import 'package:scrobbles/cubit/settings_global_cubit.dart';
......
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
import 'package:scrobbles/cubit/data_new_artists_cubit.dart'; import 'package:scrobbles/cubit/data_new_artists_cubit.dart';
import 'package:scrobbles/ui/widgets/card_content.dart'; import 'package:scrobbles/ui/widgets/card_content.dart';
......
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
import 'package:scrobbles/cubit/data_new_tracks_cubit.dart'; import 'package:scrobbles/cubit/data_new_tracks_cubit.dart';
import 'package:scrobbles/ui/widgets/card_content.dart'; import 'package:scrobbles/ui/widgets/card_content.dart';
......
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
import 'package:scrobbles/cubit/data_statistics_global_cubit.dart'; import 'package:scrobbles/cubit/data_statistics_global_cubit.dart';
import 'package:scrobbles/models/data/statistics_global.dart'; import 'package:scrobbles/models/data/statistics_global.dart';
......
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
import 'package:scrobbles/cubit/data_statistics_recent_cubit.dart'; import 'package:scrobbles/cubit/data_statistics_recent_cubit.dart';
import 'package:scrobbles/cubit/settings_global_cubit.dart'; import 'package:scrobbles/cubit/settings_global_cubit.dart';
......
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
import 'package:scrobbles/cubit/data_timeline_cubit.dart'; import 'package:scrobbles/cubit/data_timeline_cubit.dart';
import 'package:scrobbles/cubit/settings_global_cubit.dart'; import 'package:scrobbles/cubit/settings_global_cubit.dart';
......
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
import 'package:scrobbles/cubit/data_top_artists_cubit.dart'; import 'package:scrobbles/cubit/data_top_artists_cubit.dart';
import 'package:scrobbles/cubit/settings_global_cubit.dart'; import 'package:scrobbles/cubit/settings_global_cubit.dart';
......
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
import 'package:fl_chart/fl_chart.dart'; import 'package:fl_chart/fl_chart.dart';
import 'package:scrobbles/config/app_colors.dart'; import 'package:scrobbles/config/app_colors.dart';
import 'package:scrobbles/models/data/counts_by_hour.dart'; import 'package:scrobbles/models/data/counts_by_hour.dart';
import 'package:scrobbles/ui/widgets/abstracts/custom_bar_chart.dart'; import 'package:scrobbles/ui/widgets/abstracts/custom_bar_chart.dart';
import 'package:scrobbles/utils/color_extensions.dart';
class ChartCountsByHour extends CustomBarChart { class ChartCountsByHour extends CustomBarChart {
const ChartCountsByHour({ const ChartCountsByHour({
......
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
import 'package:fl_chart/fl_chart.dart'; import 'package:fl_chart/fl_chart.dart';
import 'package:scrobbles/config/app_colors.dart'; import 'package:scrobbles/config/app_colors.dart';
import 'package:scrobbles/models/data/discoveries.dart'; import 'package:scrobbles/models/data/discoveries.dart';
import 'package:scrobbles/ui/widgets/abstracts/custom_bar_chart.dart'; import 'package:scrobbles/ui/widgets/abstracts/custom_bar_chart.dart';
import 'package:scrobbles/utils/color_extensions.dart';
class ChartDiscoveriesArtists extends CustomBarChart { class ChartDiscoveriesArtists extends CustomBarChart {
const ChartDiscoveriesArtists({super.key, required this.chartData}); const ChartDiscoveriesArtists({super.key, required this.chartData});
......
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
import 'package:fl_chart/fl_chart.dart'; import 'package:fl_chart/fl_chart.dart';
import 'package:scrobbles/config/app_colors.dart'; import 'package:scrobbles/config/app_colors.dart';
import 'package:scrobbles/models/data/discoveries.dart'; import 'package:scrobbles/models/data/discoveries.dart';
import 'package:scrobbles/ui/widgets/abstracts/custom_bar_chart.dart'; import 'package:scrobbles/ui/widgets/abstracts/custom_bar_chart.dart';
import 'package:scrobbles/utils/color_extensions.dart';
class ChartDiscoveriesTracks extends CustomBarChart { class ChartDiscoveriesTracks extends CustomBarChart {
const ChartDiscoveriesTracks({super.key, required this.chartData}); const ChartDiscoveriesTracks({super.key, required this.chartData});
......
import 'package:easy_localization/easy_localization.dart';
import 'package:fl_chart/fl_chart.dart'; import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
import 'package:scrobbles/config/app_colors.dart'; import 'package:scrobbles/config/app_colors.dart';
import 'package:scrobbles/models/data/heatmap.dart'; import 'package:scrobbles/models/data/heatmap.dart';
......
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
import 'package:fl_chart/fl_chart.dart'; import 'package:fl_chart/fl_chart.dart';
import 'package:scrobbles/config/app_colors.dart'; import 'package:scrobbles/config/app_colors.dart';
import 'package:scrobbles/models/data/timeline.dart'; import 'package:scrobbles/models/data/timeline.dart';
import 'package:scrobbles/ui/widgets/abstracts/custom_line_chart.dart'; import 'package:scrobbles/ui/widgets/abstracts/custom_line_chart.dart';
import 'package:scrobbles/utils/color_extensions.dart';
class ChartTimelineEclecticism extends CustomLineChart { class ChartTimelineEclecticism extends CustomLineChart {
const ChartTimelineEclecticism({super.key, required this.chartData}); const ChartTimelineEclecticism({super.key, required this.chartData});
......
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:fl_chart/fl_chart.dart'; import 'package:fl_chart/fl_chart.dart';
import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
import 'package:scrobbles/models/data/topartists.dart'; import 'package:scrobbles/models/data/topartists.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 ChartTopArtists extends CustomChart { class ChartTopArtists extends CustomChart {
const ChartTopArtists({super.key, required this.chartData}); const ChartTopArtists({super.key, required this.chartData});
......
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
import 'package:fl_chart/fl_chart.dart'; import 'package:fl_chart/fl_chart.dart';
import 'package:scrobbles/models/data/topartists.dart'; import 'package:scrobbles/models/data/topartists.dart';
import 'package:scrobbles/ui/widgets/abstracts/custom_line_chart.dart'; import 'package:scrobbles/ui/widgets/abstracts/custom_line_chart.dart';
import 'package:scrobbles/utils/color_extensions.dart';
class ChartTopArtistsStream extends CustomLineChart { class ChartTopArtistsStream extends CustomLineChart {
const ChartTopArtistsStream({super.key, required this.chartData}); const ChartTopArtistsStream({super.key, required this.chartData});
......
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
import 'package:scrobbles/models/data/statistics_global.dart'; import 'package:scrobbles/models/data/statistics_global.dart';
......
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
import 'package:scrobbles/models/data/statistics_recent.dart'; import 'package:scrobbles/models/data/statistics_recent.dart';
......
import 'dart:ui';
extension ColorExtension on Color {
Color darken([int percent = 40]) {
assert(1 <= percent && percent <= 100);
final value = 1 - percent / 100;
return Color.fromARGB(
alpha,
(red * value).round(),
(green * value).round(),
(blue * value).round(),
);
}
Color lighten([int percent = 40]) {
assert(1 <= percent && percent <= 100);
final value = percent / 100;
return Color.fromARGB(
alpha,
(red + ((255 - red) * value)).round(),
(green + ((255 - green) * value)).round(),
(blue + ((255 - blue) * value)).round(),
);
}
Color avg(Color other) {
final red = (this.red + other.red) ~/ 2;
final green = (this.green + other.green) ~/ 2;
final blue = (this.blue + other.blue) ~/ 2;
final alpha = (this.alpha + other.alpha) ~/ 2;
return Color.fromARGB(alpha, red, green, blue);
}
}