본문 바로가기

flutter 에러3

[Flutter] The return type ‘num’ isn’t a ‘T’, as required by the closure’s context. 에러 해당 코드 /// 공통 피커의 아이템 값 목록 생성 List generatePickerValues( {required T start, required T end, num interval = 1, int decimalPoint = 2}) { assert(start != end); assert(interval > 0); correctionValue(num value) => floatingPointErrorCorrectionValue(value, decimalPoint: decimalPoint); final range = correctionValue(end - start); final step = range.abs() ~/ interval; return List.generate(step + 1, (i) .. 2022. 2. 23.
[Flutter] cmdline-tools component is missing 최근까지 flutter 버전 2.2.3을 사용하다가 apk를 빌드를 하다가 사용 중인 플러그인 중 flutter_svg가 flutter 버전 2.4.0 버전부터 사용해야 된다는 메시지를 봤고, 빌드가 안 됐다. 그래서 플러터 프로젝트의 Flutter 버전을 2.8.1으로 변경 후 cmd 라인으로 명령으로 실행되는 Path 설정도 프로젝트와 동일한 버전으로 변경했다. Path까지 변경을 한 후 Flutter의 버전 변경 여부를 확인했다. (flutter doctor 명령어 실행) 오류 메시지 cmdline-tools component를 잃어버렸다는 메시지가 떴다. 안드로이드 스튜디오를 먼저 실행한다. File → Settings → Appearance & Behavior → System Settings →.. 2022. 2. 17.
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.