FirestoreSearchScaffold constructor

const FirestoreSearchScaffold({
  1. PreferredSizeWidget? appBarBottom,
  2. Widget scaffoldBody = const Center(child: Text('Add a scaffold body')),
  3. Color? appBarBackgroundColor,
  4. Color? backButtonColor,
  5. Color? clearSearchButtonColor,
  6. Color? searchBackgroundColor = Colors.white,
  7. Color? searchBodyBackgroundColor = Colors.white,
  8. Color? searchTextColor,
  9. Color? searchTextHintColor,
  10. Color? scaffoldBackgroundColor,
  11. bool showSearchIcon = false,
  12. Color? searchIconColor,
  13. String? appBarTitle,
  14. Color? appBarTitleColor,
  15. required String firestoreCollectionName,
  16. required String? searchBy,
  17. required List dataListFromSnapshot(
    1. QuerySnapshot<Object?>
    ),
  18. Widget builder(
    1. BuildContext,
    2. AsyncSnapshot
    )?,
  19. 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');