본문 바로가기

context6.2

Flutter 플러터에서 AppBar의 높이를 어떻게 얻을 수 있나요?, How to get AppBar height in Flutter 질문 Flutter에서 AppBar의 높이를 어떻게 얻을 수 있을까요? 저는 MarialApp 위젯('package:flutter/material.dart')을 사용하고 있습니다. Context의 높이를 가지고 있으며, appbar의 높이를 빼고 싶습니다. final double height = MediaQuery.of(context).size.height; 답변 이것은 아마도 이상적인 방법은 아니라고 생각하지만 작동할 것입니다. 먼저 사용할 AppBar 위젯을 Scaffold에 선언하세요. Widget demoPage() { AppBar appBar = AppBar( title: Text('데모'), ); return Scaffold( appBar: appBar, body: /* 페이지 본문 */, ).. 2023. 8. 16.
Flutter 플러터 앱에서 문맥 없이 탐색하는 방법은 무엇인가요?, How to navigate without context in flutter app? 질문 OneSignal을 사용하여 푸시 알림을 받는 앱이 있습니다. 푸시 알림을 클릭하면 특정 화면이 열리도록 알림 오픈 핸들러를 만들었습니다. 컨텍스트 없이 화면으로 이동하는 방법이 있을까요? 또는 앱 시작 시 특정 화면을 열 수 있는 방법이 있을까요? 내 코드: OneSignal.shared.setNotificationOpenedHandler((notification) { var notify = notification.notification.payload.additionalData; if (notify["type"] == "message") { Navigator.of(context).push( MaterialPageRoute( builder: (context) => DM(user: notify['id.. 2023. 8. 16.