mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-22 12:59:21 +00:00
20 lines
459 B
Dart
20 lines
459 B
Dart
|
import 'package:comunic/helpers/database/database_contract.dart';
|
||
|
import 'package:meta/meta.dart';
|
||
|
|
||
|
/// Cache base model
|
||
|
///
|
||
|
/// @author Pierre HUBERT
|
||
|
|
||
|
abstract class CacheModel {
|
||
|
final int id;
|
||
|
|
||
|
const CacheModel({@required this.id}) : assert(id != null);
|
||
|
|
||
|
/// Initialize a CacheModel from a map
|
||
|
CacheModel.fromMap(Map<String, dynamic> map)
|
||
|
: id = map[BaseTableContract.C_ID];
|
||
|
|
||
|
/// Convert the object to a map
|
||
|
Map<String, dynamic> toMap();
|
||
|
}
|