Created
October 16, 2019 07:06
-
-
Save bsutton/23a12d8c1987d891da5adc46c1b28de3 to your computer and use it in GitHub Desktop.
Left and Right alignment widgets for Flutter
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
import 'package:flutter/material.dart'; | |
class Left extends StatelessWidget { | |
final Widget child; | |
Left({@required this.child}); | |
@override | |
Widget build(BuildContext context) { | |
return Align(alignment: Alignment.centerLeft, child: child); | |
} | |
} | |
class Right extends StatelessWidget { | |
final Widget child; | |
Right({@required this.child}); | |
@override | |
Widget build(BuildContext context) { | |
return Align(alignment: Alignment.centerRight, child: child); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment