Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

cascade notation

// Dart Cascade notation: myObject..someMethod()
querySelector('#confirm')
..text = 'Confirm'
..classes.add('important')
..onClick.listen((e) => window.alert('Confirmed!'));
// can replace (you don’t need the button variable):
var button = querySelector('#confirm');
button.text = 'Confirm';
button.classes.add('important');
button.onClick.listen((e) => window.alert('Confirmed!'));
Source by dart.dev #
 
PREVIOUS NEXT
Tagged: #cascade #notation
ADD COMMENT
Topic
Name
1+3 =