Flutter/Dart

[Flutter] void Function()? onTap

개발자킹콩 2023. 4. 29. 13:50

Swift의 closure, Java의 lamda 등 함수포인터에서 기능이 더 추가된 클로져라는 것을 이용해서 이전 화면에서 다음 화면에 대한 제어권을 가질 수 있다.

 

그렇다면 Flutter 은 어떻게 사용할까?

아래와 같이 사용된다.

- void Function()? onPress;

- String Function(String value)? onPress;

 

 

 

 

 

 

 

 


 

 

 

 

Reference

 

https://devmemory.tistory.com/54

 

Flutter 2.0 - Callback Function

기존 프로젝트를 2.0으로 Migration을 하면서 Null safety부분 때문에 변경된 부분이 생각보다 많다는걸 느꼈습니다 그중 하나가 callback이었는데 여러분들은 삽질하지 마시길 바라며 포스트 올립니다.

devmemory.tistory.com

 

https://youngest-programming.tistory.com/686

 

[Flutter] Function 클래스와 예제

플러터는 객체지향과 함수형 프로그래밍 특징을 모두 가진 언어이다. https://api.flutter.dev/flutter/dart-core/Function-class.html Function class - dart:core library - Dart API The base class for all function types. The run-time typ

youngest-programming.tistory.com