본문 바로가기
개발/Flutter

flutter 인자 callback 받을 때,

by dev_caleb 2023. 9. 3.
728x90

아무 인자가 없을 때는 VoidCallback 받았는데,

 이렇게 인수가 있을 때는 Fuction(int) callback; 이런식으로 받아야한다.

이런식으로 넣는 것이다! 

이전에는 typeDef를 따로 만들어주고 이상한 코드를 만들었는데 그렇게 안해도 될 것 같다! 

728x90

'개발 > Flutter' 카테고리의 다른 글

android key hash 받기  (0) 2023.09.03
Go Router intialLocation 지정하기  (0) 2023.09.03
Android SDK "Android API 29 platform" is not found on the disk or corrupted  (0) 2023.09.02
GetX, GoRouter 함께 사용하기!  (0) 2023.08.21
mapIndexed  (0) 2023.08.10