yourWidget method

  1. @override
Widget yourWidget(
  1. BuildContext context,
  2. PolicyPresentationModel? value
)
override

Implementation

@override
Widget yourWidget(BuildContext context, PolicyPresentationModel? value) {
  if (value!.policies == null) {
    return text(app, context, 'Policy not available');
  }
  if (value.policies!.policy == null) {
    return text(app, context, 'Policy has no pages');
  }

  return FutureBuilder<List<String?>>(
      future: ChainOfMediumModels.getPlatformMediumChainOfUrls(
          value.appId, value.policies!.policy!),
      builder: (context, snapshot) {
        if ((snapshot.hasData) && (snapshot.data != null)) {
          var height = fullScreenHeight(context) - 30;
          if (snapshot.data!.isNotEmpty) {
            //title: 'Policy',
            return AlbumSlider(
              app: app,
              height: height,
              slideImageProvider: UrlSlideImageProvider(
                  ListHelper.getStringList(snapshot.data!)),
              initialPage: 0,
            );
          } else {
            return text(app, context, 'No contents');
          }
        } else {
          return progressIndicator(app, context);
        }
      });
}