copy_with_isar 0.0.5 copy_with_isar: ^0.0.5 copied to clipboard
Small lib for add annotations to isar models.
import 'package:copy_with_isar/annotations.dart';
part 'example.icopy.dart';
@IsarCopy()
class ExampleModel {
int id = 0;
String? firstName;
String? lastName;
}
void main() {
final model = ExampleModel()
..firstName = 'Json'
..lastName = 'Smith';
print('Original: ${model.firstName} ${model.lastName}');
final updatedModel = model.copyWith(firstName: 'Jane');
print('Updated: ${updatedModel.firstName} ${updatedModel.lastName}');
}