From d61055f83497f850c38cef58531f8f2de066fd7b Mon Sep 17 00:00:00 2001 From: KalilDev Date: Tue, 21 Jun 2022 14:37:53 -0300 Subject: [PATCH] view: sudoku_board: Dont use constructor tearoff --- lib/view/sudoku_board/keypad.dart | 34 +++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/lib/view/sudoku_board/keypad.dart b/lib/view/sudoku_board/keypad.dart index 522a426..7425ea2 100644 --- a/lib/view/sudoku_board/keypad.dart +++ b/lib/view/sudoku_board/keypad.dart @@ -250,10 +250,36 @@ class _KeypadLayout extends StatelessWidget { } } - _AxisBuilder get _mainAxisBuilder => - axis == _MainAxis.vertical ? Column.new : Row.new; - _AxisBuilder get _crossAxisBuilder => - axis == _MainAxis.vertical ? Row.new : Column.new; + Widget _mainAxisBuilder( + {MainAxisSize mainAxisSize = MainAxisSize.max, + CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center, + required List children}) => + axis == _MainAxis.vertical + ? Column( + mainAxisSize: mainAxisSize, + crossAxisAlignment: crossAxisAlignment, + children: children, + ) + : Row( + mainAxisSize: mainAxisSize, + crossAxisAlignment: crossAxisAlignment, + children: children, + ); + Widget _crossAxisBuilder( + {MainAxisSize mainAxisSize = MainAxisSize.max, + CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center, + required List children}) => + axis == _MainAxis.vertical + ? Row( + mainAxisSize: mainAxisSize, + crossAxisAlignment: crossAxisAlignment, + children: children, + ) + : Column( + mainAxisSize: mainAxisSize, + crossAxisAlignment: crossAxisAlignment, + children: children, + ); Widget _buildLayout(BuildContext context, BoxConstraints constraints) { final crossAxis = axis == _MainAxis.vertical