import 'dart:convert'; import 'package:flutter/services.dart'; import '../../domain/models/hockey_game.dart'; class MatchRepository { MatchRepository({AssetBundle? bundle}) : _bundle = bundle ?? rootBundle; final AssetBundle _bundle; Future> loadMatches() async { final contents = await _bundle.loadString('lib/data/results.json'); final data = jsonDecode(contents) as Map; return (data['games'] as List) .map((game) => Match.fromJson(game as Map)) .toList(); } }