Skip to content

Instantly share code, notes, and snippets.

@HansMuller
Created August 24, 2019 00:36
Show Gist options
  • Select an option

  • Save HansMuller/d06899a03337aab454cee53945eb1708 to your computer and use it in GitHub Desktop.

Select an option

Save HansMuller/d06899a03337aab454cee53945eb1708 to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
extendBodyBehindAppBar: true,
appBar: AppBar(
backgroundColor: Colors.red.withOpacity(0.5),
elevation: 0.0,
title: Text('Semi-Transparent AppBar Background'),
),
body: Container(
color: Colors.blue.withOpacity(0.25),
child: ListView.builder(
itemCount: 30,
itemBuilder: (context, index) {
return Container(
color: Colors.primaries[index % Colors.primaries.length].withOpacity(0.5),
child: ListTile(
title: Text('Item $index'),
),
);
},
),
),
);
}
}
void main() {
runApp(MaterialApp(home: HomePage()));
}
@cad0p

cad0p commented Sep 26, 2019

Copy link
Copy Markdown

Hi, it works beautifully but strangely enough is not compatible with padding

so if you add on line 16 this:

				`padding: const EdgeInsets.all(16.0),`

then you get this result (the list starts from the status bar instead of from the appbar)

image

@nilsgoksor

Copy link
Copy Markdown

How can I use this in my project? The property extendBodyBehindAppBar is unknown

@cad0p

cad0p commented Sep 26, 2019 via email

Copy link
Copy Markdown

@nilsgoksor

Copy link
Copy Markdown

Alright, thanks! Not sure I follow exactly but it might be a bit overkill for my project anyways. Looking forward to seeing it released though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment