Skip to content

Commit

Permalink
view: sudoku_board: Dont use constructor tearoff
Browse files Browse the repository at this point in the history
  • Loading branch information
KalilDev committed Jun 21, 2022
1 parent fe97b59 commit d61055f
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions lib/view/sudoku_board/keypad.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<Widget> 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<Widget> 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
Expand Down

0 comments on commit d61055f

Please sign in to comment.