Closure là một hàm "đóng gói" (capture) các biến từ phạm vi bao quanh và có thể truy cập chúng ngay cả sau khi hàm ngoài đã kết thúc.
Ví dụ: int makeAdder(int x) { return (int y) => x + y; } — hàm bên trong "giữ lại" biến x. Closure rất hữu ích cho callbacks và lập trình hàm trong Dart.
A closure is a function that captures variables from its surrounding scope and can access them even after the outer function has finished.
Closures are powerful for callbacks and functional programming patterns in Dart.