플러터 에러5 A value of type ‘Object?’ can’t be assigned to a variable of type ‘LayoutType?’. 에러 메시지 에러 원인 선택된 버튼에 따라 변경되는 값이 있는데, 값이 Object로 리턴되고, 리턴받은 값을 사용하기 위해 타입이 지정된 변수에 넣으려고 했을 때 생기는 에러다. 에러 해결 방안 값을 변경할 때 값을 받을 변수의 타입으로 캐스팅하기 LayoutType? selectedType = LayoutType.Chart; Container( alignment: Alignment.center, padding: EdgeInsets.all(10), child: CustomRadioButton( elevation: 0, absoluteZeroSpacing: true, defaultSelected: selectedType, unSelectedColor: CustomColor.lightGrey4, butto.. 2022. 1. 17. 이전 1 2 다음