import 'package:http/http.dart' as http; import 'package:overfast_api/heroes/heroes.dart'; import 'package:overfast_api/players/players.dart'; import './utils/utils.dart' as utils; import 'maps/maps.dart'; class Overfast { final Uri baseUri; late final Future Function( String, [ Map, ]) get; late final Future> Function( String, [ Map, ]) getList; final client = http.Client(); late final Maps maps; late final Players players; late final Heroes heroes; Overfast([Uri? baseUri]) : baseUri = baseUri ?? Uri.https('overfast-api.tekrop.fr') { get = utils.get(client, this.baseUri); getList = utils.getList(client, this.baseUri); maps = Maps(this); players = Players(this); heroes = Heroes(this); } void close() { client.close(); } }