2019-04-24 12:25:46 +00:00
|
|
|
import 'package:comunic/helpers/database/database_contract.dart';
|
|
|
|
import 'package:comunic/helpers/database/model_database_helper.dart';
|
2019-04-24 13:03:36 +00:00
|
|
|
import 'package:comunic/lists/conversations_list.dart';
|
2019-04-24 12:25:46 +00:00
|
|
|
import 'package:comunic/models/conversation.dart';
|
|
|
|
|
|
|
|
/// Conversations database helper
|
|
|
|
///
|
|
|
|
/// @author Pierre HUBERT
|
|
|
|
|
|
|
|
class ConversationsDatabaseHelper extends ModelDatabaseHelper<Conversation> {
|
|
|
|
@override
|
|
|
|
Conversation initializeFromMap(Map<String, dynamic> map) {
|
|
|
|
return Conversation.fromMap(map);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
String tableName() {
|
|
|
|
return ConversationTableContract.TABLE_NAME;
|
|
|
|
}
|
|
|
|
|
2019-04-24 13:03:36 +00:00
|
|
|
@override
|
|
|
|
Future<ConversationsList> getAll() async {
|
|
|
|
ConversationsList list = ConversationsList();
|
|
|
|
list.addAll(await super.getAll());
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-04-24 12:25:46 +00:00
|
|
|
}
|