flutter/issue
type 'Null' is not a subtype of type 'String' in type cast 에러
신주봉
2022. 12. 13. 19:30
The following _CastError was thrown building
StreamBuilder<QuerySnapshot<Post>>
(dirty, state: _StreamBuilderBaseState<QuerySnapshot<Post>,
AsyncSnapshot<QuerySnapshot<Post>>>#c402b):
type 'Null' is not a subtype of type 'String' in type cast
게시판에 사진과 글을 받아오는 어플을 제작하던 도중 이러한 에러에 직면했다.
온갖 방법을 사용해봤지만 안돼서 뭔가 하던 찰나
_TypeError was thrown building StreamBuilder<QuerySnapshot<Object?>> type 'Null' is not a subtype of type 'String' in Flutter
I am doing one flutter course while running the code I am getting type 'Null' is not a subtype of type 'String'. My code: import 'package:flutter/material.dart'; import 'package:cloud_firestore/
stackoverflow.com
이 글을 보고 내 멍청함에 감탄하였다.
설계 도중 이미지를 .asset으로 받아 경로가 널값으로 표기되어있었다.
이러한 오류는 firebase의 사진 경로가 '' 널값인 것을 지워 해결하였다.