Created
May 31, 2020 16:36
-
-
Save arnold-parge/d216a51a4b6a83771586e1a148226f9c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:sqflite/sqflite.dart'; | |
import 'package:path/path.dart'; | |
class AppSqliteDb { | |
static Database sqliteDb; | |
static String sqliteDbName = 'db1.db'; | |
static Future init() async { | |
String databasesPath = await getDatabasesPath(); | |
String userDBPath = join(databasesPath, '$sqliteDbName'); | |
sqliteDb = await openDatabase( | |
userDBPath, | |
version: 1, | |
onCreate: (Database db, int version) async { | |
db.execute('''CREATE TABLE IF NOT EXISTS user ( | |
gender TEXT, | |
name_title TEXT, | |
name_first TEXT, | |
name_last TEXT, | |
location_street_name TEXT, | |
location_street_number TEXT, | |
location_city TEXT, | |
location_state TEXT, | |
location_country TEXT, | |
location_postcode TEXT, | |
location_coordinates_latitude TEXT, | |
location_coordinates_longitude TEXT, | |
location_timezone_offset TEXT, | |
location_timezone_description TEXT, | |
email TEXT, | |
login_uuid TEXT primary key, | |
login_username TEXT, | |
login_password TEXT, | |
login_salt TEXT, | |
login_md5 TEXT, | |
login_sha1 TEXT, | |
login_sha256 TEXT, | |
dob_date TEXT, | |
dob_age TEXT, | |
registered_date TEXT, | |
registered_age TEXT, | |
phone TEXT, | |
cell TEXT, | |
id_name TEXT, | |
id_value TEXT, | |
picture_large TEXT, | |
picture_medium TEXT, | |
picture_thumbnail TEXT, | |
nat TEXT | |
)'''); | |
}, | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment