This commit is contained in:
Морозов Андрей 2022-03-18 12:03:50 +00:00
parent 605e39e09e
commit bbc83bd593
1 changed files with 4 additions and 4 deletions

View File

@ -1,8 +1,8 @@
const adapteeMessage = 'Adaptee#method was called'; const adapteeMessage = 'Вызов адаптирующегося метода';
class Adaptee { class Adaptee {
String method() { String method() {
print('Adaptee#method is being called'); print('Вызов адаптирующегося метода');
return adapteeMessage; return adapteeMessage;
} }
@ -15,7 +15,7 @@ abstract class Target {
class Adapter implements Target { class Adapter implements Target {
String call() { String call() {
var adaptee = Adaptee(); var adaptee = Adaptee();
print('Adapter#call is being called'); print('Вызов адаптирующегося метода');
return adaptee.method(); return adaptee.method();
} }
@ -25,5 +25,5 @@ void main() {
var adapter = Adapter(); var adapter = Adapter();
var result = adapter.call(); var result = adapter.call();
assert(result == adapteeMessage); print(result == adapteeMessage);
} }