см. изображение здесь
На изображении выше
В строке поиска выше возникла проблема. Ниже показано настраиваемое поле ввода**. Посмотрите разницу в цвете, даже если для обоих установлено значение Colors.transparent **
Код: Выделить всё
SearchBar(
hintText: "Search",
// hintStyle: MaterialStateProperty(col),
side: const MaterialStatePropertyAll(
const BorderSide(color: Colors.black45)),
shadowColor: const MaterialStatePropertyAll(Colors.transparent),
overlayColor: const MaterialStatePropertyAll(Colors.transparent),
backgroundColor: MaterialStatePropertyAll(Colors.transparent),
// controller: controller,
padding: const MaterialStatePropertyAll(
EdgeInsets.symmetric(horizontal: 16.0)),
shape: const MaterialStatePropertyAll(
RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)))),
onTap: () {
// controller.openView();
},
onChanged: (e) {
print(e);
// searchProducts(e);
setState(() {
_productList = searchProducts(e);
});
// controller.openView();
},
leading: const Icon(Icons.search),
// trailing: [
// Tooltip(
// message: 'Change brightness mode',
// child: IconButton(
// // isSelected: isDark,
// onPressed: () {
// setState(() {
// // isDark = !isDark;
// });
// },
// icon: const Icon(Icons.wb_sunny_outlined),
// selectedIcon: const Icon(Icons.brightness_2_outlined),
// ),
// )
// ],
),
Подробнее здесь: https://stackoverflow.com/questions/787 ... sparent-in