Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. Future<Database> getDatabaseInstanace() async {
  2. Directory directory = await getApplicationDocumentsDirectory();
  3.  
  4. String path = join(directory.path, "client.db");
  5.  
  6. return await openDatabase(path, version: 1,
  7. onCreate: (Database db, int version) async {
  8. await db.execute("CREATE TABLE Client ("
  9. "id integer primary key,"
  10. "name TEXT,"
  11. "phone TEXT"
  12. ")");
  13. });
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement