- [Flutter]null-safety 적용(type casting, ? ! operator) 목차
반응형

입력 타입을 String으로 받음으로 type casting을 사용
즉, val as String

return val!.length 로 변경
즉 'a null check to the target ('!') "를 추가하였다
그러나 val 값이 null이 되면 'run time error'가 발생한다.

if(formKey.currentState!.validate()) 로 수정
반응형
'flutter' 카테고리의 다른 글
[VSCode]주석(Commnet) 만들기/해제하기 (0) | 2021.12.26 |
---|---|
[Flutter]Cannot fit requested classes in a single dex file (# methods: 91243 > 65536) (0) | 2021.11.21 |
[Flutter]keytool error: java.lang.Exception: Keystore file does not exist: ~/.android/debug.keystore (0) | 2021.09.05 |
'keytool'은(는) 내부 또는 외부 명령, 실행할 수 있는 프로그램, 또는배치 파일이 아닙니다. (0) | 2021.08.22 |
[Flutter]sqlite에서 저장된 데이터 가져오기(query) (0) | 2021.08.04 |