showCallingInvitationListSheet function
void
showCallingInvitationListSheet(
- BuildContext context, {
- required List<
ZegoCallUser> waitingSelectUsers, - required void onPressed(
- List<
ZegoCallUser> selectedUsers
- List<
- bool defaultChecked = true,
- List<
ZegoCallUser> selectedUsers = const [], - List<
ZegoCallUser> userSort()?, - ButtonIcon? buttonIcon,
- Size? buttonIconSize,
- Size? buttonSize,
- ZegoAvatarBuilder? avatarBuilder,
- Color? userNameColor,
- Color? backgroundColor,
- String? popUpTitle,
- TextStyle? popUpTitleStyle,
- Widget? popUpBackIcon,
- Widget? inviteButtonIcon,
Display a call invitation list pop-up.
Assign members to be invited to waitingSelectUsers
, and assign members who are already
invited or in a call to selectedUsers
.
If you need to default select members to be invited, you can set defaultChecked
to true.
If sorting is needed, you can set userSort
.
In the onPressed
callback, send a call invitation.
Implementation
void showCallingInvitationListSheet(
BuildContext context, {
/// Members waiting to be selected (not in a call, not invited)
required List<ZegoCallUser> waitingSelectUsers,
/// Callback after clicking the invite button, initiate invitation here (invite not in call, or invite in call)
required void Function(List<ZegoCallUser> selectedUsers) onPressed,
/// Whether to default select waiting members
bool defaultChecked = true,
/// Selected members (in a call or invited)
List<ZegoCallUser> selectedUsers = const [],
/// Member list sorting
List<ZegoCallUser> Function(List<ZegoCallUser>)? userSort,
bool rootNavigator = false,
ButtonIcon? buttonIcon,
Size? buttonIconSize,
Size? buttonSize,
ZegoAvatarBuilder? avatarBuilder,
Color? userNameColor,
Color? backgroundColor,
/// default is 'Invitees'
String? popUpTitle,
TextStyle? popUpTitleStyle,
Widget? popUpBackIcon,
/// default is 'Invite'
Widget? inviteButtonIcon,
}) {
showModalBottomSheet(
context: context,
barrierColor: ZegoUIKitDefaultTheme.viewBarrierColor,
backgroundColor: backgroundColor ??
ZegoUIKitDefaultTheme.viewBackgroundColor.withOpacity(0.6),
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(32.0),
topRight: Radius.circular(32.0),
),
),
isDismissible: true,
isScrollControlled: true,
builder: (BuildContext context) {
return FractionallySizedBox(
heightFactor: 0.75,
child: AnimatedPadding(
padding: MediaQuery.of(context).viewInsets,
duration: const Duration(milliseconds: 50),
child: ZegoSendCallingInvitationList(
waitingSelectUsers: waitingSelectUsers,
selectedUsers: selectedUsers,
userSort: userSort,
onPressed: onPressed,
buttonIcon: buttonIcon,
popUpTitle: popUpTitle,
popUpTitleStyle: popUpTitleStyle,
buttonIconSize: buttonIconSize,
buttonSize: buttonSize,
avatarBuilder: avatarBuilder,
userNameColor: userNameColor,
popUpBackIcon: popUpBackIcon,
inviteButtonIcon: inviteButtonIcon,
defaultChecked: defaultChecked,
),
),
);
},
);
}