]> git.cworth.org Git - lmno.games/commitdiff
Add new Container to allow for margin
authorKevin Worth <kworth082@gmail.com>
Sat, 2 May 2020 11:13:08 +0000 (07:13 -0400)
committerCarl Worth <cworth@cworth.org>
Sat, 23 May 2020 13:49:00 +0000 (06:49 -0700)
The Center widget can't have margin, apparently, so we'll put it in
a Container which can.

flutterfamilies/lib/main.dart

index 616542220e05b986fe1938eb5ff171ecb7f5ed6b..1f2d410b324a51215aed2de879314c08815f2a3b 100644 (file)
@@ -77,7 +77,9 @@ class _MyHomePageState extends State<MyHomePage> {
         // the App.build method, and use it to set our appbar title.
         title: Text(widget.title),
       ),
         // 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(
         // 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<MyHomePage> {
           ],
         ),
       ),
           ],
         ),
       ),
+    ),
       floatingActionButton: FloatingActionButton(
         onPressed: _incrementCounter,
         tooltip: 'Increment',
       floatingActionButton: FloatingActionButton(
         onPressed: _incrementCounter,
         tooltip: 'Increment',