Flutter FloatingActionButton의 크기를 변경하는 방법은 무엇인가요?, How to change the size of FloatingActionButton?
질문 저는 플러터에서 FloatingActionButton의 크기를 설정하려고 합니다. width/height를 설정하고 싶습니다. 즉, 버튼을 더 크게 만들고 싶습니다. 원형 버튼을 찾고 있었지만, 제가 찾은 것은 이것뿐이었습니다. 그래서 이것으로 작업을 시작했지만, 조금 더 큰 크기가 필요합니다. 답변 FittedBox를 사용하여 FAB를 Container 또는 SizedBox 안에 랩하고, 그 후에 너비와 높이를 변경하십시오. 예시: floatingActionButton: Container( height: 100.0, width: 100.0, child: FittedBox( child: FloatingActionButton(onPressed: () {}), ), ),
2023. 6. 24.
Flutter - Container onPressed?
플러터 - 컨테이너 onPressed?, Flutter - Container onPressed?
질문 나는 이 컨테이너를 가지고 있습니다: new Container( width: 500.0, padding: new EdgeInsets.fromLTRB(20.0, 40.0, 20.0, 40.0), color: Colors.green, child: new Column( children: [ new Text("Ableitungen"), ] ), ), 사용자가 Container를 클릭하면 IconButton과 같은 방식으로 onPressed() 메서드가 실행되기를 원합니다. Container로 이러한 동작을 어떻게 구현할 수 있을까요? 답변 다음과 같이 GestureDetector 위젯을 사용할 수 있습니다: new GestureDetector( onTap: (){ print("Container clicke..
2023. 6. 14.