buttonSetView method
Implementation
Widget buttonSetView() {
if (buttons.isEmpty) {
// No Button
return const SizedBox(height: 20);
} else if (buttons.length == 2) {
// 2 Buttons
return Column(
children: [
Container(
width: 300,
height: 1,
color: Colors.black.withOpacity(0.1),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 50,
width: 149.5,
child: buttons[0],
),
Container(
width: 1,
height: 50,
color: Colors.black.withOpacity(0.1),
),
SizedBox(
height: 50,
width: 149.5,
child: buttons[1],
),
],
),
],
);
} else {
// Many Buttons
return Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
for (final button in buttons)
SizedBox(
width: 300,
height: 51,
child: Column(
children: [
Container(
width: double.infinity,
height: 1,
color: Colors.black.withOpacity(0.1),
),
SizedBox(
width: double.infinity,
height: 50,
child: button,
)
],
),
),
],
);
}
}