Skip to content
Snippets Groups Projects
Select Git revision
  • f0dc07a7ecdc184fc9e2f3099cb0a6d71fc618a8
  • master default protected
  • 82-reword-settings
  • 67-improve-app-metadata
  • 54-improve-discoveries-page
  • 7-add-lastfm-link
  • Release_0.9.1_78 protected
  • Release_0.9.0_77 protected
  • Release_0.8.4_76 protected
  • Release_0.8.3_75 protected
  • Release_0.8.2_74 protected
  • Release_0.8.1_73 protected
  • Release_0.8.0_72 protected
  • Release_0.7.0_71 protected
  • Release_0.6.0_70 protected
  • Release_0.5.0_69 protected
  • Release_0.4.2_68 protected
  • Release_0.4.1_67 protected
  • Release_0.4.0_66 protected
  • Release_0.3.1_65 protected
  • Release_0.3.0_64 protected
  • Release_0.2.2_63 protected
  • Release_0.2.1_62 protected
  • Release_0.2.0_61 protected
  • Release_0.1.2_60 protected
  • Release_0.1.1_59 protected
26 results

timeline_content.dart

Blame
  • timeline_content.dart 1.66 KiB
    import 'dart:convert';
    
    import 'package:easy_localization/easy_localization.dart';
    import 'package:flutter/material.dart';
    
    import '../../../models/timeline.dart';
    import 'timeline_chart_counts.dart';
    import 'timeline_chart_eclecticism.dart';
    
    class ChartTimelineCardContent extends StatelessWidget {
      final int daysCount;
      final TimelineData chartData;
      final bool isLoading;
    
      const ChartTimelineCardContent(
          {super.key, required this.daysCount, required this.chartData, required this.isLoading});
    
      @override
      Widget build(BuildContext context) {
        final TextTheme textTheme = Theme.of(context).primaryTextTheme;
        final String placeholder = '⏳';
    
        return Column(
          mainAxisSize: MainAxisSize.min,
          crossAxisAlignment: CrossAxisAlignment.start,
          children: <Widget>[
            Text(
              'timeline_title',
              style: textTheme.titleLarge!.apply(fontWeightDelta: 2),
            ).tr(
              namedArgs: {
                'daysCount': this.daysCount.toString(),
              },
            ),
            const SizedBox(height: 8),
            this.isLoading
                ? Text(placeholder)
                : Column(
                    mainAxisAlignment: MainAxisAlignment.center,
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: [
                      ChartTimelineCounts(
                        chartData: TimelineData.fromJson(jsonDecode(this.chartData.toString())),
                      ),
                      const SizedBox(height: 8),
                      ChartTimelineEclecticism(
                        chartData: TimelineData.fromJson(jsonDecode(this.chartData.toString())),
                      ),
                    ],
                  ),
          ],
        );
      }
    }