class CategoryViewDetail extends StatefulWidget {
const CategoryViewDetail({Key? key, required bool tabbarenable})
: super(key: key);
@override
Widget build(BuildContext context) {
List<Tab> tabs = <Tab>[];
return FutureBuilder<Categories>(
future: _futureCategories,
builder: (BuildContext context, AsyncSnapshot<Categories> snapshot) {
if (snapshot.hasData) {
final name = snapshot.data?.data;
var filteredList = name
?.where((name) =>
name.name == 'Spor' ||
.toList();
//here I want to hide tabbar if the page comes with CategoryViewDetail(tabbarenable: false)
for (int i = 0; i < filteredList!.length; i++) {
tabs.add(
Tab(
child: Text(
' ${filteredList[i].name}',
style: const TextStyle(
fontWeight: FontWeight.w700,
fontSize: 15.0,
fontFamily: 'Manrope',
color: Colors.black54),
),
),
);
}
I want to bypass tabbar if page comes with tabbareanble = false but in this way Build Widget does not recognise tabbarenable variable.
ayn help?
name.name == 'Spor' || .toList();is there any typing mistakes or maybe I'm not aware of it.name.name == 'Spor'.toList();the problem I can not get the value of tabbarenable