PageView transition

163 views
Skip to first unread message

Tililweet

unread,
Jun 26, 2020, 11:50:59 PM6/26/20
to Flutter Development (flutter-dev)
So when I swipe to another page/widget using PageView.builder it looks like this(This is on Flutter Web btw):

problem1.gif



                                                                                   (Notice the pink line when I swipe?)

So the pink line is a widget called Loading(); its pink container that takes the whole screen and has a CircularProgessIndicator() in the middle of it. In the case above, it hasn't loaded all the way and I think I know why.

 @override
 Widget build(BuildContext context) {
   final user = Provider.of<User>(context);
    return FutureBuilder<UserData>(
     future: _userData
     builder: (context, AsyncSnapshot<UserData>snapshot) {
       if (snapshot.hasData) {
         UserData userData = snapshot.data;
         ......................
................
.........
       }else  
       //return new AnimatedSwitcher(
           //duration: Duration(milliseconds: 700,),switchInCurve: Curves.bounceIn,);
       //return CircularProgressIndicator(); //else
         return Loading();
     },
    );
  }


^^ This is pretty much the gist of it. My guess is that at first !snapshot.hasData (snapshot is empty) so that's why it goes to Loading()? I'd really like for it to smoothly transition to the other pages when swiping.

So my question is , is there a way to get rid of that pink line so that it transitions smoothly? BTW thanks for all the help, you guys have given me thus far.

Tililweet

unread,
Jun 26, 2020, 11:53:21 PM6/26/20
to Flutter Development (flutter-dev)
Seems like this gif didnt work,let me try this 

<iframe src="https://giphy.com/embed/eM7A7ObMGjAlapHjlc" width="393" height="480" frameBorder="0" class="giphy-embed" allowFullScreen></iframe><p><a href="https://giphy.com/gifs/eM7A7ObMGjAlapHjlc">via GIPHY</a></p>

Souvik Dutta

unread,
Jun 27, 2020, 12:45:44 AM6/27/20
to Tililweet, Flutter Development (flutter-dev)
I think your api results are extremely fast and so the next page is changing its state and rebuilding in the middle (or actually at the start of the swipe). You can try to slow down the results and thus rebuild your page only after it is in complete view. 

--
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/7a407ad6-052f-45e0-9be1-74c89b7e0dc2o%40googlegroups.com.

Souvik Dutta

unread,
Jun 27, 2020, 12:46:51 AM6/27/20
to Tililweet, Flutter Development (flutter-dev)
Or you might make the pink container smaller in size. This is way more easier to do

Tililweet

unread,
Jun 27, 2020, 8:43:13 AM6/27/20
to Flutter Development (flutter-dev)
How do i slow it down?
To unsubscribe from this group and stop receiving emails from it, send an email to flutt...@googlegroups.com.

Tililweet

unread,
Jun 27, 2020, 12:03:48 PM6/27/20
to Flutter Development (flutter-dev)
So I managed to slow it down by using Future.delayed. The loading screen pops up and it go to the widget now. Now im trying to see how i can smoothly transition from the loading screen to the widget now.

Souvik Dutta

unread,
Jun 27, 2020, 12:33:54 PM6/27/20
to Tililweet, Flutter Development (flutter-dev)
Great. 

To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/d3ebddcd-7c93-4ad8-ab3c-995bcb2a09eao%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages