Skip to content

Instantly share code, notes, and snippets.

@Piinks
Last active July 18, 2025 20:50
Show Gist options
  • Select an option

  • Save Piinks/ab578aa6d0a3b882cf9cd380f4249a1b to your computer and use it in GitHub Desktop.

Select an option

Save Piinks/ab578aa6d0a3b882cf9cd380f4249a1b to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(home: HomePage());
}
}
class HomePage extends StatefulWidget {
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Layout Demo')),
body: CustomScrollView(
slivers: <Widget>[
SliverList.list(
children: [Text('Item 1'), Text('Item 2'), Text('Item 3')],
),
SliverFillRemaining(
hasScrollBody: false,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Spacer(),
Padding(
padding: const EdgeInsets.all(8.0),
child: FilledButton(
child: Text('Bottom'),
onPressed: () {},
),
),
],
),
),
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment