karee_inject 1.0.3+1 karee_inject: ^1.0.3+1 copied to clipboard
Part of Karee that manage all annotation used to inject dependency
example/karee_inject_example.dart
import 'package:karee_inject/karee_inject.dart';
import 'interface.dart';
@Persistable(collection: 'users')
class User {
double id;
String name;
User.from({required this.id, required this.name});
}
@Service
class ServiceUser {
@Autowired
late DatabaseInterface db;
User? getUserById(double id) {
return db.find<User>().firstWhere('id', isEqualTo: id);
}
}