laadVoorGebruiker method

Future<void> laadVoorGebruiker(
  1. String gebruikerId
)

Implementation

Future<void> laadVoorGebruiker(String gebruikerId) async {
  _gebruikerId = gebruikerId;
  _projecten = [];
  final prefs = await SharedPreferences.getInstance();
  final json = prefs.getString(_key);
  if (json != null) {
    final list = jsonDecode(json) as List;
    _projecten = list
        .map((e) => Project.fromJson(e as Map<String, dynamic>))
        .toList();
  }
  notifyListeners();
}