FieldSuggestion은 개발자가 고도로 사용자 정의 가능하고 간단하며 제어 가능한 자동 완성 필드를 생성할 수 있도록 해주는 Flutter 패키지입니다. 실시간 제안을 갖춘 입력 필드를 구축하기 위한 깔끔한 API를 제공하며, 텍스트 및 사용자 지정 위젯 렌더링을 모두 지원합니다. 이 패키지는 Android, iOS, Web, macOS, Windows, Linux 등 주요 모든 플랫폼에서 작동하여 스마트한 입력 처리가 필요한 크로스플랫폼 애플리케이션에 이상적입니다. 제안 표시 제어, 필터링 로직, 스타일링에 내장된 제어 기능을 통해 복잡함 없이 유연성을 제공합니다.
For more detailed examples refer to the official documentation from field_suggestion/wiki
In this example, we're using the FieldSuggestion.network widget to display suggestions for a username input field. We've provided an inputDecoration with a hint text, a future function that fetches the suggestions based on the user input, a textController that controls the text in the input field, a boxController that controls the visibility of the suggestion box, and a builder function that defines how the suggestions are displayed in the suggestion box.
Note that FieldSuggestion uses generics to allow for suggestions of different types. In the example above, we're using String as the type parameter for FieldSuggestion.network However, any other type can be used, depending on the type of suggestions being displayed.