Skip to content

Instantly share code, notes, and snippets.

@bsutton
Created October 16, 2019 07:06
Show Gist options
  • Save bsutton/23a12d8c1987d891da5adc46c1b28de3 to your computer and use it in GitHub Desktop.
Save bsutton/23a12d8c1987d891da5adc46c1b28de3 to your computer and use it in GitHub Desktop.
Left and Right alignment widgets for Flutter
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