Developments/Flutter

Flutter/Error] Null check operator used on a null value

Meuse 2023. 9. 19. 14:41
반응형

======== Exception caught by rendering library ========
The following _TypeError was thrown during performLayout():
Null check operator used on a null value

 

======== Exception caught by rendering library ========
The following _TypeError was thrown during paint():
Null check operator used on a null value

 

어떤 값이 Null값인지 안 알려주고 Null 체크하라는 메시지만 나와서... 미쳐버리는 줄 알았는데, 

FittedBox 안에 Text의 String 값이 아무것도 없으면 뿜어내는 에러 였다.. 초기값을 '' 에서 ' '으로 변경해주니 해결됬다.

Flexible(
    child: FittedBox(
        fit: BoxFit.scaleDown,
        child: Text(title ?? '', style: titleLarge),
    ),
),

 

반응형

'Developments > Flutter' 카테고리의 다른 글

Flutter/Widget] SegmentedButton  (1) 2024.01.24
Flutter dark mode using riverpod  (0) 2023.12.27
Flutter에 Admob 광고 달기 (google_mobile_ads)  (0) 2023.09.18
Flutter/Package] shared_preferences  (0) 2022.12.07
Flutter/Widget] Tabbar  (0) 2022.12.02