Skip to content

Commit 24a1bc6

Browse files
committed
Add @OverRide annotations and library declaration in service locator example
1 parent 80b2388 commit 24a1bc6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

more_important_patterns/service_locator/service_locator_example.dart

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/// An example.
1+
/// SMS example.
2+
library;
23

34
/// First,
45
/// we’ll create a MessagingService interface for sending messages in different ways:
@@ -11,21 +12,25 @@ abstract interface class MessagingService {
1112
/// we’ll define two implementations of the interface above, that send messages through email and SMS:
1213
/// the EmailService class.
1314
class EmailService implements MessagingService {
15+
@override
1416
String getMessageBody() {
1517
return "email message";
1618
}
1719

20+
@override
1821
String getServiceName() {
1922
return "EmailService";
2023
}
2124
}
2225

2326
/// The SMSService class.
2427
class SMSService implements MessagingService {
28+
@override
2529
String getMessageBody() {
2630
return "SMS message";
2731
}
2832

33+
@override
2934
String getServiceName() {
3035
return "SMSService";
3136
}

0 commit comments

Comments
 (0)