@@ -46,10 +46,7 @@ class SolidLoginPanel {
4646 required String title,
4747 required String appVersion,
4848 required TextEditingController webIdController,
49- required Widget loginButton,
50- required Widget registerButton,
51- required Widget continueButton,
52- required Widget infoButton,
49+ required List <Widget > buttons,
5350 required bool isRequired,
5451 required SolidLoginThemeMode currentTheme,
5552 FocusNode ? serverInputFocusNode,
@@ -92,35 +89,25 @@ class SolidLoginPanel {
9289 ),
9390 const SizedBox (height: 20.0 ),
9491
95- // Column of buttons.
92+ // Column of buttons — dynamic rows of up to 2, skipping hidden ones .
9693
9794 Column (
9895 mainAxisSize: MainAxisSize .min,
9996 children: [
100- Row (
101- mainAxisAlignment: MainAxisAlignment .center,
102- children: [
103- Expanded (child: loginButton),
104- const SizedBox (width: 15.0 ),
105- Expanded (child: isRequired ? registerButton : continueButton),
106- ],
107- ),
108- const SizedBox (height: 15.0 ),
109- Row (
110- children: [
111- if (! isRequired) Expanded (child: registerButton),
112- if (isRequired)
113- Expanded (
114- child: SizedBox (
115- width: MediaQuery .sizeOf (context).width * 0.5 ,
116- child: infoButton,
117- ),
118- ),
119- const SizedBox (width: 15.0 ),
120- isRequired ? const Spacer () : Expanded (child: infoButton),
121- ],
122- ),
123- const SizedBox (height: 15.0 ),
97+ for (int i = 0 ; i < buttons.length; i += 2 ) ...[
98+ Row (
99+ mainAxisAlignment: MainAxisAlignment .center,
100+ children: [
101+ Expanded (child: buttons[i]),
102+ if (i + 1 < buttons.length) ...[
103+ const SizedBox (width: 15.0 ),
104+ Expanded (child: buttons[i + 1 ]),
105+ ] else
106+ const Expanded (child: SizedBox .shrink ()),
107+ ],
108+ ),
109+ const SizedBox (height: 15.0 ),
110+ ],
124111 ],
125112 ),
126113
0 commit comments