I want to open seperate screen for my each list items
code
...index["data"]
.map(
(index) => Padding(
padding: EdgeInsets.only(top: 2.h),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
GestureDetector(
onTap: () {
index["onTap"];
},
child: Text(
index["type"],
style: TextStyle(
color: AppColors.primaryColor,
fontSize: 13.sp,
fontWeight: FontWeight.w700),
),
),
SizedBox(
height: 0.3.h,
),
Text(
index["details"],
style: TextStyle(
fontSize: 9.3.sp,
color: AppColors.blackColor
.withOpacity(0.8),
fontWeight: FontWeight.w600,
),
),
],
),
),
)
.toList(),
List for navigation function and other items list is in format of List
and use ...list.map => .toList
my list
**List list = [ { "category": 'Your posts', "data": [ { "type": 'Pending posts', "details": 'fdh fghfg nlfro refglrhgre tghrig ffr gk', "onTap": () { print('++++++++++++'); //// function for navigation to screen 1 }, }, ]; **
dynamic
explicitely or implicitely by omitting the actual type, you cheat yourself out of compiler support you could have had. Your compiler would have told you where the problem was, if it had known what you were doing. You hid your intent from your compiler and you compiler was unable to help you. Don't make programming harder than it already is.