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

PanelContent gets initialized twice #148

Open rokgregoric opened 4 years ago

rokgregoric commented 4 years ago

Describe the bug The panel content gets initialized twice.

To Reproduce

SlidingPanel(
  content: PanelContent(
    panelContent: [Empty()],
    bodyContent: content,
  ),
);

class Empty extends StatefulWidget {
  @override
  _EmptyState createState() => _EmptyState();
}

class _EmptyState extends State<Empty> {
  @override
  void initState() {
    super.initState();
    print('initState $this');
  }

  @override
  Widget build(BuildContext context) {
    return Container();
  }
}

Output:

flutter: initState _EmptyState#9c683(lifecycle state: created)
flutter: initState _EmptyState#82081(lifecycle state: created)

Smartphone (please complete the following information):