<commit_before>import 'package:fivekmrun_flutter/common/list_tile_row.dart';
import 'package:fivekmrun_flutter/common/milestone_gauge.dart';
import 'package:fivekmrun_flutter/custom_icons.dart';
import 'package:fivekmrun_flutter/state/result_model.dart';
import 'package:fivekmrun_flutter/state/results_resource.dart';
import 'package:fivekmrun_flutter/state/run_model.dart';
import 'package:flutter/material.dart';
import 'package:fivekmrun_flutter/private/secrets.dart';

class OfflineChartDetailsPage extends StatelessWidget {
  const OfflineChartDetailsPage({Key key}) : super(key: key);

  Widget buildPositionGauge(Run run) {
    ResultsResource results = ResultsResource();
    return FutureBuilder<List<Result>>(
        future: results.load(id: run.eventId),
        builder: (BuildContext context, AsyncSnapshot<List<Result>> snapshot) {
          switch (snapshot.connectionState) {
            case ConnectionState.none:
            case ConnectionState.active:
            case ConnectionState.waiting:
              return AspectRatio(
                aspectRatio: 1,
                child: Center(
                  child: CircularProgressIndicator(),
                ),
              );
            case ConnectionState.done:
              if (snapshot.hasError)
                return MilestoneGauge(run.position, 400);
              else
                return MilestoneGauge(run.position, snapshot.data.length);
          }
        });
  }

