관리 메뉴

cococo-coding

[Flutter/Android Studio] The selection does not cover a set of statements or an expression. Extend selection to a valid range. 본문

[Flutter] Todolist/트러블슈팅

[Flutter/Android Studio] The selection does not cover a set of statements or an expression. Extend selection to a valid range.

_dani 2024. 2. 10. 16:48

발생

 

투두리스트 앱을 만들던 중에 appBar: Appbar( ) 를 Extract Method 를 했는데 아래와 같은 에러가 났다. 

 

참고)

AppBar에 커서를 놓고 오른쪽 버튼>Refactor>Extract Method 를 눌렀을 때 생긴 에러이다. 


해결법

커서를 블록의 첫번째 문자 앞에 두고 똑같이 실행하면 된다. 

 

Appbar의 맨 앞에 커서를 둔 것을 확인

 

위의 방법대로 하면 선택이 잘 된다. 


출처:

https://stackoverflow.com/questions/56558409/flutter-extract-widget-requires-a-return-widget

 

Flutter extract widget requires a return widget

I am getting a lot of widgets groups in the tree and wanted to start extracting them to their own widget. I tried with Ctrl-Alt-W, this command does nothing and shows no error when there is a prob...

stackoverflow.com