Advertisement
narimetisaigopi

tabbar flutter

May 31st, 2021
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2.  
  3. import 'my_bottom_sheet_exp.dart';
  4.  
  5. class MyTabView extends StatelessWidget {
  6. @override
  7. Widget build(BuildContext context) {
  8. return DefaultTabController(
  9. length: 6,
  10. child: Scaffold(
  11. appBar: AppBar(
  12. title: Text("Home Screen"),
  13. bottom: TabBar(
  14. labelColor: Colors.black,
  15. isScrollable: true,
  16. unselectedLabelColor: Colors.white,
  17. indicatorColor: Colors.green,
  18. tabs: [
  19. Tab(
  20. text: "Home",
  21. icon: Icon(Icons.home),
  22. ),
  23. Tab(
  24. child: Text("My Custom"),
  25. ),
  26. Tab(
  27. text: "Games",
  28. ),
  29. Tab(
  30. text: "Home",
  31. icon: Icon(Icons.home),
  32. ),
  33. Tab(
  34. child: Text("My Custom"),
  35. ),
  36. Tab(
  37. text: "Games",
  38. ),
  39. ]),
  40. ),
  41. body: TabBarView(children: [
  42. MyBottomSheet(),
  43. Container(
  44. color: Colors.yellow,
  45. ),
  46. Container(
  47. color: Colors.pink,
  48. ),
  49. MyBottomSheet(),
  50. Container(
  51. color: Colors.yellow,
  52. ),
  53. Container(
  54. color: Colors.pink,
  55. ),
  56. ]),
  57. ),
  58. );
  59. }
  60. }
  61.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement