Created
February 26, 2022 22:04
-
-
Save stevenspiel/9e4e2769b99596a592adb9e032d7e7d9 to your computer and use it in GitHub Desktop.
DraggableScrollableSheet example
This file contains 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( | |
debugShowCheckedModeBanner: false, | |
home: Scaffold( | |
appBar: AppBar( | |
title: const Text('DraggableScrollableSheet'), | |
), | |
body: SizedBox.expand( | |
child: DraggableScrollableSheet( | |
builder: (BuildContext context, ScrollController scrollController) { | |
return Container( | |
color: Colors.blue[100], | |
child: ListView.builder( | |
controller: scrollController, | |
itemCount: 25, | |
itemBuilder: (BuildContext context, int index) { | |
return ListTile(title: Text('Item $index')); | |
}, | |
), | |
); | |
}, | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment