본문 바로가기

MobileDevelopment19

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 플러터 애플리케이션이 전면에 있는지 아닌지를 확인하는 방법은 무엇인가요?, 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 플러터에서 BottomNavigationBar 스타일, Style BottomNavigationBar in Flutter 질문 저는 Flutter를 시도하고 있으며 앱의 BottomNavigationBar 색상을 변경하려고합니다. 그러나 제가 달성한 것은 BottomNavigationItem (아이콘 및 텍스트)의 색상을 변경하는 것뿐입니다. 여기에서 내 BottomNavigationBar을 선언하는 곳입니다: class _BottomNavigationState extends State{ @override Widget build(BuildContext context) { return new Scaffold( appBar: null, body: pages(), bottomNavigationBar:new BottomNavigationBar( items: [ new BottomNavigationBarItem( icon: cons.. 2023. 6. 23.
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.