Initial Commit, finally got some time to start this
This commit is contained in:
10
lib/models/constants.dart
Normal file
10
lib/models/constants.dart
Normal file
@@ -0,0 +1,10 @@
|
||||
const String dbName = 'notes.db';
|
||||
|
||||
const int dbVersionNumber = 1;
|
||||
|
||||
String tableNotes = 'Notes';
|
||||
|
||||
String columnId = '_id';
|
||||
String columnTitle = 'title';
|
||||
String columnContent = 'content';
|
||||
|
||||
11
lib/models/db/dbnote.dart
Normal file
11
lib/models/db/dbnote.dart
Normal file
@@ -0,0 +1,11 @@
|
||||
import 'package:cv/cv.dart';
|
||||
import 'package:simple_notes/models/db/dbrecord.dart';
|
||||
import 'package:simple_notes/models/constants.dart';
|
||||
|
||||
class DBNote extends DBRecord {
|
||||
final title = CvField<String>(columnTitle);
|
||||
final content = CvField<String>(columnContent);
|
||||
|
||||
@override
|
||||
List<CvField> get fields => [id, title, content];
|
||||
}
|
||||
6
lib/models/db/dbrecord.dart
Normal file
6
lib/models/db/dbrecord.dart
Normal file
@@ -0,0 +1,6 @@
|
||||
import 'package:cv/cv.dart';
|
||||
import 'package:simple_notes/models/constants.dart';
|
||||
|
||||
abstract class DBRecord extends CvModelBase {
|
||||
final id = CvField<int>(columnId);
|
||||
}
|
||||
Reference in New Issue
Block a user