Skip to content

Instantly share code, notes, and snippets.

@Nyae44
Created October 29, 2022 00:19
Show Gist options
  • Save Nyae44/21d959c20d8dccb3e99a5ff67171e297 to your computer and use it in GitHub Desktop.
Save Nyae44/21d959c20d8dccb3e99a5ff67171e297 to your computer and use it in GitHub Desktop.
quintessential-toast-2689

quintessential-toast-2689

Created with <3 with dartpad.dev.

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