Skip to content

Instantly share code, notes, and snippets.

@theacodes theacodes/main.dart
Created Nov 27, 2019

Embed
What would you like to do?
AnimatedContainer with FutureBuilder
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
You can’t perform that action at this time.