Created
October 14, 2022 12:03
-
-
Save g123k/4587631d90754abe0f1f476a2c84801a to your computer and use it in GitHub Desktop.
Code Flutter Digest #95
This file contains 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
class Cow { | |
void moo() { | |
print('moo'); | |
} | |
} | |
class Ranch { | |
Ranch([Cow? cow]) | |
: _cow = cow ?? Cow() | |
..moo(); | |
late final Cow _cow; | |
} | |
void main() { | |
Ranch(); | |
Ranch(Cow()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment