Compare commits

..
2 Commits
Author SHA1 Message Date
kejaro 97c10c8d12 Updates 2026-09-27 20:41:18 +01:00
kejaro 02ab7f390d sdf 2026-09-27 19:54:29 +01:00
8 changed files with 633 additions and 37 deletions

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<svg width="800px" height="800px" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="#33d912" stroke-width="0.00016">
<g id="SVGRepo_bgCarrier" stroke-width="0"/>
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"/>
<g id="SVGRepo_iconCarrier">
<path fill="#4ee119" d="M 8 1.25 C 7.273 1.251 6.598 1.627 6.215 2.246 L 6.213 2.25 L 0.538 11.623 L 0.532 11.633 C -0.047 12.622 0.29 13.893 1.283 14.465 C 1.597 14.648 1.953 14.746 2.317 14.75 L 13.683 14.75 C 14.422 14.741 15.102 14.344 15.474 13.705 C 15.844 13.063 15.842 12.273 15.468 11.633 L 9.788 2.25 L 9.785 2.246 C 9.405 1.625 8.728 1.247 8 1.25 Z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 720 B

+7
View File
@@ -0,0 +1,7 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
␍<!-- Uploaded to: SVG Repo, www.svgrepo.com, Transformed by: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
␍<g id="SVGRepo_bgCarrier" stroke-width="0"/>
␍<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"/>
␍<g id="SVGRepo_iconCarrier"> <circle cx="8" cy="8" r="8" fill="#f70202"/> </g>
␍</svg>

After

Width:  |  Height:  |  Size: 501 B

@@ -0,0 +1,9 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
␍<!-- Uploaded to: SVG Repo, www.svgrepo.com, Transformed by: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="none">
␍<g id="SVGRepo_bgCarrier" stroke-width="0"/>
␍<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"/>
␍<g id="SVGRepo_iconCarrier">
␍<path fill="#f5c000" d="M3.25 1A2.25 2.25 0 001 3.25v9.5A2.25 2.25 0 003.25 15h9.5A2.25 2.25 0 0015 12.75v-9.5A2.25 2.25 0 0012.75 1h-9.5z"/>
␍</g>
␍</svg>

After

Width:  |  Height:  |  Size: 600 B

