I have an array that looks like this
final thisCategory = [
{
'category': 'Social Life',
'data': [
{'amount': 2000, 'content': 'thanks', 'date': DateTime.now()}
]
},
{
'category': 'Food',
'data': [
{'amount': 2000, 'content': 'thanks','date': DateTime.now()},
{'amount': 2000, 'content': 'thanks','date': DateTime.now()}
]
}
];
and this is how my app looks
my widget look like this
Expanded(
child: Container(
child: ListView.builder(
itemBuilder: (context, index) => TransactitonTile(
category: thisCategory[index]['category'],
amount: amountCategory[index]['amount'].toString(),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => Scaffold(
body: SafeArea(
child: Column(
children: [
Text(thisCategory[index]['category']),
Expanded(
child: Container(
child: ListView.builder(
itemBuilder: (context, index) =>
ListTile(
leading: //this is where i want to show 'date' element,
trailing: //this is where i want to show 'amount' element,
title: //this is where i want to show 'content' element,
),
),
),
)
],
),
),
),
),
);
},
),
itemCount: thisCategory.length,
),
),
)
so when the user presses on one of the 'category' like I showed above, then the user will go to the next page which will display what 'content' is in that 'category'. I've tried to display the 'content', but all the 'content' from all the 'category' also appear in the next page. how to fix this?
