File tree 1 file changed +6
-1
lines changed
more_important_patterns/service_locator
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 1
- /// An example.
1
+ /// SMS example.
2
+ library ;
2
3
3
4
/// First,
4
5
/// we’ll create a MessagingService interface for sending messages in different ways:
@@ -11,21 +12,25 @@ abstract interface class MessagingService {
11
12
/// we’ll define two implementations of the interface above, that send messages through email and SMS:
12
13
/// the EmailService class.
13
14
class EmailService implements MessagingService {
15
+ @override
14
16
String getMessageBody () {
15
17
return "email message" ;
16
18
}
17
19
20
+ @override
18
21
String getServiceName () {
19
22
return "EmailService" ;
20
23
}
21
24
}
22
25
23
26
/// The SMSService class.
24
27
class SMSService implements MessagingService {
28
+ @override
25
29
String getMessageBody () {
26
30
return "SMS message" ;
27
31
}
28
32
33
+ @override
29
34
String getServiceName () {
30
35
return "SMSService" ;
31
36
}
You can’t perform that action at this time.
0 commit comments