Toán tử ! yêu cầu Dart xử lý biến nullable như non-nullable mà không kiểm tra.
Ví dụ: String name = nullableName! — điều này khẳng định nullableName không phải null. Chỉ dùng khi bạn chắc chắn 100% biến không null; nếu sai sẽ ném lỗi runtime. Lạm dụng ! thường cho thấy thiết kế chưa tốt.
The ! operator tells Dart to treat a nullable variable as non-nullable without checking.
- Use it only when you're 100% certain a variable won't be null; if wrong, it throws a runtime exception.
- Overuse indicates poor design and should be avoided.