akshathjain / sliding_up_panel

A draggable Flutter widget that makes implementing a SlidingUpPanel much easier!
https://pub.dartlang.org/packages/sliding_up_panel
Other
1.38k stars 381 forks source link

Drag is locked! #146

Open jiazeh opened 4 years ago

jiazeh commented 4 years ago

When I browse the content and scroll to the middle page, and then click on the map screen, the panel drag will be locked. any suggestions?? Untitled1

jiazeh commented 4 years ago

The code is same as the example, the different parts are as follows:

List<Marker> getLongPressedMarkers() {
    return tappedPoints.map((latlng) {
      return Marker(
        width: 40.0,
        point: latlng,
        builder: (ctx) {
          return FloatingActionButton.extended(
            onPressed: null,
            shape: RoundedRectangleBorder(
              borderRadius: BorderRadius.circular(10.0),
              side: BorderSide(color: Colors.red)
            ),
            label: Text("30w"),
            // icon: Icon(Icons.location_on, color: Colors.blue,),
          );
        },
      );
    }).toList();
  }

  Widget _body(){
    return FlutterMap(
      options: MapOptions(
        center: LatLng(40.441589, -80.010948),
        zoom: 13,
        maxZoom: 15,
        onTap: _handleTap
      ),
      layers: [
        TileLayerOptions(
          urlTemplate: "https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png"
        ),
        MarkerLayerOptions(markers: getLongPressedMarkers()),
        MarkerLayerOptions(
          markers: [
            Marker(
              point: LatLng(40.441753, -80.011476),
              builder: (ctx) => Icon(
                Icons.location_on,
                color: Colors.blue,
                size: 48.0,
              ),
              height: 60
            ),
          ]
        ),
      ],
    );
  }

  void _handleTap(LatLng latlng) {
    setState(() {
      tappedPoints.add(latlng);
      if (_pc.isPanelShown)
        _pc.close();
      else
        _pc.show();
    });
  }
Jparrgam commented 4 years ago

@akshathjain i have this error, please help!