<commit_before>import 'package:flutter/material.dart';

import '../../../../core/helpers/color_palette_helper.dart';
import '../../../../core/helpers/time_format_helper.dart';
import '../../domain/entities/statistics.dart';

class StatisticsDetails extends StatelessWidget {
  final Statistics statistic;

  const StatisticsDetails({Key key, @required this.statistic})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      mainAxisAlignment: MainAxisAlignment.spaceEvenly,
      children: [
        // _rowOne(statistic),
        Text(
          _rowOne(),
          overflow: TextOverflow.ellipsis,
          maxLines: 2,
          style: TextStyle(
            fontSize: 18,
            color: TautulliColorPalette.not_white,
          ),
        ),
        Text(
          _rowTwo(),
          overflow: TextOverflow.ellipsis,
          style: TextStyle(
            fontSize: 15,
            color: TautulliColorPalette.not_white,
          ),
        ),
        Text(
          _rowThree(),
          overflow: TextOverflow.ellipsis,
          style: TextStyle(
            fontSize: 15,
            color: TautulliColorPalette.not_white,
          ),
        ),
      ],
    );
  }

  String _rowOne() {
    switch (statistic.statId) {
      case ('top_tv'):
      case ('popular_tv'):
      case ('top_movies'):
      case ('popular_movies'):
      case ('top_music'):
      case ('popular_music'):
      case ('last_watched'):
      case ('most_concurrent'):
        return statistic.title;
      case ('top_platforms'):
        return statistic.platform;
      case ('top_users'):
        return statistic.friendlyName;
      default:
        return 'UNKNOWN';
    }
  }

  String _rowTwo() {
    switch (statistic.statId) {
      case ('top_tv'):
      case ('top_movies'):
      case ('top_music'):
      case ('top_platforms'):
      case ('top_users'):
        return '${statistic.totalPlays.toString()} plays';
      case ('popular_tv'):
      case ('popular_movies'):<commit_msg>Catch empty statistic title.<commit_after>import 'package:flutter/material.dart';

import '../../../../core/helpers/color_palette_helper.dart';
import '../../../../core/helpers/time_format_helper.dart';
import '../../domain/entities/statistics.dart';

class StatisticsDetails extends StatelessWidget {
  final Statistics statistic;

  const StatisticsDetails({Key key, @required this.statistic})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      mainAxisAlignment: MainAxisAlignment.spaceEvenly,
      children: [
        // _rowOne(statistic),
        Text(
          _rowOne(),
          overflow: TextOverflow.ellipsis,
          maxLines: 2,
          style: TextStyle(
            fontSize: 18,
            color: TautulliColorPalette.not_white,
          ),
        ),
        Text(
          _rowTwo(),
          overflow: TextOverflow.ellipsis,
          style: TextStyle(
            fontSize: 15,
            color: TautulliColorPalette.not_white,
          ),
        ),
        Text(
          _rowThree(),
          overflow: TextOverflow.ellipsis,
          style: TextStyle(
            fontSize: 15,
            color: TautulliColorPalette.not_white,
          ),
        ),
      ],
    );
  }

  String _rowOne() {
    switch (statistic.statId) {
      case ('top_tv'):
      case ('popular_tv'):
      case ('top_movies'):
      case ('popular_movies'):
      case ('top_music'):
      case ('popular_music'):
      case ('last_watched'):
      case ('most_concurrent'):
        return statistic.title != null ? statistic.title : 'NO TITLE';
      case ('top_platforms'):
        return statistic.platform;
      case ('top_users'):
        return statistic.friendlyName;
      default:
        return 'UNKNOWN';
    }
  }

  String _rowTwo() {
    switch (statistic.statId) {
      case ('top_tv'):
      case ('top_movies'):
      case ('top_music'):
      case ('top_platforms'):
      case ('top_users'):
        return '${statistic.totalPlays.toString()} plays';
      case ('popular_tv'):
      case ('popular_movies'):
{'fraction_non_alphanumeric': 0.12965582272512965, 'fraction_numerical': 0.0033003300330033004, 'mean_word_length': 2.1084249084249085, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '829788', 'n_tokens_mistral': 1249, 'n_tokens_neox': 1215, 'n_words': 246}