insert method
void
insert({
- String? where,
- List<
Object?> ? whereArgs, - BoxerOptionType join = BoxerOptionType.AND,
- bool isInsertInFront = false,
Implementation
void insert({
String? where,
List<Object?>? whereArgs,
BoxerOptionType join = BoxerOptionType.AND,
bool isInsertInFront = false,
}) {
if (where == null || (where = where.trim()).isEmpty) return;
/// insert where
String? _where = this.where;
if (_where == null || (_where = _where.trim()).isEmpty) {
this.where = where;
} else {
this.where = joinWith(isInsertInFront ? [where, _where] : [_where, where], join);
}
/// insert where arguments
if (whereArgs != null && whereArgs.isNotEmpty) {
List<Object?> _whereArgs = List<Object?>.from(this.whereArgs ??= []);
isInsertInFront ? _whereArgs.insertAll(0, whereArgs) : _whereArgs.addAll(whereArgs);
this.whereArgs = _whereArgs;
}
}