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
class FadeInUi extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return SingleChildScrollView( | |
child: Container( | |
padding: EdgeInsets.all(20.0), | |
child: Column( | |
children: <Widget>[ | |
HeaderPlaceholder(), | |
WhitespaceSeparator(), |
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
class FadeIn extends StatelessWidget { | |
final double delay; | |
final Widget child; | |
FadeIn(this.delay, this.child); | |
@override | |
Widget build(BuildContext context) { | |
final tween = MultiTrackTween([ | |
Track("opacity") |
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
class FadeInUi extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return SingleChildScrollView( | |
child: Container( | |
padding: EdgeInsets.all(20.0), | |
child: Column( | |
children: <Widget>[ | |
FadeIn(1.0, HeaderPlaceholder()), | |
WhitespaceSeparator(), |
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
class AnimatedBackground extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
final tween = MultiTrackTween([ | |
Track("color1").add(Duration(seconds: 3), | |
ColorTween(begin: Color(0xffD38312), end: Colors.lightBlue.shade900)), | |
Track("color2").add(Duration(seconds: 3), | |
ColorTween(begin: Color(0xffA83279), end: Colors.blue.shade600)) | |
]); |
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
class AnimatedWave extends StatelessWidget { | |
final double height; | |
final double speed; | |
final double offset; | |
AnimatedWave({this.height, this.speed, this.offset = 0.0}); | |
@override | |
Widget build(BuildContext context) { | |
return LayoutBuilder(builder: (context, constraints) { |
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
class FancyBackgroundApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Stack( | |
children: <Widget>[ | |
Positioned.fill(child: AnimatedBackground()), | |
onBottom(AnimatedWave( | |
height: 180, | |
speed: 1.0, | |
)), |
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
class SwitchlikeCheckbox extends StatelessWidget { | |
final bool checked; | |
SwitchlikeCheckbox({this.checked}); | |
@override | |
Widget build(BuildContext context) { | |
var tween = MultiTrackTween([ | |
Track("paddingLeft") | |
.add(Duration(milliseconds: 1000), Tween(begin: 0.0, end: 20.0)), |
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
class SwitchlikeCheckbox extends StatelessWidget { | |
// ... | |
// all code from part 1 | |
Widget _buildCheckbox(context, animation) { | |
return Container( | |
decoration: _outerBoxDecoration(animation["color"]), | |
width: 50, | |
height: 30, | |
padding: const EdgeInsets.all(3.0), |
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
class ExampleForm extends StatefulWidget { | |
@override | |
_ExampleFormState createState() => _ExampleFormState(); | |
} | |
class _ExampleFormState extends State<ExampleForm> { | |
bool enableCoolStuff = false; | |
@override | |
Widget build(BuildContext context) { |
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
class LoadStuffButton extends StatefulWidget { | |
@override | |
_LoadStuffButtonState createState() => _LoadStuffButtonState(); | |
} | |
class _LoadStuffButtonState extends State<LoadStuffButton> { | |
bool _startedLoading = false; | |
bool _firstAnimationFinished = false; | |
bool _dataAvailable = false; |
OlderNewer