Closed Ashbuhrz closed 4 years ago
I don't understand your question. Can you elaborate?
I don't understand your question. Can you elaborate?
I want to add data from json to tab bar widget. The json data also conatain nested data which i want to display on the body of the tab bar
Not sure what you mean still :man_shrugging:
Based on wild guess, you can do whatever you want when you have parsed the JSON.
For TabBar:
class TabBarDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: DefaultTabController(
length: 3,
child: Scaffold(
appBar: AppBar(
bottom: TabBar(
tabs: [
Tab(icon: Icon(Icons.directions_car)),
Tab(icon: Icon(Icons.directions_transit)),
Tab(icon: Icon(Icons.directions_bike)),
],
),
title: Text('Tabs Demo'),
),
body: TabBarView(
children: [
Text(json[key1]),
Text(json[key2]),
Text(json[key3]),
],
),
),
),
);
}
}
Notice the part where I use Text(json[key1])
. Haven't tested this, but this is what I would do.
i need the parsed json data to display it on tabbar; can i use listview builder there