aryzhov / flutter-stopper

A Flutter widget that can be expanded to one of the pre-defined stop heights by dragging.
MIT License
26 stars 13 forks source link

close and open listeners #3

Open pishguy opened 5 years ago

pishguy commented 5 years ago

for this library how can i detect stopper opened and closed?

aryzhov commented 5 years ago

You control the open event by calling showStopper. This function returns a PersistentBottomSheetController from which you can listen to the closed Future which will complete when the stopper is closed.

pishguy commented 5 years ago

@aryzhov could you give me by code how can i do that? thanks

aryzhov commented 5 years ago

void foo(BuildContext context) async {
  final controller = showStopper(context, ...);
  print("Stopper opened!");
  await controller.closed;
  print("Stopper closed!");
}
pishguy commented 5 years ago

+1

pishguy commented 5 years ago

@aryzhov

how can i close sheet programically?