본문 바로가기

development21

Flutter CircularProgressIndicator의 색상을 변경하는 방법, How to change color of CircularProgressIndicator 질문 CircularProgressIndicator의 색상을 어떻게 변경할 수 있나요? 색상 값은 Animation의 인스턴스이지만, 애니메이션의 번거로움 없이 색상을 간단하게 변경할 수 있는 방법이 있을까요? 답변 이 방법이 제게는 작동했습니다: CircularProgressIndicator(valueColor: AlwaysStoppedAnimation(Colors.white)) 2023. 5. 10.
flutter 비주얼 스튜디오 코드 - URI의 대상이 존재하지 않음 'package:flutter/material.dart', Visual Studio Code - Target of URI doesn't exist 'package:flutter/material.dart' 질문 나는 방금 플러터 개발을 위해 맥북을 설정했습니다, 그래서 나는 플러터 SDK를 다운로드하고 문서에 배치했습니다. 그 후에 나는 명령 줄에서 flutter로 작업하기 위해 경로 변수를 설정했습니다. 나는 명령어 flutter create todolist를 실행하여 빈 프로젝트를 얻었습니다. 나는 또한 내 비주얼 스튜디오 코드를 Dart-Code로 설정하여 적절한 구문 강조, IntelliSense 등을 갖추고 있습니다. 그래서 내 비주얼 스튜디오 코드를 열 때, 다음 이미지와 같이 import 메소드를 강조합니다: 이것은 올바른 클래스를 강조하기 때문에 실제 오류인지 아닌지 이해하기가 완전히 어렵다는 것을 의미합니다. 나는 pub get과 flutter packages get을 모두 실행하여 모든 .. 2023. 5. 9.
flutter 텍스트 필드에 초기값을 제공하는 방법은 무엇인가요?, How do I supply an initial value to a text field? 질문 I'd like to supply an initial value to a text field and redraw it with an empty value to clear the text. What's the best approach to do that with Flutter's APIs? 답변 당신은 TextField 대신 TextFormField을 사용하고 initialValue 속성을 사용할 수 있습니다. 예를 들어 TextFormField(initialValue: "I am smart") 2023. 5. 8.
flutter 다트 코드에서 호스트 플랫폼을 어떻게 감지하나요?, How do you detect the host platform from Dart code? 질문 For UI that should differ slightly on iOS and Android, i.e. on different platforms, there must be a way to detect which one the app is running on, but I couldn't find it in the docs. What is it? UI가 iOS와 Android에서 약간 다른 경우, 즉 다른 플랫폼에서는 응용 프로그램이 실행 중인 플랫폼을 감지하는 방법이 있어야하지만 문서에서 찾을 수 없었습니다. 그것은 무엇입니까? 답변 import 'dart:io' show Platform; if (Platform.isAndroid) { // Android-specific code } else if.. 2023. 5. 8.