  @override
  Widget build(BuildContext context) {
    final Result result = ModalRoute.of(context).settings.arguments;
    final iconColor = Theme.of(context).accentColor;

    return Scaffold(
      appBar: AppBar(title: Text(result.name)),
      body: Center(
        child: Padding(
          padding: const EdgeInsets.all(16.0),
          child: Column(
            children: <Widget>[
              IntrinsicHeight(
                child: Row(
                  children: <Widget>[
                    IntrinsicWidth(
                      child: Column(
                        children: <Widget>[
                          ListTileRow(
                            icon: CustomIcons.award,
                            text: result.officialPosition.toString(),
                            iconColor: iconColor,
                          ),
                          ListTileRow(
                            icon: Icons.timer,
                            text: result.time + " мин",
                            iconColor: iconColor,
                          ),
                          ListTileRow(
                            icon: Icons.directions_run,
                            text: result.pace + " мин/км",
                            iconColor: iconColor,
                          ),
                          ListTileRow(
                            icon: Icons.terrain,
                            text: result.elevationGainedTotal != null ? result.elevationGainedTotal.toString() + "m" : "-",
                            iconColor: iconColor,
                          ),
                        ],
                      ),
                    ),
                    VerticalDivider(
                      color: iconColor,
                      width: 5,
                      indent: 10,
                      endIndent: 10,
                    ),
                    Expanded(
                      child: Column(children: <Widget>[
                        ListTileRow(
                          icon: Icons.location_city,
                          text: result.startLocation ?? " - ",
                          iconColor: iconColor,
                        ),
                        ListTileRow(
                          icon: Icons.straighten,
                          text: result.distance.toString()+"m",
                          iconColor: iconColor,
                        ),
                        ListTileRow(
                          icon: Icons.trending_up,
                          text: result.elevationLow.toStringAsFixed(0) + "m ⬈ " + result.elevationHigh.toStringAsFixed(0) + "m",
                          iconColor: iconColor,
                        ),
                          if (result.status > 0 && result.status <= 2)
                            ListTileRow(
                              icon: Icons.check_box,
                              text: "доказан",
                              iconColor: iconColor,
                            ),
                          if (result.status == 3)
                            ListTileRow(
                              icon: Icons.check,
                              text: "самостоятелен",
                              iconColor: iconColor,<commit_msg>add margin<commit_after>import 'package:fivekmrun_flutter/common/list_tile_row.dart';
import 'package:fivekmrun_flutter/common/milestone_gauge.dart';
import 'package:fivekmrun_flutter/custom_icons.dart';
import 'package:fivekmrun_flutter/state/result_model.dart';
import 'package:fivekmrun_flutter/state/results_resource.dart';
import 'package:fivekmrun_flutter/state/run_model.dart';
import 'package:flutter/material.dart';
import 'package:fivekmrun_flutter/private/secrets.dart';

class OfflineChartDetailsPage extends StatelessWidget {
  const OfflineChartDetailsPage({Key key}) : super(key: key);

  Widget buildPositionGauge(Run run) {
    ResultsResource results = ResultsResource();
    return FutureBuilder<List<Result>>(
        future: results.load(id: run.eventId),
        builder: (BuildContext context, AsyncSnapshot<List<Result>> snapshot) {
          switch (snapshot.connectionState) {
            case ConnectionState.none:
            case ConnectionState.active:
            case ConnectionState.waiting:
              return AspectRatio(
                aspectRatio: 1,
                child: Center(
                  child: CircularProgressIndicator(),
                ),
              );
            case ConnectionState.done:
              if (snapshot.hasError)
                return MilestoneGauge(run.position, 400);
              else
                return MilestoneGauge(run.position, snapshot.data.length);
          }
        });
  }

  @override
  Widget build(BuildContext context) {
    final Result result = ModalRoute.of(context).settings.arguments;
    final iconColor = Theme.of(context).accentColor;

    return Scaffold(
      appBar: AppBar(title: Text(result.name)),
      body: Center(
        child: Padding(
          padding: const EdgeInsets.all(16.0),
          child: Column(
            children: <Widget>[
              IntrinsicHeight(
                child: Row(
                  children: <Widget>[
                    IntrinsicWidth(
                      child: Column(
                        children: <Widget>[
                          ListTileRow(
                            icon: CustomIcons.award,
                            text: result.officialPosition.toString(),
                            iconColor: iconColor,
                          ),
                          ListTileRow(
                            icon: Icons.timer,
                            text: result.time + " мин",
                            iconColor: iconColor,
                          ),
                          ListTileRow(
                            icon: Icons.directions_run,
                            text: result.pace + " мин/км",
                            iconColor: iconColor,
                          ),
                          ListTileRow(
                            icon: Icons.terrain,
                            text: result.elevationGainedTotal != null ? result.elevationGainedTotal.toString() + "m" : "-",
                            iconColor: iconColor,
                          ),
                        ],
                      ),
                    ),
                    VerticalDivider(
                      color: iconColor,
                      width: 5,
                      indent: 10,
                      endIndent: 10,
                    ),
                    SizedBox(height: 10, width: 10,),
                    Expanded(
                      child: Column(children: <Widget>[
                        ListTileRow(
                          icon: Icons.location_city,
                          text: result.startLocation ?? " - ",
                          iconColor: iconColor,
                        ),
                        ListTileRow(
                          icon: Icons.straighten,
                          text: result.distance.toString()+"m",
                          iconColor: iconColor,
                        ),
                        ListTileRow(
                          icon: Icons.trending_up,
                          text: result.elevationLow.toStringAsFixed(0) + "m ⬈ " + result.elevationHigh.toStringAsFixed(0) + "m",
                          iconColor: iconColor,
                        ),
                          if (result.status > 0 && result.status <= 2)
                            ListTileRow(
                              icon: Icons.check_box,
                              text: "доказан",
                              iconColor: iconColor,
                            ),
                          if (result.status == 3)
                            ListTileRow(
                              icon: Icons.check,
                              text: "самостоятелен",
                              iconColor: iconColor,
{'fraction_non_alphanumeric': 0.08158311345646438, 'fraction_numerical': 0.0040105540897097626, 'mean_word_length': 1.1076512455516014, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '2144952', 'n_tokens_mistral': 2290, 'n_tokens_neox': 2178, 'n_words': 400}