duytq94 / flutter-intro-slider

Simple and configurable app introduction slider for Flutter

Home Page:https://pub.dartlang.org/packages/intro_slider

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remote images

mbenci opened this issue · comments

Is it possible to use not only local images but also remote images?
Thanks

Came to post the same question

I was about to fork and add the feature to send whatever widget we want instead of the imagePath, when I noticed that it has already been done. The parameter you want is centerWidget. So your slide should look something like that:

new Slide(
   title: "Title Goes Here",
   description: "Description",
   centerWidget: CachedNetworkImage(
     imageUrl: "http://via.placeholder.com/350x150",
     progressIndicatorBuilder: (context, url, downloadProgress) =>
         CircularProgressIndicator(value: downloadProgress.progress),
     errorWidget: (context, url, error) => Icon(Icons.error),
   ),
   backgroundColor: Color(0xfff5a623),
)

Make sure not to send the pathImage parameter or it would show instead.

Yeah, you guys can use centerWidget like @lambasoft mention. Even we can use listCustomTabs to custom entire your UI tab instead of just a center widget.