+10 -3
View File
@@ -13,7 +13,7 @@
"team": 1 "team": 1
}, },
{ {
"card_type": 1, "card_type": 2,
"datetime": "2023-10-01T12:35:00Z", "datetime": "2023-10-01T12:35:00Z",
"duration": 120, "duration": 120,
"player": 8, "player": 8,
@@ -25,13 +25,14 @@
{ {
"datetime": "2023-10-01T12:15:00Z", "datetime": "2023-10-01T12:15:00Z",
"player": 32, "player": 32,
"score": 1, "goal_type": 1,
"elapsed": 88, "elapsed": 88,
"team": 1 "team": 1
}, },
{ {
"datetime": "2023-10-01T12:30:00Z", "datetime": "2023-10-01T12:30:00Z",
"player": 2, "player": 2,
"goal_type": 0,
"elapsed": 66, "elapsed": 66,
"team": 0 "team": 0
} }
@@ -62,18 +63,21 @@
{ {
"datetime": "2023-10-01T12:15:00Z", "datetime": "2023-10-01T12:15:00Z",
"player": 32, "player": 32,
"goal_type": 1,
"elapsed": 88, "elapsed": 88,
"team": 1 "team": 2
}, },
{ {
"datetime": "2023-10-01T12:20:00Z", "datetime": "2023-10-01T12:20:00Z",
"player": 32, "player": 32,
"goal_type": 0,
"elapsed": 32, "elapsed": 32,
"team": 1 "team": 1
}, },
{ {
"datetime": "2023-10-01T12:30:00Z", "datetime": "2023-10-01T12:30:00Z",
"player": 2, "player": 2,
"goal_type": 2,
"elapsed": 66, "elapsed": 66,
"team": 0 "team": 0
} }
@@ -97,18 +101,21 @@
"datetime": "2023-10-01T12:15:00Z", "datetime": "2023-10-01T12:15:00Z",
"player": 32, "player": 32,
"elapsed": 88, "elapsed": 88,
"goal_type": 2,
"team": 1 "team": 1
}, },
{ {
"datetime": "2023-10-01T12:20:00Z", "datetime": "2023-10-01T12:20:00Z",
"player": 32, "player": 32,
"elapsed": 32, "elapsed": 32,
"goal_type": 1,
"team": 1 "team": 1
}, },
{ {
"datetime": "2023-10-01T12:30:00Z", "datetime": "2023-10-01T12:30:00Z",
"player": 2, "player": 2,
"elapsed": 66, "elapsed": 66,
"goal_type": 0,
"team": 0 "team": 0
} }
] ]
@@ -1,5 +1,9 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../../../domain/models/hockey_game.dart' show CardType, Match, Team; import 'package:flutter_svg/flutter_svg.dart';
import 'package:share_plus/share_plus.dart';
import '../../../../domain/models/hockey_game.dart'
show CardType, GoalType, Match, Team;
import '../view_models/match_results_view_model.dart'; import '../view_models/match_results_view_model.dart';
class MatchResultsView extends StatelessWidget { class MatchResultsView extends StatelessWidget {
@@ -25,38 +29,56 @@ class MatchResultsView extends StatelessWidget {
return ListView.builder( return ListView.builder(
padding: const EdgeInsets.all(16), padding: const EdgeInsets.all(16),
itemCount: viewModel.matches.length, itemCount: viewModel.matches.length,
itemBuilder: (context, index) => _MatchCard( itemBuilder: (context, index) =>
match: viewModel.matches[index], _MatchCard(match: viewModel.matches[index]),
),
); );
}, },
); );
} }
} }
class _MatchCard extends StatelessWidget { class _MatchCard extends StatefulWidget {
const _MatchCard({required this.match}); const _MatchCard({required this.match});
final Match match; final Match match;
@override
State<_MatchCard> createState() => _MatchCardState();
}
class _MatchCardState extends State<_MatchCard> {
bool _isExpanded = false;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final match = widget.match;
final colors = Theme.of(context).colorScheme; final colors = Theme.of(context).colorScheme;
final textTheme = Theme.of(context).textTheme; final textTheme = Theme.of(context).textTheme;
final date = DateTime.tryParse(match.datetime)?.toLocal(); final date = DateTime.tryParse(match.datetime)?.toLocal();
final dateLabel = date == null final dateLabel = date == null
? match.datetime ? match.datetime
: '${date.year}-${date.month.toString().padLeft(2, '0')}-${date.day.toString().padLeft(2, '0')}'; : '${date.year}-${date.month.toString().padLeft(2, '0')}-${date.day.toString().padLeft(2, '0')} ${date.hour.toString().padLeft(2, '0')}:${date.minute.toString().padLeft(2, '0')}';
return Card( return Card(
margin: const EdgeInsets.only(bottom: 12), margin: const EdgeInsets.only(bottom: 12),
child: Padding( child: ExpansionTile(
padding: const EdgeInsets.all(16), shape: const Border(),
child: Column( collapsedShape: const Border(),
onExpansionChanged: (expanded) => setState(() => _isExpanded = expanded),
trailing: _isExpanded
? IconButton(
tooltip: 'Share match',
icon: const Icon(Icons.share_outlined),
onPressed: () => SharePlus.instance.share(
ShareParams(text: _matchShareText(match)),
),
)
: const SizedBox.shrink(),
title: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(dateLabel, style: textTheme.labelLarge), Text(dateLabel, style: textTheme.labelLarge),
const SizedBox(height: 12), const SizedBox(height: 8),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@@ -71,21 +93,41 @@ class _MatchCard extends StatelessWidget {
const Text('Away'), const Text('Away'),
], ],
), ),
if (match.goals.isNotEmpty || match.cards.isNotEmpty) ...[
const Divider(height: 24),
...match.goals.map((goal) => _EventLine(
icon: Icons.sports_hockey,
label: 'Goal · ${_teamName(goal.team)} · #${goal.player}',
seconds: goal.seconds,
)),
...match.cards.map((card) => _EventLine(
icon: Icons.style_outlined,
label: '${_cardName(card.cardType)} card · ${_teamName(card.team)} · #${card.player}',
seconds: card.seconds,
)),
],
], ],
), ),
childrenPadding: const EdgeInsets.fromLTRB(16, 8, 16, 8),
children: [
...match.goals.map(
(goal) => _EventLine(
leading: Icon(
Icons.sports_hockey,
size: 18,
color: Theme.of(context).colorScheme.secondary,
),
team: _teamName(goal.team),
playerNumber: goal.player,
eventType: _goalTypeName(goal.goalType),
seconds: goal.seconds,
),
),
...match.cards.map(
(card) => _EventLine(
leading: _CardMarker(cardType: card.cardType),
team: _teamName(card.team),
playerNumber: card.player,
eventType: '${_cardName(card.cardType)} card · ${_cardDurationLabel(card.duration)}',
seconds: card.seconds,
),
),
if (match.goals.isEmpty && match.cards.isEmpty)
const Padding(
padding: EdgeInsets.only(bottom: 8),
child: Align(
alignment: Alignment.centerLeft,
child: Text('No recorded events'),
),
),
],
), ),
); );
} }
@@ -93,37 +135,162 @@ class _MatchCard extends StatelessWidget {
class _EventLine extends StatelessWidget { class _EventLine extends StatelessWidget {
const _EventLine({ const _EventLine({
required this.icon, required this.leading,
required this.label, required this.team,
required this.playerNumber,
required this.eventType,
required this.seconds, required this.seconds,
}); });
final IconData icon; final Widget leading;
final String label; final String team;
final int playerNumber;
final String eventType;
final int seconds; final int seconds;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final minute = seconds ~/ 60; final minute = seconds ~/ 60;
final second = (seconds % 60).toString().padLeft(2, '0'); final second = (seconds % 60).toString().padLeft(2, '0');
final playerLabel = '#${playerNumber.toString().padLeft(2, '0')}';
return Padding( return Padding(
padding: const EdgeInsets.only(bottom: 8), padding: const EdgeInsets.only(bottom: 4),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Icon(icon, size: 18, color: Theme.of(context).colorScheme.secondary), SizedBox(
width: 18,
height: 18,
child: Center(child: leading),
),
const SizedBox(width: 8), const SizedBox(width: 8),
Expanded(child: Text(label)), SizedBox(
Text('$minute:$second', style: Theme.of(context).textTheme.labelMedium), width: 40,
child: Align(
alignment: Alignment.centerLeft,
child: Text(team),
),
),
SizedBox(
width: 12,
child: Align(
alignment: Alignment.center,
child: const Text('·', textAlign: TextAlign.center),
),
),
SizedBox(
width: 42,
child: Align(
alignment: Alignment.centerLeft,
child: Text(playerLabel),
),
),
SizedBox(
width: 12,
child: Align(
alignment: Alignment.center,
child: const Text('·', textAlign: TextAlign.center),
),
),
Expanded(
child: Align(
alignment: Alignment.centerLeft,
child: Text(
eventType,
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
),
const SizedBox(width: 4),
Text(
'$minute:$second',
style: Theme.of(context).textTheme.labelMedium,
),
], ],
), ),
); );
} }
} }
class _CardMarker extends StatelessWidget {
const _CardMarker({required this.cardType});
final CardType cardType;
@override
Widget build(BuildContext context) {
final svgPath = switch (cardType) {
CardType.green => 'lib/data/icons/green-card.svg',
CardType.yellow => 'lib/data/icons/yellow-card.svg',
CardType.red => 'lib/data/icons/red-card.svg',
};
return SizedBox(
width: 18,
height: 18,
child: SvgPicture.asset(
svgPath,
width: 18,
height: 18,
fit: BoxFit.contain,
),
);
}
}
String _teamName(Team team) => team == Team.home ? 'Home' : 'Away'; String _teamName(Team team) => team == Team.home ? 'Home' : 'Away';
String _matchShareText(Match match) {
final buffer = StringBuffer()
..writeln('Match result')
..writeln(match.datetime)
..writeln('Home ${match.homeScore} - ${match.awayScore} Away');
if (match.goals.isNotEmpty) {
buffer.writeln();
buffer.writeln('Goals:');
for (final goal in match.goals) {
buffer.writeln(
'- ${_teamName(goal.team)} · #${goal.player.toString().padLeft(2, '0')} · ${_goalTypeName(goal.goalType)} · ${_formatTime(goal.seconds)}',
);
}
}
if (match.cards.isNotEmpty) {
buffer.writeln();
buffer.writeln('Cards:');
for (final card in match.cards) {
buffer.writeln(
'- ${_teamName(card.team)} · #${card.player.toString().padLeft(2, '0')} · ${_cardName(card.cardType)} card · ${_cardDurationLabel(card.duration)} · ${_formatTime(card.seconds)}',
);
}
}
return buffer.toString();
}
String _formatTime(int seconds) {
final minute = seconds ~/ 60;
final second = (seconds % 60).toString().padLeft(2, '0');
return '$minute:$second';
}
String _goalTypeName(GoalType type) => switch (type) {
GoalType.fieldGoal => 'Field goal',
GoalType.shortCorner => 'Short corner',
GoalType.penaltyStroke => 'Penalty stroke',
};
String _cardName(CardType type) => switch (type) { String _cardName(CardType type) => switch (type) {
CardType.red => 'Red', CardType.red => 'Red',
CardType.yellow => 'Yellow', CardType.yellow => 'Yellow',
CardType.green => 'Green', CardType.green => 'Green',
}; };
String _cardDurationLabel(int durationSeconds) {
final minutes = durationSeconds ~/ 60;
final seconds = (durationSeconds % 60).toString().padLeft(2, '0');
return '$minutes:$seconds';
}
+374 -1
View File
@@ -1,6 +1,14 @@
# Generated by pub # Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile # See https://dart.dev/tools/pub/glossary#lockfile
packages: packages:
args:
dependency: transitive
description:
name: args
sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04
url: "https://pub.dev"
source: hosted
version: "2.7.0"
async: async:
dependency: transitive dependency: transitive
description: description:
@@ -33,6 +41,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.1.3" version: "1.1.3"
code_assets:
dependency: transitive
description:
name: code_assets
sha256: bf394f466ba9205f1812a0433b392d6af280f155f56651eda7c18cc32ed493b8
url: "https://pub.dev"
source: hosted
version: "1.2.1"
collection: collection:
dependency: transitive dependency: transitive
description: description:
@@ -41,6 +57,22 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.19.1" version: "1.19.1"
cross_file:
dependency: transitive
description:
name: cross_file
sha256: f141ea4f277af142a0356955707f6556f37b03947d39d55585981a06ca437bd6
url: "https://pub.dev"
source: hosted
version: "0.3.5+5"
crypto:
dependency: transitive
description:
name: crypto
sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf
url: "https://pub.dev"
source: hosted
version: "3.0.7"
cupertino_icons: cupertino_icons:
dependency: "direct main" dependency: "direct main"
description: description:
@@ -57,6 +89,30 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.3.3" version: "1.3.3"
ffi:
dependency: transitive
description:
name: ffi
sha256: "6d7fd89431262d8f3125e81b50d3847a091d846eafcd4fdb88dd06f36d705a45"
url: "https://pub.dev"
source: hosted
version: "2.2.0"
file:
dependency: transitive
description:
name: file
sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4
url: "https://pub.dev"
source: hosted
version: "7.0.1"
fixnum:
dependency: transitive
description:
name: fixnum
sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be
url: "https://pub.dev"
source: hosted
version: "1.1.1"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@@ -70,11 +126,72 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "6.0.0" version: "6.0.0"
flutter_svg:
dependency: "direct main"
description:
name: flutter_svg
sha256: "35882981abcbfb8c15b286f0cd690ff25bac12d95eff3e25ee207f37d4c42e7f"
url: "https://pub.dev"
source: hosted
version: "2.3.0"
flutter_test: flutter_test:
dependency: "direct dev" dependency: "direct dev"
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
flutter_web_plugins:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
hooks:
dependency: transitive
description:
name: hooks
sha256: "9a62a50b50b769a737bc0a8ff381f333529df3ab746b2f6b02e83760231455ba"
url: "https://pub.dev"
source: hosted
version: "2.0.2"
http:
dependency: transitive
description:
name: http
sha256: "87721a4a50b19c7f1d49001e51409bddc46303966ce89a65af4f4e6004896412"
url: "https://pub.dev"
source: hosted
version: "1.6.0"
http_parser:
dependency: transitive
description:
name: http_parser
sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571"
url: "https://pub.dev"
source: hosted
version: "4.1.2"
jni:
dependency: transitive
description:
name: jni
sha256: f038e58b4dc2c9037f50e233175086337e0b305e356d28211bf55f21c504cbd3
url: "https://pub.dev"
source: hosted
version: "1.0.3"
jni_flutter:
dependency: transitive
description:
name: jni_flutter
sha256: b2310cdd4c18c65c081ab141a41efa94aa26c65431803703ece51996f174f351
url: "https://pub.dev"
source: hosted
version: "1.0.3"
jni_util:
dependency: transitive
description:
name: jni_util
sha256: "1ba86da04a5f2bf18fde2edb235587e70c5b0fc5bd4ba955f46b00942c3fc35f"
url: "https://pub.dev"
source: hosted
version: "1.0.0"
leak_tracker: leak_tracker:
dependency: transitive dependency: transitive
description: description:
@@ -107,6 +224,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "6.1.0" version: "6.1.0"
logging:
dependency: transitive
description:
name: logging
sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61
url: "https://pub.dev"
source: hosted
version: "1.3.0"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
@@ -131,6 +256,30 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.18.3" version: "1.18.3"
mime:
dependency: transitive
description:
name: mime
sha256: bd47de35f07e27267e69c8c8b22edf9473bfee170a60d60fcc93730c5144b7f6
url: "https://pub.dev"
source: hosted
version: "2.1.0"
objective_c:
dependency: transitive
description:
name: objective_c
sha256: b7fb95a6d9a4f009edd63dc5ac69f07420b23a16161c6dd8660290b59c602e8e
url: "https://pub.dev"
source: hosted
version: "9.5.0"
package_config:
dependency: transitive
description:
name: package_config
sha256: ffcf4cf3d6c0b74ac43708d9f56625506e8a68aa935abe9d267a7330f320eb5d
url: "https://pub.dev"
source: hosted
version: "3.0.0"
path: path:
dependency: transitive dependency: transitive
description: description:
@@ -139,6 +288,118 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.9.1" version: "1.9.1"
path_parsing:
dependency: transitive
description:
name: path_parsing
sha256: "883402936929eac138ee0a45da5b0f2c80f89913e6dc3bf77eb65b84b409c6ca"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
path_provider:
dependency: transitive
description:
name: path_provider
sha256: a7f4874f987173da295a61c181b8ee71dab59b332a486b391babf26a1b884825
url: "https://pub.dev"
source: hosted
version: "2.1.6"
path_provider_android:
dependency: transitive
description:
name: path_provider_android
sha256: "69cbd515a62b94d32a7944f086b2f82b4ac40a1d45bebfc00813a430ab2dabcd"
url: "https://pub.dev"
source: hosted
version: "2.3.1"
path_provider_foundation:
dependency: transitive
description:
name: path_provider_foundation
sha256: "2a376b7d6392d80cd3705782d2caa734ca4727776db0b6ec36ef3f1855197699"
url: "https://pub.dev"
source: hosted
version: "2.6.0"
path_provider_linux:
dependency: transitive
description:
name: path_provider_linux
sha256: "58c2005f147315b11e9b4a7bc889cd5203e250cba8e3f012dae259b4972b5c16"
url: "https://pub.dev"
source: hosted
version: "2.2.2"
path_provider_platform_interface:
dependency: transitive
description:
name: path_provider_platform_interface
sha256: "484838772624c3a4b94f1e44a3e19897fee738f2d5c4ce448443b0417f7c9dda"
url: "https://pub.dev"
source: hosted
version: "2.1.3"
path_provider_windows:
dependency: transitive
description:
name: path_provider_windows
sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7
url: "https://pub.dev"
source: hosted
version: "2.3.0"
petitparser:
dependency: transitive
description:
name: petitparser
sha256: "91bd59303e9f769f108f8df05e371341b15d59e995e6806aefab827b58336675"
url: "https://pub.dev"
source: hosted
version: "7.0.2"
platform:
dependency: transitive
description:
name: platform
sha256: a36d119c13416516a7b5913fbe8af8531e11633d784c550b2125f76c758524ec
url: "https://pub.dev"
source: hosted
version: "3.2.0"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
url: "https://pub.dev"
source: hosted
version: "2.1.8"
pub_semver:
dependency: transitive
description:
name: pub_semver
sha256: "261236774e8b1d69cfc6b9eabbc96c40f25e7a2d6b171f3385d4f65d5734fb24"
url: "https://pub.dev"
source: hosted
version: "2.2.1"
record_use:
dependency: transitive
description:
name: record_use
sha256: "2551bd8eecfe95d14ae75f6021ad0248be5c27f138c2ec12fcb52b500b3ba1ed"
url: "https://pub.dev"
source: hosted
version: "0.6.0"
share_plus:
dependency: "direct main"
description:
name: share_plus
sha256: d7dc0630a923883c6328ca31b89aa682bacbf2f8304162d29f7c6aaff03a27a1
url: "https://pub.dev"
source: hosted
version: "11.1.0"
share_plus_platform_interface:
dependency: transitive
description:
name: share_plus_platform_interface
sha256: "88023e53a13429bd65d8e85e11a9b484f49d4c190abbd96c7932b74d6927cc9a"
url: "https://pub.dev"
source: hosted
version: "6.1.0"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter
@@ -192,6 +453,78 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.7.12" version: "0.7.12"
typed_data:
dependency: transitive
description:
name: typed_data
sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006
url: "https://pub.dev"
source: hosted
version: "1.4.0"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
sha256: "10f86fef4c2c43563fa6c211ff9cf757adf4d3ab762c56bd430664a947d70cd0"
url: "https://pub.dev"
source: hosted
version: "3.2.3"
url_launcher_platform_interface:
dependency: transitive
description:
name: url_launcher_platform_interface
sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029"
url: "https://pub.dev"
source: hosted
version: "2.3.2"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
sha256: "85c81589622fbc87c1c683aaea164d3604a7777495a79d91e39ffcdec39ddb34"
url: "https://pub.dev"
source: hosted
version: "2.4.3"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
sha256: "6c5ad3f22cd4c38e089b81963b3cd7bb83b111b2df5dce008bb066162f42e429"
url: "https://pub.dev"
source: hosted
version: "3.1.6"
uuid:
dependency: transitive
description:
name: uuid
sha256: "9b129329f58692f6e6578329498a8fe9fbe98f090beb764ffbb8ee2eadd01dcd"
url: "https://pub.dev"
source: hosted
version: "4.6.0"
vector_graphics:
dependency: transitive
description:
name: vector_graphics
sha256: "9d0e3b9cb16542ad660daee871e726a10d13a93b7b5391677c3160e8f5e83935"
url: "https://pub.dev"
source: hosted
version: "1.2.3"
vector_graphics_codec:
dependency: transitive
description:
name: vector_graphics_codec
sha256: "99fd9fbd34d9f9a32efd7b6a6aae14125d8237b10403b422a6a6dfeac2806146"
url: "https://pub.dev"
source: hosted
version: "1.1.13"
vector_graphics_compiler:
dependency: transitive
description:
name: vector_graphics_compiler
sha256: "4dca4feb77dc3ec7f6e27e49c53241eb8217f55e4f9b12599a27f8903bca5682"
url: "https://pub.dev"
source: hosted
version: "1.3.0"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
@@ -208,6 +541,46 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "15.3.0" version: "15.3.0"
web:
dependency: transitive
description:
name: web
sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a"
url: "https://pub.dev"
source: hosted
version: "1.1.1"
win32:
dependency: transitive
description:
name: win32
sha256: d7cb55e04cd34096cd3a79b3330245f54cb96a370a1c27adb3c84b917de8b08e
url: "https://pub.dev"
source: hosted
version: "5.15.0"
xdg_directories:
dependency: transitive
description:
name: xdg_directories
sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
xml:
dependency: transitive
description:
name: xml
sha256: "67f0aff7be013d107995e9b75bf4e7f2c3ef2dfdb2c8e68024bba0a7fd5756a4"
url: "https://pub.dev"
source: hosted
version: "7.0.1"
yaml:
dependency: transitive
description:
name: yaml
sha256: f67cdd8e07d3c6329146aaef1ba043542b3134c12489f553ca9a7435d1068aea
url: "https://pub.dev"
source: hosted
version: "3.1.4"
sdks: sdks:
dart: ">=3.13.3 <4.0.0" dart: ">=3.13.3 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54" flutter: ">=3.38.4"
+4
View File
@@ -31,6 +31,9 @@ dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
flutter_svg: ^2.1.0
share_plus: ^11.0.0
# The following adds the Cupertino Icons font to your application. # The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons. # Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.8 cupertino_icons: ^1.0.8
@@ -59,6 +62,7 @@ flutter:
assets: assets:
- lib/data/results.json - lib/data/results.json
- lib/data/icons/
# To add assets to your application, add an assets section, like this: # To add assets to your application, add an assets section, like this:
# assets: # assets:
+23 -2
View File
@@ -1,15 +1,36 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:mobile_app/app.dart'; import 'package:mobile_app/app.dart';
void main() { void main() {
testWidgets('App smoke test - renders match results, navigates to settings', testWidgets('App smoke test - renders match results, navigates to settings', (
(WidgetTester tester) async { WidgetTester tester,
) async {
await tester.pumpWidget(const MobileApp()); await tester.pumpWidget(const MobileApp());
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(find.text('Match Results'), findsOneWidget); expect(find.text('Match Results'), findsOneWidget);
expect(find.text('Home'), findsWidgets); expect(find.text('Home'), findsWidgets);
expect(find.text('Away'), findsWidgets); expect(find.text('Away'), findsWidgets);
expect(
find.textContaining(RegExp(r'\d{4}-\d{2}-\d{2} \d{2}:\d{2}')),
findsWidgets,
);
expect(find.text('Field goal · Away · #32'), findsNothing);
await tester.tap(
find.textContaining(RegExp(r'\d{4}-\d{2}-\d{2} \d{2}:\d{2}')).first,
);
await tester.pumpAndSettle();
expect(find.text('Field goal · Away · #32'), findsWidgets);
expect(find.textContaining('card · Away · #5 · 120s'), findsWidgets);
expect(find.byType(Divider), findsNothing);
final matchTile = tester.widget<ExpansionTile>(
find.byType(ExpansionTile).first,
);
expect(matchTile.shape, const Border());
expect(matchTile.collapsedShape, const Border());
// Switch to Settings tab // Switch to Settings tab
final settingsNav = find.text('Settings'); final settingsNav = find.text('Settings');