Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. TabController _tabController;
  2.  
  3. @override
  4. void initState() {
  5. _tabController = TabController(length: 2, vsync: this);
  6. _tabController.addListener(
  7. () {
  8. setState(() {});
  9. },
  10. );
  11. super.initState();
  12. }
  13.  
  14.  
  15.  
  16. @override
  17. Widget build(BuildContext context) {
  18. return DefaultTabController(
  19. length: 2,
  20. ....
  21.  
  22. return TabBarView(
  23. controller: _tabController,
  24. physics: _tabController.index == 0
  25. ? NeverScrollableScrollPhysics()
  26. : AlwaysScrollableScrollPhysics(),
  27. children: <Widget>[
  28. GoogleMap(
  29. ...),
  30.  
  31. AnotherWidgetHere()
  32. ]
  33. ....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement