Skip to content

Instantly share code, notes, and snippets.

@stevenspiel
Created February 26, 2022 22:04
Show Gist options
  • Save stevenspiel/9e4e2769b99596a592adb9e032d7e7d9 to your computer and use it in GitHub Desktop.
Save stevenspiel/9e4e2769b99596a592adb9e032d7e7d9 to your computer and use it in GitHub Desktop.
DraggableScrollableSheet example
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