Last active
April 22, 2019 10:02
-
-
Save felixblaschke/13eae534c721c2635e1f455903db2726 to your computer and use it in GitHub Desktop.
load-stuff-1.dart
This file contains hidden or 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
class LoadStuffButton extends StatefulWidget { | |
@override | |
_LoadStuffButtonState createState() => _LoadStuffButtonState(); | |
} | |
class _LoadStuffButtonState extends State<LoadStuffButton> { | |
bool _startedLoading = false; | |
bool _firstAnimationFinished = false; | |
bool _dataAvailable = false; | |
@override | |
Widget build(BuildContext context) { | |
return GestureDetector( | |
onTap: _clickLoadStuff, | |
child: Container(), // TODO implement | |
); | |
} | |
// TODO use somewhere | |
void _listenToAnimationFinished(status) { | |
if (status == AnimationStatus.completed) { | |
setState(() { | |
_firstAnimationFinished = true; | |
}); | |
} | |
} | |
void _clickLoadStuff() { | |
setState(() { | |
_startedLoading = true; | |
}); | |
Future.delayed(Duration(milliseconds: 2000)).then((_) { | |
setState(() { | |
_dataAvailable = true; | |
}); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment