Flutter/Error
-
[Error] 'package:flutter/src/material/data_table.dart': Failed assertion: line 416 pos 15: '!rows.any((DataRow row) => row.cells.length != columns.length)': is not true.Flutter/Error 2023. 6. 28. 11:51
언제나 그렇듯 나타나는 친구같은 레드 스크린 .. 에러를 읽어봐도 알겠지만 DataTable은 column과 rows로 구성되어 있고, column과 rows의 갯수는 같아야 한다. column이 3개면 rows도 3개가 되야하고, 갯수가 일치하지 않을때 이런 오류를 나타낸다. length* 끝!
-
[Error] Cannot provide both a color and a decorationTo provide both, use "decoration: BoxDecoration(color: color)".'package:flutter/src/widgets/container.dart':Failed assertion: line 273 pos 15: 'color == null || decoration == null'Flutter/Error 2023. 6. 26. 10:11
Container를 사용하다보면 가끔 이런 오류를 만나게 되는데 color 사용에 대한 오류라고 볼 수 있다. 아마 위와 같은 Container를 그리는데 코드는 Container( width: 410, height: 200, color: Colors.grey, child: Text("Container Test"), ), 이와 동일하거나 비슷할 것이다. Container에 color를 주어도 정상 작동하다 어느순간부터 오류를 나타내게 되는데 .. Flutter 개발자라면 만나기 싫은 1순위, 빨간 화면이 나타난다. 이유는 간단하다. decoration: BoxDecoration(), Container 안에서 박스에 대한 레이아웃 속성을 줄때 decoration을 사용하게 되는데 decoration 내에서..
-
[Error] Unhandled Exception: Looking up a deactivated widget's ancestor is unsafe.Flutter/Error 2023. 6. 23. 10:59
E/flutter ( 3423): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Looking up a deactivated widget's ancestor is unsafe. E/flutter ( 3423): At this point the state of the widget's element tree is no longer stable. 이라는 오류를 직면하게 되는 경우가 있을 것이다. 나 같은 경우는 Future.delayed(Duration(seconds: 2), () { Navigator.of(context).pop(false); }); 버튼을 눌렀을 때 showDialog를 경고창을 띄우고 2초 뒤에 사라지길 원..