From 0551423accbc0c9fb91ec3ca42cc7c87081f7eff Mon Sep 17 00:00:00 2001 From: Kevin Worth Date: Sat, 2 May 2020 07:13:08 -0400 Subject: [PATCH] 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. --- flutterfamilies/lib/main.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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', -- 2.43.0