AnimatedContainer with FutureBuilder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FutureBuilder( | |
future: future, | |
builder: (BuildContext context, AsyncSnapshot<String> snapshot) { | |
double width; | |
switch(snapshot.connectionState) { | |
case ConnectionState.none: | |
case ConnectionState.waiting: | |
case ConnectionState.active: | |
width = 0; | |
break; | |
case ConnectionState.done: | |
width = 500; | |
break; | |
} | |
return AnimatedContainer( | |
width: width, | |
child: Image.asset('assets/star.png'), | |
duration: Duration(seconds: 1), | |
); | |
} | |
), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment