Last active
July 18, 2025 20:50
-
-
Save Piinks/ab578aa6d0a3b882cf9cd380f4249a1b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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