copy_with_isar 0.0.5 copy "copy_with_isar: ^0.0.5" to clipboard
copy_with_isar: ^0.0.5 copied to clipboard

Small lib for add annotations to isar models.

Copy With Isar #

A package for auto-generating copyWith methods in Dart classes.

Features #

  • Automatically generate copyWith methods for your Dart classes.
  • Simple and easy to use.
  • Reccommends for use with Isar models

Usage #

import 'package:copy_with_isar/annotations.dart';

part 'example.icopy.dart';

@IsarCopy()
class ExampleModel {
  String? firstName;
  String? lastName;
}

void main() {
  final model = ExampleModel()
    ..firstName = 'Json'
    ..lastName = 'Smith';
  print('Original: ${model.firstName} ${model.lastName}'); //Original: Json Smith

  final updatedModel = model.copyWith(firstName: 'Jane');
  print('Updated: ${updatedModel.firstName} ${updatedModel.lastName}'); //Updated: Jane Smith
}

To use this package, add it to your pubspec.yaml file:

dependencies:
  copy_with_isar: ^0.0.5
1
likes
130
points
64
downloads

Publisher

unverified uploader

Weekly Downloads

Small lib for add annotations to isar models.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

analyzer, build, source_gen

More

Packages that depend on copy_with_isar