Shows username on listtile

This commit is contained in:
marcoabat
2023-08-12 12:43:15 +02:00
parent 271190b459
commit d37d4a6866
8 changed files with 89 additions and 6 deletions

View File

@@ -0,0 +1,18 @@
import 'package:flutter/material.dart';
import '../models/profile.dart';
class ProfileProvider extends ChangeNotifier {
List<Profile> _profiles = [];
void updateProfiles(List<Profile> profiles, {bool silent = false}) {
_profiles = profiles;
if (!silent) notifyListeners();
}
Profile? getProfileById(String id) {
if (_profiles.isEmpty) return null;
final profile = _profiles.where((element) => element.id == id).first;
return profile;
}
}