buildFloatingSearchBar method
The search bar to show at the topmost of the tab body. When selected, buildSearchBarBody will take the place of the remainder tab body, or the elements below the search bar when unselected.
Implementation
Widget buildFloatingSearchBar() {
return mediaSource.buildBar() ??
FloatingSearchBar(
isScrollControlled: true,
hint: mediaSource.getLocalisedSourceName(appModel),
controller: mediaType.floatingSearchBarController,
builder: (_, __) => const SizedBox.shrink(),
borderRadius: BorderRadius.zero,
elevation: 0,
backgroundColor: appModel.isDarkMode
? const Color.fromARGB(255, 30, 30, 30)
: const Color.fromARGB(255, 229, 229, 229),
backdropColor: appModel.isDarkMode ? Colors.black : Colors.white,
accentColor: theme.colorScheme.primary,
scrollPadding: const EdgeInsets.only(top: 6, bottom: 56),
transitionDuration: Duration.zero,
margins: const EdgeInsets.symmetric(horizontal: 6),
width: double.maxFinite,
transition: SlideFadeFloatingSearchBarTransition(),
automaticallyImplyBackButton: false,
onFocusChanged: (focused) => onFocusChanged(focused: focused),
leadingActions: [
buildChangeSourceButton(),
buildBackButton(),
],
actions: mediaSource.getActions(
context: context,
ref: ref,
appModel: appModel,
),
);
}