openBestChoice static method
Implementation
static Future<void> openBestChoice({
required PagedProductQuery productQuery,
required LocalDatabase localDatabase,
required String name,
required BuildContext context,
bool editableAppBarTitle = true,
bool searchResult = true,
SearchQueryCallback? editQueryCallback,
}) async {
final Widget widget = await getBestChoiceWidget(
productQuery: productQuery,
localDatabase: localDatabase,
name: name,
context: context,
editableAppBarTitle: editableAppBarTitle,
searchResult: searchResult,
);
if (!context.mounted) {
return;
}
final bool? result = await Navigator.of(context).push<bool>(
MaterialPageRoute<bool>(builder: (BuildContext context) => widget),
);
if (result == true) {
editQueryCallback?.call(name);
}
}