rafalbednarczuk / curved_navigation_bar

Animated Curved Navigation Bar in Flutter
BSD 2-Clause "Simplified" License
683 stars 240 forks source link

route to new page #88

Closed garlicgit closed 3 years ago

garlicgit commented 3 years ago

I seem to lose the nice animation when I route to a new page, even of the new page is using the same global instance of the curved navigation bar. The icon highlighted/elevated changes, but it is a sudden change rather than the nice animation. I am using Sailor, but I suspect with other experiments I have done, it is not specific to how I route to a new page. Is there a technique for maintaining the animation when moving to a new page?

uitlaber commented 3 years ago

solved this

import 'dart:async';
...
if (_page == 1) {  
      Future.delayed(Duration(milliseconds: 540), () {
        Navigator.of(context).pushNamed('Search');
      });
}
...
rafalbednarczuk commented 3 years ago

If you want to keep the state of CurvedNavigationBar while navigation you must put MaterialApp inside CurvedNavigationBar