admin管理员组文章数量:1244317
I want to extendBodyBehindAppBar with in SafeArea
but it's not working. Here is the code:
import 'package:flutter/material.dart';
class BugReportScreen extends StatelessWidget {
const BugReportScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
extendBodyBehindAppBar: true,
appBar: AppBar(
automaticallyImplyLeading: false,
backgroundColor: Colors.transparent,
actions: [
IconButton(
onPressed: () {},
icon: const Icon(Icons.bug_report),
)
],
),
body: SafeArea(
child: Container(
width: double.infinity,
height: 100,
color: Colors.yellow,
),
),
);
}
}
If I remove the SafeArea, the body now covers the system bar. How do I extendBodyBehindAppBar within SafeArea?
I want to extendBodyBehindAppBar with in SafeArea
but it's not working. Here is the code:
import 'package:flutter/material.dart';
class BugReportScreen extends StatelessWidget {
const BugReportScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
extendBodyBehindAppBar: true,
appBar: AppBar(
automaticallyImplyLeading: false,
backgroundColor: Colors.transparent,
actions: [
IconButton(
onPressed: () {},
icon: const Icon(Icons.bug_report),
)
],
),
body: SafeArea(
child: Container(
width: double.infinity,
height: 100,
color: Colors.yellow,
),
),
);
}
}
If I remove the SafeArea, the body now covers the system bar. How do I extendBodyBehindAppBar within SafeArea?
Share Improve this question edited Feb 17 at 6:51 Ravindra S. Patil 14.8k5 gold badges19 silver badges49 bronze badges asked Feb 17 at 0:38 Hisham SyedHisham Syed 1159 bronze badges 2- means you don't wanna cover the statusBar? – Md. Yeasin Sheikh Commented Feb 17 at 2:56
- @Md.YeasinSheikh Yes – Hisham Syed Commented Feb 17 at 14:19
1 Answer
Reset to default 0As easy hack will be using SafeArea
over the Scaffold.
class BugReportScreen extends StatelessWidget {
const BugReportScreen({super.key});
@override
Widget build(BuildContext context) {
return SafeArea(
// bottom: ,//if you want to play
// maintainBottomViewPadding: ,
child: Scaffold(
本文标签: flutterUse SafeArea with AppBar and extendBodyBehindAppBarStack Overflow
版权声明:本文标题:flutter - Use SafeArea with AppBar and extendBodyBehindAppBar - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1740185467a2238126.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论