Adding base project of flutter-hybrid

This commit is contained in:
Azmat-7860
2026-09-12 11:22:07 +05:30
commit 45850796dc
471 changed files with 27188 additions and 0 deletions
+104
View File
@@ -0,0 +1,104 @@
import 'package:sqflite/sqflite.dart';
class TableQuery {
Future<void> createOtherTable(Database db) async {
// Table Query
_createGauravt2(db, 'Gauravt2');
_createGauravtest1(db, 'Gauravtest1');
}
// Table Query Data
Future<void> _createGauravt2(Database db, String tableName) async {
var tableExists = await _isTableExists(db, tableName);
if (!tableExists) {
print('$tableName making.....');
await db.execute(
'''
CREATE TABLE $tableName (
id INTEGER PRIMARY KEY AUTOINCREMENT,
accountId TEXT,
createdAt TEXT,
createdBy TEXT,
updatedAt TEXT,
updatedBy TEXT,
extn1 TEXT,
extn2 TEXT,
extn3 TEXT,
extn4 TEXT,
extn5 TEXT,
extn6 TEXT,
extn7 TEXT,
extn8 TEXT,
extn9 TEXT,
extn10 TEXT,
extn11 TEXT,
extn12 TEXT,
extn13 TEXT,
extn14 TEXT,
extn15 TEXT,
phone TEXT,
nme TEXT,
imageupload TEXT,
)''');
} else {
print('$tableName table exist');
}
}
Future<void> _createGauravtest1(Database db, String tableName) async {
var tableExists = await _isTableExists(db, tableName);
if (!tableExists) {
print('$tableName making.....');
await db.execute(
'''
CREATE TABLE $tableName (
id INTEGER PRIMARY KEY AUTOINCREMENT,
accountId TEXT,
createdAt TEXT,
createdBy TEXT,
updatedAt TEXT,
updatedBy TEXT,
extn1 TEXT,
extn2 TEXT,
extn3 TEXT,
extn4 TEXT,
extn5 TEXT,
extn6 TEXT,
extn7 TEXT,
extn8 TEXT,
extn9 TEXT,
extn10 TEXT,
extn11 TEXT,
extn12 TEXT,
extn13 TEXT,
extn14 TEXT,
extn15 TEXT,
college TEXT,
Name TEXT,
)''');
} else {
print('$tableName table exist');
}
}
Future<bool> _isTableExists(Database db, String tableName) async {
var result = await db.rawQuery(
'SELECT * FROM sqlite_master WHERE type = ? AND name = ?',
['table', tableName],
);
return result.isNotEmpty;
}
}