2019年4月10日 星期三

Flutter/Dart神奇的語法

習慣傳統程式語言,這種的初看像謎之符號,細看覺得神奇!!
Future <bool> ShowYesNoDialog(
BuildContext context,
doYes,
doNo
) async
{
return showDialog(
context: context,
builder: (context) => AlertDialog(
actions: <Widget>[
RaisedButton(
onPressed: ((){doYes();}),
),
RaisedButton(
onPressed: ((){doNo();}),
),
],
),
) ??
false;
}

await ShowYesNoDialog(
context, 'SayYesNo', 'Yes or No?',
((){print('yes');}),
((){print('no')}),
);

沒有留言:

VirtualBox 空間減肥

sdelete64 -z c: VBoxManage  modifymedium  disk  "/Users/fellow/VirtualBox VMs/Win10/Win10.vdi"  --compact *.vdi 路徑可以在 VirtualBox 儲...