This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:math' as math; | |
| sealed class Shape { | |
| } | |
| class Square extends Shape { | |
| final double length; | |
| Square(this.length); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension ListAdd1 on List { | |
| void add1(element) { | |
| add(element); | |
| } | |
| } | |
| extension ListAdd2<T> on List<T> { | |
| void add2(T element) { | |
| add(element); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| final foo = Foo(); | |
| final bar = Bar(); | |
| class Foo { | |
| final i = bar; | |
| } | |
| class Bar {} | |
| void main() { | |
| print('Hello with $foo and $bar'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void main() { | |
| final urlString = "http://example.com\\.google.com"; | |
| final uri = Uri.parse(urlString); | |
| print('Host: ${uri.host}'); | |
| print('Ends with google.com: ${uri.host.endsWith('.google.com')}'); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void main() { | |
| const greeting = 'Hello, World!'; | |
| print(greeting); | |
| } |