goToContactSelector<T extends Object?> function

Future<T?> goToContactSelector<T extends Object?>(
  1. BuildContext context, {
  2. int? mostCount,
  3. List<String>? filter,
  4. bool? returnContact,
  5. bool? includeAIUser,
  6. bool? includeBlackList,
  7. bool? includeSelf,
  8. bool? isDialog,
  9. String? dialogTitle,
  10. ValueChanged<List<ContactInfo>>? onSelectionChanged,
  11. bool useRootNavigator = false,
})

Implementation

Future<T?> goToContactSelector<T extends Object?>(BuildContext context,
    {int? mostCount,
    List<String>? filter,
    bool? returnContact,
    bool? includeAIUser,
    bool? includeBlackList,
    bool? includeSelf,
    bool? isDialog,
    String? dialogTitle,
    ValueChanged<List<ContactInfo>>? onSelectionChanged,
    bool useRootNavigator = false}) {
  if (isDialog == null) {
    isDialog = ChatKitUtils.isDesktopOrWeb;
  }
  if (isDialog == true) {
    return showDialog<T>(
      context: context,
      useRootNavigator: useRootNavigator,
      routeSettings: RouteSettings(
        arguments: {
          'mostCount': mostCount,
          'filterUser': filter,
          'returnContact': returnContact,
          'includeAIUser': includeAIUser,
          'includeBlackList': includeBlackList,
          'includeSelf': includeSelf,
          'isDialog': isDialog,
          'dialogTitle': dialogTitle,
          'onSelectionChanged': onSelectionChanged,
        },
      ),
      builder: (BuildContext context) {
        return Center(
          child: IMKitRouter.instance
              .routes[RouterConstants.PATH_CONTACT_SELECTOR_PAGE]!(context),
        );
      },
    );
  }

  if (IMKitRouter.instance.enableGoRouter) {
    return context
        .pushNamed(RouterConstants.PATH_CONTACT_SELECTOR_PAGE, extra: {
      'mostCount': mostCount,
      'filterUser': filter,
      'returnContact': returnContact,
      'includeAIUser': includeAIUser,
      'includeBlackList': includeBlackList,
      'includeSelf': includeSelf,
      'isDialog': isDialog,
      'dialogTitle': dialogTitle,
      'onSelectionChanged': onSelectionChanged,
    });
  }
  final navigator = useRootNavigator
      ? Navigator.of(context, rootNavigator: true)
      : Navigator.of(context);
  return navigator
      .pushNamed(RouterConstants.PATH_CONTACT_SELECTOR_PAGE, arguments: {
    'mostCount': mostCount,
    'filterUser': filter,
    'returnContact': returnContact,
    'includeAIUser': includeAIUser,
    'includeBlackList': includeBlackList,
    'includeSelf': includeSelf,
    'isDialog': isDialog,
    'dialogTitle': dialogTitle,
    'onSelectionChanged': onSelectionChanged,
  });
}