Search for an online mini program with the given keywords:
keyWord: The keyword of the mini program to search.
pageIndex: The page returned if the value of pageSize is not zero, that is, the pagination feature is enabled (for Android only).
pageSize: The maximum size of the page returned by the server. When set to 0, the pagination feature is disabled (for Android only).Obtaining the List of Recently Accessed Mini Programs.
Future<List<AppInfo>?> searchMiniApp(String keyword,
{int pageIndex = 0, int pageSize = 0})
Sample code:
Future<void> doSearch() async {
List<AppInfo>? infoList;
FocusScope.of(context).unfocus();
infoList = await _tcmppFlutterPlugin
.searchMiniApp(searchController.text)
.catchError((err) {
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(err.toString())));
});
setState(() {
_appInfoList.clear();
if (infoList != null && infoList.isNotEmpty) {
_appInfoList.addAll(infoList);
} else {
_emptyText = 'No mini app found';
}
});
}
Was this page helpful?