InkWell tile({String? date}) {
return InkWell(
child: SizedBox(
height: 40,
child: ListTile(
title: Text(
date?? 'Null',
style: const TextStyle(fontSize: 16),
),
),
),
I have a tappable List Tile with the title variable 'date' which I will assign later, so I am going to pass this to another file as shown now:
randomParameter: anotherFile(tile()), // might be an error idk
inside file where tile widget will be imported to:
anotherFile(required InkWell tile){
const String today = 'Today';
const String tmrw = 'Tomorrow';
const String week = 'Next Week';
ExpansionTile(children: [tile(date: today), tile(date: tmrw), tile(date: week)]) };////Error!
Error: The expression doesn't evaluate to a function, so it can't be invoked. The method 'call' isn't defined for the class 'InkWell'.