buildWithDates method
Widget
buildWithDates(
- Widget itemBuilder(
- RewardsModel item
- Widget dateBuilder(
- String date
- CrossAxisAlignment dateCrossAxis = CrossAxisAlignment.start,
- MainAxisAlignment dateMainAxis = MainAxisAlignment.start,
override
Implementation
@override
Widget buildWithDates(
Widget Function(RewardsModel item) itemBuilder,
Widget Function(String date) dateBuilder, {
CrossAxisAlignment dateCrossAxis = CrossAxisAlignment.start,
MainAxisAlignment dateMainAxis = MainAxisAlignment.start,
}) {
return rewardProviderGrouped(
onBuild: (value) {
if (value == null) {
return Text("No Data");
}
return ListView.builder(
itemBuilder: (context, index) {
final currentDate = value.dates[index];
return Column(
crossAxisAlignment: dateCrossAxis,
mainAxisAlignment: dateMainAxis,
children: [
dateBuilder(value.dates[index]),
ListView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: value.rewards[currentDate]?.length ?? 0,
itemBuilder: (context, index) {
final reward = (value.rewards[currentDate] ?? [])[index];
return itemBuilder(reward);
},
),
],
);
},
itemCount: value.dates.length,
);
},
);
}