Skip to content

Instantly share code, notes, and snippets.

@pinkeshdarji
Created December 6, 2019 11:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pinkeshdarji/e97eeeb534a63dec921d97b5443de172 to your computer and use it in GitHub Desktop.
Save pinkeshdarji/e97eeeb534a63dec921d97b5443de172 to your computer and use it in GitHub Desktop.
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