open function
Open a window
Implementation
open(context, Widget page, {Function? beforeOpen, Function? afterClose}) {
if (beforeOpen != null) {
beforeOpen();
} else {
SoundPlayer.i.play(Sounds.action);
}
Navigator.of(context).push(MaterialPageRoute(builder: (BuildContext context) {
return page;
})).then((_) {
if (afterClose != null) {
afterClose();
} else {
SoundPlayer.i.play(Sounds.wood_hit);
}
});
}