MOTIVATION
Appbar를 없애면 StatusBar를 설정해야하는데 단순하게 Appbar의 높이를 낮춰서 없는 것처럼 렌더링하고 싶을때
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Example',
home: Scaffold(
appBar: PreferredSize(
preferredSize: Size.fromHeight(50.0), // here the desired height
child: AppBar(
// ...
)
),
body: // ...
)
);
}
}
REFERENCE
https://stackoverflow.com/questions/51089994/flutter-setting-the-height-of-the-appbar
Flutter: Setting the height of the AppBar
How can I simply set the height of the AppBar in Flutter? The title of the bar should be staying centered vertically (in that AppBar).
stackoverflow.com
728x90
'Flutter' 카테고리의 다른 글
[Flutter] setstate not working on get.bottomSheet (0) | 2023.02.07 |
---|---|
[Flutter] ScrollController 특정 위치로 이동하기 & 특정 위젯의 위치, 크기 찾기 (0) | 2023.02.01 |
[Flutter] How to go back and request API to refresh the previous page : 이전페이지 이동 후 API 호출 (0) | 2023.01.31 |
[Flutter] Connecting flutter simulator to localhost api (0) | 2023.01.27 |
[Flutter] flutter DateTime parse formatting (0) | 2023.01.27 |