import 'package:shared_preferences/shared_preferences.dart';

class TeamSelectionStorage {
  static const _keySelectedTeamId = 'selected_team_id';

  static Future<String?> load() async {
    final prefs = await SharedPreferences.getInstance();
    final id = prefs.getString(_keySelectedTeamId);
    if (id == null || id.isEmpty) return null;
    return id;
  }

  static Future<void> save(String teamId) async {
    final prefs = await SharedPreferences.getInstance();
    await prefs.setString(_keySelectedTeamId, teamId);
  }

  static Future<void> clear() async {
    final prefs = await SharedPreferences.getInstance();
    await prefs.remove(_keySelectedTeamId);
  }
}
