0
0
Fluttermobile~10 mins

Tab navigation in Flutter - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a TabBar with three tabs.

Flutter
TabBar(tabs: [Tab(text: 'Home'), Tab(text: 'Search'), Tab(text: [1])])
Drag options to blanks, or click blank then click option'
A'Settings'
B'Profile'
C'Messages'
D'Notifications'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a tab label that doesn't match the app design.
2fill in blank
medium

Complete the code to set up a DefaultTabController with 3 tabs.

Flutter
DefaultTabController(length: [1], child: Scaffold())
Drag options to blanks, or click blank then click option'
A2
B1
C4
D3
Attempts:
3 left
💡 Hint
Common Mistakes
Setting length to a number different from the actual tabs count.
3fill in blank
hard

Fix the error in the TabBarView children list to match the number of tabs.

Flutter
TabBarView(children: [Center(child: Text('Home')), Center(child: Text('Search')), Center(child: Text([1]))])
Drag options to blanks, or click blank then click option'
A'Profile Page'
B'Settings Page'
C'Messages Page'
D'Notifications Page'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a page content that does not match the tab label.
4fill in blank
hard

Fill both blanks to create a TabBar inside the AppBar with three tabs.

Flutter
AppBar(title: Text('My App'), bottom: [1](tabs: [[2]]))
Drag options to blanks, or click blank then click option'
ATabBar
BTab(text: 'Home'), Tab(text: 'Search'), Tab(text: 'Profile')
CBottomNavigationBar
DTabView
Attempts:
3 left
💡 Hint
Common Mistakes
Using BottomNavigationBar instead of TabBar inside AppBar.
5fill in blank
hard

Fill the blanks to complete a DefaultTabController with Scaffold, AppBar, and TabBarView.

Flutter
DefaultTabController(length: [1], child: Scaffold(appBar: AppBar(title: Text('Tabs')), body: [2](children: [Center(child: Text('Home')), Center(child: Text('Search')), Center(child: Text('Profile'))])))
Drag options to blanks, or click blank then click option'
A3
BTabBarView
CTabBar
DContainer
Attempts:
3 left
💡 Hint
Common Mistakes
Using TabBar instead of TabBarView for body content.