DraggableScrollableSheet
It is declared like this:
DraggableScrollableSheet(
//...
)WARNING:
It is recommended to put the widget inside a stack so that it is on top of the other widgets.
It would look like this:
Stack(children: <Widget>[
//DraggableScrollableSheet(...
]
)A DraggableScrollableSheet needs a builder
DraggableScrollableSheet(
builder: (context, scrollController){
return // Widgets example Container()
}
)Inside the builder it is necessary to have a scroll type widget such as a SingleChildScrollView.
And to make it move, it is necessary to connect it with the scrollController with: controller: scrollController
Options
The DraggableScrollableSheet have different options:
And finally, you can add decoration to the container to enhance the visual appearance.
Also, you will need to import import 'package:flutter/gestures.dart';
Widget example:
Last updated