new: add postfix to name if it is not unique
This commit is contained in:
@@ -9,6 +9,7 @@ part 'profile_data_source.g.dart';
|
||||
abstract interface class ProfileDataSource {
|
||||
Future<ProfileEntry?> getById(String id);
|
||||
Future<ProfileEntry?> getByUrl(String url);
|
||||
Future<ProfileEntry?> getByName(String name);
|
||||
Stream<ProfileEntry?> watchActiveProfile();
|
||||
Stream<int> watchProfilesCount();
|
||||
Stream<List<ProfileEntry>> watchAll({
|
||||
@@ -44,6 +45,13 @@ class ProfileDao extends DatabaseAccessor<AppDatabase>
|
||||
..limit(1))
|
||||
.getSingleOrNull();
|
||||
}
|
||||
@override
|
||||
Future<ProfileEntry?> getByName(String name) async {
|
||||
return (select(profileEntries)
|
||||
..where((tbl) => tbl.name.equals(name))
|
||||
..limit(1))
|
||||
.getSingleOrNull();
|
||||
}
|
||||
|
||||
@override
|
||||
Stream<ProfileEntry?> watchActiveProfile() {
|
||||
|
||||
Reference in New Issue
Block a user