Skip to content

Instantly share code, notes, and snippets.

@obadajasm
Created January 27, 2021 20:52
Show Gist options
  • Save obadajasm/76935627ef60db7544c6dba0eb32652d to your computer and use it in GitHub Desktop.
Save obadajasm/76935627ef60db7544c6dba0eb32652d to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: CustomScrollView(
slivers: [
SliverAppBar(
expandedHeight: 100.0,
floating: true,
pinned: false,
snap: false,
flexibleSpace: const FlexibleSpaceBar(
title: Text('Available seats'),
),
actions: <Widget>[
IconButton(
icon: const Icon(Icons.add_circle),
tooltip: 'Add new entry',
onPressed: () {},
),
]),
SliverList(
delegate: SliverChildListDelegate(
[
// Container(
// width: double.infinity,
// height: 50,
// color: Colors.orangeAccent,
// child: Center(
// child: Text(
// 'Header',
// style: TextStyle(color: Colors.white, letterSpacing: 4),
// ),
// ),
// ),
ListView.builder(
shrinkWrap: true,
itemCount: 100,
itemBuilder: (BuildContext context, int index) {
return ListTile(
title: Center(child: Text('$index')),
);
},
),
],
),
),
SliverFillRemaining(
hasScrollBody: false,
child: Align(
alignment: Alignment.bottomCenter,
child: Container(
width: double.infinity,
height: 50,
color: Colors.blueAccent,
child: Center(
child: Text(
'Footer',
style: TextStyle(color: Colors.white, letterSpacing: 4),
),
),
),
),
)
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment