Hello, FlutterFlow community, Please I need your assistance. I want to use this TextField to search for both restaurants and the food items in their menus. The logic is as follows:
When a user searches for a restaurant, it should display the relevant restaurants.
When they search for a food item, it should display the food item along with it corresponding restaurant.
All of this functionality should work using the same TextField. I am using a custom function to perform the search. Below is the custom function, and I’ve also attached screenshots for reference.
import 'dart:convert';
import 'dart:math' as math;
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:intl/intl.dart';
import 'package:timeago/timeago.dart' as timeago;
import '/flutter_flow/lat_lng.dart';
import '/flutter_flow/place.dart';
import '/flutter_flow/uploaded_file.dart';
import '/flutter_flow/custom_functions.dart';
import '/backend/backend.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import '/backend/schema/structs/index.dart';
import '/backend/schema/enums/enums.dart';
import '/auth/firebase_auth/auth_util.dart';
bool textContaintext(
String searchIN,
String searchFOR,
) {
/// MODIFY CODE ONLY BELOW THIS LINE
return searchIN.toLowerCase().contains(searchFOR.toLowerCase());
/// MODIFY CODE ONLY ABOVE THIS LINE
}