Flutter TabBarView is not working in release mode

Viewed 49

Flutter TabBarView is not working in release mode when widget first initilized but after recall the widget it works. For better understanding check demo gif.

static const List<Tab> tabs = <Tab>[
Tab(child: Text("Latest")),
Tab(child: Text("Business")),
Tab(child: Text("Entertainment")),
];

@override
Widget build(BuildContext context) {
final isDarkTheme = Provider.of<ThemeNotifier>(context).darkTheme;
return DefaultTabController(
  length: tabs.length,
  child: Scaffold(
    appBar: PreferredSize(
      preferredSize: const Size.fromHeight(kToolbarHeight),
      child: Container(
        color: isDarkTheme ? kSecondaryColor : null,
        child: const TabBar(
          tabs: tabs,
          isScrollable: true,
          indicatorPadding: EdgeInsets.only(top: 45),
        ),
      ),
    ),
    body: TabBarView(children: 
      Center(child: Text("Hello World",style: TextStyle(fontSize: 30),)),
    ]),
  ),
);
}
}

enter image description here

0 Answers
Related