Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import 'package:flutter/material.dart';
class DragabbleScrollableSheetDemo extends StatefulWidget {
@override
_DragabbleScrollableSheetDemoState createState() =>
_DragabbleScrollableSheetDemoState();
}
class _DragabbleScrollableSheetDemoState
extends State<DragabbleScrollableSheetDemo> {
@override
void initState() {
// TODO: implement initState
super.initState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
darkTheme: ThemeData.dark(),
theme: ThemeData(brightness: Brightness.dark),
home: Scaffold(
appBar: AppBar(
title: const Text('DraggableScrollableSheet'),
),
body: Container(
child: DraggableScrollableSheet(
initialChildSize: 0.3,
minChildSize: 0.1,
maxChildSize: 0.8,
builder: (BuildContext context, myscrollController) {
return Container(
color: Colors.tealAccent[200],
child: ListView.builder(
controller: myscrollController,
itemCount: 25,
itemBuilder: (BuildContext context, int index) {
return ListTile(
title: Text(
'Dish $index',
style: TextStyle(color: Colors.black54),
));
},
),
);
},
),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.