Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Future<Database> getDatabaseInstanace() async {
- Directory directory = await getApplicationDocumentsDirectory();
- String path = join(directory.path, "client.db");
- return await openDatabase(path, version: 1,
- onCreate: (Database db, int version) async {
- await db.execute("CREATE TABLE Client ("
- "id integer primary key,"
- "name TEXT,"
- "phone TEXT"
- ")");
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement