1234567891011121314151617181920212223242526272829303132 |
- import 'package:database/sql.dart';
- import 'package:database_adapter_sqlite/database_adapter_sqlite.dart';
- import 'package:taskservice/Model/JXMemberModel.dart';
- import 'package:taskservice/Model/JXServiceModel.dart';
- class MyDataBase {
- SqlClient _database;
- SqlClientTableHelper _memberHelper;
- SqlClientTableHelper _serviceHelper;
- static MyDataBase _instance;
- MyDataBase() {
- _database = SQLite(path: 'path/to/database.db',).database().sqlClient;
- _memberHelper = _database.table('members');
- _serviceHelper = _database.table('services');
- }
- static MyDataBase getInstance(){
- if(_instance == null) _instance = MyDataBase();
- return _instance;
- }
- Future<void> saveMember(JXMemberModel jxMemberModel) async {
- _memberHelper.insert(jxMemberModel.toMap());
- }
- Future<void> saveService(JXMemberModel jxMemberModel, JXServiceModel jxServiceModel) {
- }
- }
|