Service class

Service layer annotation - indicates that this class provides business logic

This annotation is a specialization of @Component for classes that contain business logic or service operations.

Example:

@Service()
class UserService {
  final UserRepository userRepository;

  UserService(this.userRepository);

  Future<User> getUser(int id) {
    return userRepository.findById(id);
  }
}
Inheritance

Constructors

Service([String? value])
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value String?
Optional value to specify the component name
finalinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited