본문 바로가기

FLUTTER203

Flutter 플러터 - 텍스트 필드 힌트 색상 변경 방법?, Flutter - How to change TextField hint color? 질문 I'm a bit confused how to change the hint color of the textfield. Someone can guide me how to do it.Thanks child: TextField( style: TextStyle(fontSize: 20), decoration: InputDecoration( hintText: "Password", border: new OutlineInputBorder( borderSide: new BorderSide( color: Colors.teal, ), ), prefixIcon: const Icon( Icons.security, color: Colors.white, ), ), ), 답변 당신은 InputDecoration에서 hintSt.. 2023. 6. 24.
Flutter 플러터 애플리케이션이 전면에 있는지 아닌지를 확인하는 방법은 무엇인가요?, How do I check if the Flutter application is in the foreground or not? 질문 I don't want to show notification when the app is in foreground. How can I check live state of my app? 답변 당신의 State 클래스에서는 WidgetsBindingObserver 인터페이스를 구현하고 위젯 상태 변경을 듣도록해야합니다. 다음과 같이: class _MyHomePageState extends State with WidgetsBindingObserver { AppLifecycleState? _notification; @override void didChangeAppLifecycleState(AppLifecycleState state) { setState(() { _notification = state; }).. 2023. 6. 23.
Flutter 플러터 ListView 레이지 로딩, Flutter ListView lazy loading 질문 How can I realize items lazy loading for endless listview? I want to load more items by network when user scroll to the end of listview. 답변 당신은 ScrollController를 들을 수 있습니다. ScrollController에는 스크롤 오프셋과 ScrollPosition 목록과 같은 유용한 정보가 있습니다. 당신의 경우에는 controller.position에 흥미로운 부분이 있습니다. 이는 현재 보이는 ScrollPosition을 나타냅니다. 이는 스크롤 가능한 부분을 나타냅니다. ScrollPosition은 스크롤 가능한 부분 내부의 위치에 대한 정보를 포함합니다. 예를 들어 ext.. 2023. 6. 23.
Flutter TextSpan에서 제스처 감지, Gesture detection in Flutter TextSpan 질문 TextSpan에서 사용자가 터치한 단어를 감지할 수 있는 방법이 있나요? 이 문장은 스택 오버플로 봇이 더 많은 내용을 작성하도록 요구하는 것을 우회하기 위해 여기에 있습니다 :) 답변 당신은 스스로 개선할 수 있습니다. import 'package:flutter/gestures.dart'; ... RichText( text: TextSpan(text: 'Non touchable. ', children: [ TextSpan( text: 'Tap here.', recognizer: TapGestureRecognizer()..onTap = () => print('Tap Here onTap'), ) ]), ); 2023. 6. 23.