0 purchases
copy annotation
"copy_annotation" is a annotation based code generation package for Flutter that generates a copyWith method with extension functions for immutable classes.
Work together with copy_annotation_gen to generate code.
Usage #
dependencies:
copy_annotation: ^latest_version
copied to clipboard
Then, you need to add the following dependencies for code generation:
dev_dependencies:
build_runner: ^latest_version
copy_annotation_gen: ^latest_version
copied to clipboard
Example #
@copy
class Employee {
final int id;
final String name;
Employee({required this.id,required this.name})
}
final emp1 = Employee(id:1,name:"John");
final emp2 = emp1.copy(id:2,name:"Mina");
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.