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.36k stars 378 forks source link

When slide direction is down, list view inside panel does not scroll #215

Open zakton5 opened 3 years ago

zakton5 commented 3 years ago

Describe the bug See title.

To Reproduce Use the code below. Set slideDirection to SlideDirection.DOWN. User panelBuilder to create a list.

Expected behavior I expect to be able to scroll my list down in the panel

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

Sample main.dart


import 'package:flutter/material.dart';
import 'package:sliding_up_panel/sliding_up_panel.dart';

void main() async {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'SlidingPanelListBug',
      home: SlidingPanelListBug(),
    );
  }
}

class SlidingPanelListBug extends StatefulWidget {
  SlidingPanelListBug({Key key}) : super(key: key);

  @override
  _SlidingPanelListBugState createState() => _SlidingPanelListBugState();
}

class _SlidingPanelListBugState extends State<SlidingPanelListBug> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('List Panel Bug')),
      body: SlidingUpPanel(
        minHeight: 100,
        maxHeight: 300,
        margin: const EdgeInsets.symmetric(horizontal: 16),
        slideDirection: SlideDirection.DOWN,
        color: Colors.white,
        parallaxEnabled: true,
        collapsed: Container(color: Colors.blue),
        panelBuilder: (ScrollController sc) {
          return ListView.builder(
            controller: sc,
            itemCount: 50,
            itemBuilder: (BuildContext context, int i) {
              return Container(
                color: Colors.red,
                padding: const EdgeInsets.all(12.0),
                child: Text("$i"),
              );
            },
          );
        },
        borderRadius: const BorderRadius.only(
          bottomLeft: Radius.circular(16.0),
          bottomRight: Radius.circular(16.0),
        ),
      ),
    );
  }
}