Last updated:
0 purchases
simple copy with annotations
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 & 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
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.