diff --git a/designer_v2/lib/common_views/layout_two_column.dart b/designer_v2/lib/common_views/layout_two_column.dart index 05777f2c7..b76255037 100644 --- a/designer_v2/lib/common_views/layout_two_column.dart +++ b/designer_v2/lib/common_views/layout_two_column.dart @@ -18,7 +18,6 @@ class TwoColumnLayout extends StatefulWidget { this.paddingRight = defaultContentPadding, this.backgroundColorLeft, this.backgroundColorRight, - this.stretchHeight = false, super.key, }); @@ -55,8 +54,6 @@ class TwoColumnLayout extends StatefulWidget { final Color? backgroundColorLeft; final Color? backgroundColorRight; - final bool stretchHeight; - @override State createState() => _TwoColumnLayoutState(); @@ -123,17 +120,6 @@ class _TwoColumnLayoutState extends State { return LayoutBuilder( builder: (context, constraints) { - if (widget.stretchHeight) { - leftWidget = SizedBox( - height: constraints.maxHeight, - child: leftWidget, - ); - rightWidget = SizedBox( - height: constraints.maxHeight, - child: rightWidget, - ); - } - if (widget.scrollLeft) { leftWidget = Scrollbar( thumbVisibility: true, @@ -155,31 +141,31 @@ class _TwoColumnLayoutState extends State { ); } - if (!(widget.constraintsLeft != null && widget.flexLeft != null)) { + // Apply constraints or flex to leftWidget if only one is provided + if (widget.constraintsLeft != null || widget.flexLeft != null) { if (widget.constraintsLeft != null) { leftWidget = Container( constraints: widget.constraintsLeft, child: leftWidget, ); - } - if (widget.flexLeft != null) { + } else if (widget.flexLeft != null) { leftWidget = Flexible(flex: widget.flexLeft!, child: leftWidget); } } - if (!(widget.constraintsRight != null && widget.flexRight != null)) { + // Apply constraints or flex to rightWidget if only one is provided + if (widget.constraintsRight != null || widget.flexRight != null) { if (widget.constraintsRight != null) { - rightWidget = Container( - constraints: widget.constraintsRight, - child: rightWidget, - ); - } - if (widget.flexRight != null) { + } else if (widget.flexRight != null && rightWidget is! Flexible) { + // THIS IS RIGHT WIDGET rightWidget = Flexible(flex: widget.flexRight!, child: rightWidget); } } + // Apply ConstrainedWidthFlexible to leftWidget if both + // constraintsLeft and flexLeft are provided if (widget.constraintsLeft != null && widget.flexLeft != null) { + // THIS IS LEFT WIDGET leftWidget = ConstrainedWidthFlexible( minWidth: widget.constraintsLeft?.minWidth ?? double.infinity, maxWidth: widget.constraintsLeft?.maxWidth ?? double.infinity, @@ -190,6 +176,8 @@ class _TwoColumnLayoutState extends State { ); } + // Apply ConstrainedWidthFlexible to rightWidget if both + // constraintsRight and flexRight are provided if (widget.constraintsRight != null && widget.flexRight != null) { rightWidget = ConstrainedWidthFlexible( minWidth: widget.constraintsRight?.minWidth ?? double.infinity, diff --git a/designer_v2/lib/features/auth/auth_scaffold.dart b/designer_v2/lib/features/auth/auth_scaffold.dart index e55c42cbf..9a40dec8b 100644 --- a/designer_v2/lib/features/auth/auth_scaffold.dart +++ b/designer_v2/lib/features/auth/auth_scaffold.dart @@ -21,7 +21,7 @@ class AuthScaffold extends ConsumerStatefulWidget { required this.body, required this.formKey, this.leftContentMinWidth = 424.0, - this.leftPanelMinWidth = 500.0, + this.leftPanelMinWidth = 550.0, this.leftPanelPadding = const EdgeInsets.fromLTRB(88.0, 54.0, 88.0, 40.0), super.key, }); @@ -108,7 +108,7 @@ class _AuthScaffoldState extends ConsumerState { padding: const EdgeInsets.only(left: 12.0), child: Container( constraints: BoxConstraints( - maxWidth: widget.leftPanelMinWidth - 12 * 2, + maxWidth: widget.leftPanelMinWidth - 24, ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -142,23 +142,18 @@ class _AuthScaffoldState extends ConsumerState { ), ), ), - rightWidget: const Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: Center( - child: StudyUJobsToBeDone(), - ), - ), - ], + rightWidget: const Center( + child: Wrap( + children: [ + StudyUJobsToBeDone(), + ], + ), ), backgroundColorLeft: ThemeConfig.bodyBackgroundColor(theme), backgroundColorRight: theme.colorScheme.primary, constraintsLeft: BoxConstraints(minWidth: widget.leftPanelMinWidth), scrollLeft: false, scrollRight: false, - stretchHeight: true, paddingLeft: widget.leftPanelPadding, ), );