Skip to content
Snippets Groups Projects
Select Git revision
  • cc298e0b75868f91c9fde9c9e2de0265ec1f78c2
  • master default protected
  • 61-upgrade-framework-and-dependencies
  • 42-add-allowed-categories-in-settings-page
  • 44-improve-app-metadata
  • 23-add-tip-response-on-clic-on-button
  • Release_1.11.0_55 protected
  • Release_1.10.2_54 protected
  • Release_1.10.1_53 protected
  • Release_1.10.0_52 protected
  • Release_1.9.0_51 protected
  • Release_1.8.0_50 protected
  • Release_1.7.0_49 protected
  • Release_1.6.2_48 protected
  • Release_1.6.1_47 protected
  • Release_1.6.0_46 protected
  • Release_1.5.1_45 protected
  • Release_1.5.0_44 protected
  • Release_1.4.1_43 protected
  • Release_1.4.0_42 protected
  • Release_1.3.1_41 protected
  • Release_1.3.0_40 protected
  • Release_1.2.33_39 protected
  • Release_1.2.32_38 protected
  • Release_1.2.31_37 protected
  • Release_1.2.30_36 protected
26 results

game_data.dart

Blame
  • timeline_chart_eclecticism.dart 4.22 KiB
    import 'package:easy_localization/easy_localization.dart';
    import 'package:flutter/material.dart';
    import 'package:fl_chart/fl_chart.dart';
    
    import '../../../config/app_colors.dart';
    import '../../../models/timeline.dart';
    
    class ChartTimelineEclecticism extends StatelessWidget {
      final TimelineData chartData;
    
      const ChartTimelineEclecticism({super.key, required this.chartData});
    
      @override
      Widget build(BuildContext context) {
        return Container(
          height: 100.0,
          child: LineChart(
            LineChartData(
              lineBarsData: getDataEclecticism(),
              backgroundColor: Theme.of(context).colorScheme.onBackground,
              borderData: getBorderData(),
              gridData: getGridData(),
              titlesData: getTitlesData(),
              lineTouchData: getLineTouchDataEclecticism(),
              maxY: 100,
              minY: 0,
            ),
            duration: const Duration(milliseconds: 250),
          ),
        );
      }
    
      List<LineChartBarData> getDataEclecticism() {
        List<FlSpot> spots = [];
    
        this.chartData.data.keys.forEach((element) {
          TimelineDataValue? value = this.chartData.data[element];
          if (value != null) {
            final double date = DateTime.parse(element).millisecondsSinceEpoch.toDouble();
            final double eclecticism = value.eclecticism.toDouble();
    
            spots.add(FlSpot(date, eclecticism));
          }
        });
    
        return [
          LineChartBarData(
            isCurved: true,
            color: AppColors.contentColorCyan,
            barWidth: 3,
            isStrokeCapRound: false,
            dotData: const FlDotData(show: false),
            belowBarData: BarAreaData(show: true),
            spots: spots,
          ),
        ];
      }
    
      FlBorderData getBorderData() {
        return FlBorderData(
          show: true,
          border: Border.all(
            color: AppColors.borderColor,
            width: 2,
          ),
        );
      }
    
      FlGridData getGridData() {
        return const FlGridData(