I want to add extended app bar with pattern for background. Below this fill screen with scrollable content. And above both views in center i want to show "header content".
My current view
- Currently i'm using CompositedTransformTarget and showing overlay. The problem which i have is that i have to hide/show overlay when navigation to next screen and then back. Is there any event for pause/resume widget?
@override
Widget build(BuildContext context) {
return PopScope(
canPop: true,
onPopInvoked: (didPop) {
_removeHeaderInfoOverlay();
},
child: Scaffold(
body:
Column(crossAxisAlignment: CrossAxisAlignment.stretch, children: [
Container(
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 5,
blurRadius: 7,
offset: Offset(0, 3), // changes position of shadow
),
],
color: Color(0xff00B9FF),
image: const DecorationImage(
fit: BoxFit.fill,
image: AssetImage('assets/images/app_bar_pattern.png'),
)),
child: Column(
children: [
_appBarView(context),
CompositedTransformTarget(
link: _layerLink,
child: SizedBox(height: shopOverviewHeight / 2),
)
],
),
),
Expanded(
child: SingleChildScrollView(
padding: const EdgeInsets.only(left: 10, right: 10),
physics: const AlwaysScrollableScrollPhysics(),
child: _prepareShopItem(widget.data)))
]),
));
}
@override
void initState() {
super.initState();
Future.delayed(const Duration(milliseconds: 500), () {
_insertHeaderItem();
});
}
I could use stack and add fix padding from top. Are appBars the same height on all devices (IOS,Android) in flutter ?
Between my appBar and SingleChildScrollView when scrolling appBar shadow is below items.
I have try all i could find
