Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TabController _tabController;
- @override
- void initState() {
- _tabController = TabController(length: 2, vsync: this);
- _tabController.addListener(
- () {
- setState(() {});
- },
- );
- super.initState();
- }
- @override
- Widget build(BuildContext context) {
- return DefaultTabController(
- length: 2,
- ....
- return TabBarView(
- controller: _tabController,
- physics: _tabController.index == 0
- ? NeverScrollableScrollPhysics()
- : AlwaysScrollableScrollPhysics(),
- children: <Widget>[
- GoogleMap(
- ...),
- AnotherWidgetHere()
- ]
- ....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement