FirestoreSearchScaffold constructor
const
FirestoreSearchScaffold({
- PreferredSizeWidget? appBarBottom,
- Widget scaffoldBody = const Center(child: Text('Add a scaffold body')),
- Color? appBarBackgroundColor,
- Color? backButtonColor,
- Color? clearSearchButtonColor,
- Color? searchBackgroundColor = Colors.white,
- Color? searchBodyBackgroundColor = Colors.white,
- Color? searchTextColor,
- Color? searchTextHintColor,
- Color? scaffoldBackgroundColor,
- bool showSearchIcon = false,
- Color? searchIconColor,
- String? appBarTitle,
- Color? appBarTitleColor,
- required String firestoreCollectionName,
- required String? searchBy,
- required List dataListFromSnapshot(
- QuerySnapshot<
Object?>
- QuerySnapshot<
- Widget builder()?,
- int limitOfRetrievedData = 10,
Creates a scaffold with a search AppBar and integrated cloud_firestore search.
You can set the scaffold body using the scaffoldBody widget
You can add a bottom widget to search AppBar using the appBarBottom widget
firestoreCollectionName , dataListFromSnapshot are required
Implementation
const FirestoreSearchScaffold({
this.appBarBottom,
this.scaffoldBody = const Center(child: Text('Add a scaffold body')),
this.appBarBackgroundColor,
this.backButtonColor,
this.clearSearchButtonColor,
this.searchBackgroundColor = Colors.white,
this.searchBodyBackgroundColor = Colors.white,
this.searchTextColor,
this.searchTextHintColor,
this.scaffoldBackgroundColor,
this.showSearchIcon = false,
this.searchIconColor,
this.appBarTitle,
this.appBarTitleColor,
required String this.firestoreCollectionName,
required this.searchBy,
required this.dataListFromSnapshot,
this.builder,
this.limitOfRetrievedData = 10,
}) : //Firestore parameters assertions
assert(limitOfRetrievedData >= 1 && limitOfRetrievedData <= 30,
'limitOfRetrievedData should be between 1 and 30.\n');