简体   繁体   中英

how to use Slidables as widget without the child being a ListTile in flutter

How do I make this Slidable widget work, I'm mapping through a list and I want each of them to have a Slidable widget, so I can access the features of the Slidable package.

children: store.alarmList
                      .map((e) => Alarms(
                            hours: e.getHour,
                            mins: e.getMin,
                            isWednesday: e.wednesday,
                            isMonday: e.monday,
                            isSunday: e.sunday,
                            isTuesday: e.tuesday,
                            isThursday: e.thursday,
                            isFriday: e.friday,
                            isAlarmOn: e.alarmOn,
                            handleAlarmOn: (value) {
                              setState(() {
                                e.alarmOn = value;
                                print(e.alarmOn);
                              });
                            },
                            isSaturday: e.saturday,
                            alarmRing: e.getAlarmRing,
                            snooze: e.getSnooze,
                            vibrate: e.getVibrate,
                          ))
                      .toList()
children: store.alarmList
                      .map((e) => Slidable(
                            child: Alarms(
                            hours: e.getHour,
                            mins: e.getMin,
                            isWednesday: e.wednesday,
                            isMonday: e.monday,
                            isSunday: e.sunday,
                            isTuesday: e.tuesday,
                            isThursday: e.thursday,
                            isFriday: e.friday,
                            isAlarmOn: e.alarmOn,
                            handleAlarmOn: (value) {
                              setState(() {
                                e.alarmOn = value;
                                print(e.alarmOn);
                              });
                            },
                            isSaturday: e.saturday,
                            alarmRing: e.getAlarmRing,
                            snooze: e.getSnooze,
                            vibrate: e.getVibrate,
                          )))
                      .toList()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM