simple_copy_with_generators

Creator: coderz1093

Last updated:

0 purchases

TODO
Add to Cart

Description:

simple copy with generators

This package contains annotations for generate copywith method for any Dart classes #
Configure: #
Add in you pubspec.yaml to dependencies section:
dependencies:
...
simple_copy_with_annotations:
...
copied to clipboard
and to dev_dependencies ( build_runner & simple_copy_with_generators ):
dev_dependencies:
...
build_runner:
simple_copy_with_generators:
...
copied to clipboard
Use: #
Annotate you class copywith annotation. Like this:
part 'profile_model.g.dart';
@copywith
class ProfileModel {
String _name = 'Aachman';
int _age = 20;
bool _codes = true;
}
copied to clipboard
after in console run this command:
flutter pub run build_runner build
copied to clipboard
and use:
final ProfileModel profile = ProfileModel()
..name = 'Sergio'
..age = 35
..codes = true;

final newProfile = profile.copyWith(name: 'Michael');
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.

Related Products

More From This Creator