Is there any way to find out which function between showDialog() and showModalBottomSheet() called my widget? I want to change its property based on which function is called.
this is my button code:
AppButton(
onPressed: () async {
showModalBottomSheet(
useSafeArea: true,
enableDrag: true,
context: context,
isDismissible: true,
isScrollControlled: true,
builder: (context) => const ModalsTeamManagement(),
);
await showDialog(
context: context,
builder: (context) {
return const ModalsTeamManagement();
},
);
},
child: const Text('Team Management'),
);
From your current snippet it will show both but, you may use
awaito confirm closing the dialog.