ImagePicker로 로컬 사진을 불러와서 Image Widget을 만들 때 type 체크를 하면서 만들려고 했는데 아래 두 조건에는 안걸리더라구요.
else if (imgUri.runtimeType.toString() == File)
else if (imgUri.runtimeType.toString() == FileSystemEntity)
(참고한 docu: https://api.flutter.dev/flutter/dart-io/File-class.html)
그래서 아래 코드로 했는데, String처럼 뭔가 더 깔쌈한 방법 없을까요?
if (imgUri.runtimeType == String) {
img = Image.network(imgUri);
} else if (imgUri.runtimeType.toString() == "_File") {
img = Image.file(imgUri);