Created with <3 with dartpad.dev.
Created
October 29, 2022 00:19
-
-
Save Nyae44/21d959c20d8dccb3e99a5ff67171e297 to your computer and use it in GitHub Desktop.
quintessential-toast-2689
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
void main(){ | |
Car myCar = Car(drive : slowDrive); | |
myCar.drive(); | |
myCar.drive = fastDrive; | |
myCar.drive(); | |
} | |
class Car { | |
Car({ required this.drive}); | |
Function drive; | |
} | |
void slowDrive (){ | |
print('Drive slowly'); | |
} | |
void fastDrive(){ | |
print('driving super fast'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment