query method
Future<List<AvatarModel> ?>
query({
- String? tableName,
- bool? distinct,
- List<
String> ? columns, - String? where,
- List<
Object?> ? whereArgs, - String? groupBy,
- String? having,
- String? orderBy,
- int? limit,
- int? offset,
inherited
调用sqflite 封装好的查询
Implementation
@override
Future<List<T>?> query(
{String? tableName,
bool? distinct,
List<String>? columns,
String? where,
List<Object?>? whereArgs,
String? groupBy,
String? having,
String? orderBy,
int? limit,
int? offset}) async {
List<Map<String, Object?>> _lists = await _db.query(tableName ?? table,
distinct: distinct,
columns: columns,
where: where,
whereArgs: whereArgs,
groupBy: groupBy,
having: having,
orderBy: orderBy,
limit: limit,
offset: offset);
if (_lists.isEmpty) return null;
List<T> _datas = [];
for (Map<String, Object?> map in _lists) {
_datas.add(fromJson(map));
}
return _datas;
}