From: Kevin Worth Date: Sat, 2 May 2020 11:13:08 +0000 (-0400) Subject: Add new Container to allow for margin X-Git-Url: https://git.cworth.org/git?p=lmno.games;a=commitdiff_plain;h=0551423accbc0c9fb91ec3ca42cc7c87081f7eff Add new Container to allow for margin The Center widget can't have margin, apparently, so we'll put it in a Container which can. --- diff --git a/flutterfamilies/lib/main.dart b/flutterfamilies/lib/main.dart index 6165422..1f2d410 100644 --- a/flutterfamilies/lib/main.dart +++ b/flutterfamilies/lib/main.dart @@ -77,7 +77,9 @@ class _MyHomePageState extends State { // the App.build method, and use it to set our appbar title. title: Text(widget.title), ), - body: Center( + body: new Container( + margin: const EdgeInsets.only(left: 20.0, right: 20.0), + child : Center( // Center is a layout widget. It takes a single child and positions it // in the middle of the parent. child: Column( @@ -122,6 +124,7 @@ class _MyHomePageState extends State { ], ), ), + ), floatingActionButton: FloatingActionButton( onPressed: _incrementCounter, tooltip: 'Increment',