Skip to content

Instantly share code, notes, and snippets.

@hnvn
Created June 26, 2018 04:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hnvn/211424f929573e58d166657618079cfe to your computer and use it in GitHub Desktop.
Save hnvn/211424f929573e58d166657618079cfe to your computer and use it in GitHub Desktop.
class FlipWidget extends StatelessWidget {
Widget child;
FlipWidget({Key key, this.child}) : super(key: key);
@override
Widget build(BuildContext context) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
ClipRect(
child: Align(
alignment: Alignment.topCenter,
heightFactor: 0.5,
child: child,
)),
Padding(
padding: EdgeInsets.only(top: 2.0),
),
ClipRect(
child: Align(
alignment: Alignment.bottomCenter,
heightFactor: 0.5,
child: child,
)),
],
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment