如何在GoogleMap和Stack中使用DraggableScrollableSheet?

问题描述 投票:0回答:1

我正在尝试使DraggableScrollableSheet出现在Stack中的GoogleMap上方,但是没有运气。有什么建议吗?

这是我正在尝试的内容

    body: Stack(
      children: <Widget>[
        GoogleMap(
          initialCameraPosition: CameraPosition(
              target: LatLng(47.502941, 18.999161),
              zoom: 1),
          myLocationEnabled: true,
          zoomControlsEnabled: true,
        ),
              Positioned(
                bottom: 0,
                left: 0,
                right: 0,
                child: Container(
                  height: 400,
                  color: Colors.white,
                  child: DraggableScrollableSheet(
                    initialChildSize: 0.4,
                    minChildSize: 0.1,
                    maxChildSize: 1,
                    builder: (context, scrollController) {
                      return Column(
                        children: <Widget>[

                          ListView.builder(
                            //controller: myscrollController,
                            shrinkWrap: true,
                            itemCount: 25,
                            itemBuilder: (BuildContext context, int index) {
                              return ListTile(
                                  title: Text(
                                'Dish $index',
                                style: TextStyle(color: Colors.black54),
                              ));
                            },
                          ),
                        ],
                      );
                    },
                  ),
                ),
              );
flutter flutter-layout
1个回答
0
投票

尝试使用sliding_up_panel

© www.soinside.com 2019 - 2024. All rights reserved.