From 53c83adc716698a75a5863a4899b479be205112b Mon Sep 17 00:00:00 2001 From: Brett Morgan Date: Thu, 12 May 2022 15:41:34 -0700 Subject: [PATCH] Revert "Made elements on component screen stay compact on wider screen (#1258)" (#1266) This reverts commit a9eaf1a733695966afb5e854fd9f53e31f6421f0. --- material_3_demo/lib/component_screen.dart | 56 +++++++++++------------ material_3_demo/lib/main.dart | 2 +- 2 files changed, 27 insertions(+), 31 deletions(-) diff --git a/material_3_demo/lib/component_screen.dart b/material_3_demo/lib/component_screen.dart index 959b89986..8eb41788d 100644 --- a/material_3_demo/lib/component_screen.dart +++ b/material_3_demo/lib/component_screen.dart @@ -11,32 +11,26 @@ class ComponentScreen extends StatelessWidget { return Expanded( child: Padding( padding: const EdgeInsets.symmetric(horizontal: 10), - child: Align( - alignment: Alignment.topCenter, - child: SizedBox( - width: _maxWidthConstraint, - child: ListView( - shrinkWrap: true, - children: [ - _colDivider, - _colDivider, - const Buttons(), - _colDivider, - const FloatingActionButtons(), - _colDivider, - const Cards(), - _colDivider, - const Dialogs(), - _colDivider, - showNavBottomBar - ? const NavigationBars( - selectedIndex: 0, - isExampleBar: true, - ) - : Container(), - ], - ), - ), + child: ListView( + shrinkWrap: true, + children: [ + _colDivider, + _colDivider, + const Buttons(), + _colDivider, + const FloatingActionButtons(), + _colDivider, + const Cards(), + _colDivider, + const Dialogs(), + _colDivider, + showNavBottomBar + ? const NavigationBars( + selectedIndex: 0, + isExampleBar: true, + ) + : Container(), + ], ), ), ); @@ -46,7 +40,6 @@ class ComponentScreen extends StatelessWidget { const _rowDivider = SizedBox(width: 10); const _colDivider = SizedBox(height: 10); const double _cardWidth = 115; -const double _maxWidthConstraint = 400; void Function()? handlePressed( BuildContext context, bool isDisabled, String buttonName) { @@ -262,7 +255,8 @@ class Cards extends StatelessWidget { alignment: Alignment.topRight, child: Icon(Icons.more_vert), ), - SizedBox(height: 35), + _colDivider, + _colDivider, Align( alignment: Alignment.bottomLeft, child: Text("Elevated"), @@ -285,7 +279,8 @@ class Cards extends StatelessWidget { alignment: Alignment.topRight, child: Icon(Icons.more_vert), ), - SizedBox(height: 35), + _colDivider, + _colDivider, Align( alignment: Alignment.bottomLeft, child: Text("Filled"), @@ -313,7 +308,8 @@ class Cards extends StatelessWidget { alignment: Alignment.topRight, child: Icon(Icons.more_vert), ), - SizedBox(height: 35), + _colDivider, + _colDivider, Align( alignment: Alignment.bottomLeft, child: Text("Outlined"), diff --git a/material_3_demo/lib/main.dart b/material_3_demo/lib/main.dart index 42b1d70f0..82732531c 100644 --- a/material_3_demo/lib/main.dart +++ b/material_3_demo/lib/main.dart @@ -187,7 +187,7 @@ class _Material3DemoState extends State { selectedIndex: screenIndex)), const VerticalDivider(thickness: 1, width: 1), createScreenFor(screenIndex, true), - ],), + ]), ), ); }