DraggableScrollableSheet

It is declared like this:

DraggableScrollableSheet(
//...
)
triangle-exclamation

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.

circle-info

If you are running this on the web, it would not work, to get this to work you need to put the following code:

Also, you will need to import import 'package:flutter/gestures.dart';

Widget example:

Last updated