Skip to content

Commit f6ba28b

Browse files
committed
Bump version 0.3.14 - invisible LOGIN and CONTINUE
1 parent fe2ef6d commit f6ba28b

File tree

6 files changed

+35
-34
lines changed

6 files changed

+35
-34
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ au](https://solidcommunity.au/docs/solidui)
1515

1616
## 0.4.0 Refine and Tune
1717

18+
+ Support invisible LOGIN/CONTINUE buttons [0.3.14 20260409 gjw]
1819
+ Support invisible REGISTER/INFO buttons for SolidLogin [0.3.13 20260409 gjw]
1920
+ Retain app theme across restart [0.3.12 20260409 gjw]
2021
+ Add get key if required to login [0.3.11 20260406 tonypioneer]

lib/src/widgets/solid_login.dart

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -615,10 +615,17 @@ class _SolidLoginState extends State<SolidLogin> with WidgetsBindingObserver {
615615
title: widget.title,
616616
appVersion: appVersion,
617617
webIdController: webIdController,
618-
loginButton: loginButton,
619-
registerButton: registerButton,
620-
continueButton: continueButton,
621-
infoButton: infoButton,
618+
buttons: [
619+
if (widget.loginButtonStyle.visible) loginButton,
620+
// When required=false, Continue is always shown — it is the primary
621+
// path for non-mandatory login. When required=true, Register appears
622+
// here and respects its own visible flag.
623+
if (widget.required ? widget.registerButtonStyle.visible : true)
624+
widget.required ? registerButton : continueButton,
625+
if (!widget.required && widget.registerButtonStyle.visible)
626+
registerButton,
627+
if (widget.infoButtonStyle.visible) infoButton,
628+
],
622629
isRequired: widget.required,
623630
currentTheme: currentTheme,
624631
serverInputFocusNode: _serverInputFocusNode,

lib/src/widgets/solid_login_build_helper.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class SolidLoginBuildHelper {
7070
required Future<void> Function() performLogin,
7171
required FocusNode focusNode,
7272
}) {
73+
if (!style.visible) return const SizedBox.shrink();
7374
return FocusTraversalOrder(
7475
order: const NumericFocusOrder(1),
7576
child: SolidLoginButtons.buildLoginButton(
@@ -89,6 +90,7 @@ class SolidLoginBuildHelper {
8990
required Future<void> Function() performContinue,
9091
required FocusNode focusNode,
9192
}) {
93+
if (!style.visible) return const SizedBox.shrink();
9294
return FocusTraversalOrder(
9395
order: const NumericFocusOrder(2),
9496
child: SolidLoginButtons.buildContinueButton(

lib/src/widgets/solid_login_helper.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,13 @@ class PodButton extends StatelessWidget {
191191

192192
class ContinueButtonStyle {
193193
const ContinueButtonStyle({
194+
this.visible = true,
194195
this.text = defaultContinueButtonText,
195196
this.background = defaultButtonBackground,
196197
this.foreground = defaultButtonForeground,
197198
this.tooltip = defaultContinueTooltip,
198199
});
200+
final bool visible;
199201
final String text;
200202
final Color background;
201203
final Color foreground;
@@ -215,11 +217,13 @@ class ChangeKeyButtonStyle {
215217

216218
class LoginButtonStyle {
217219
const LoginButtonStyle({
220+
this.visible = true,
218221
this.text = defaultLoginButtonText,
219222
this.background = loginButtonBackground,
220223
this.foreground = loginButtonForeground,
221224
this.tooltip = defaultLoginTooltip,
222225
});
226+
final bool visible;
223227
final String text;
224228
final Color background;
225229
final Color foreground;

lib/src/widgets/solid_login_panel.dart

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -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

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: solidui
22
description: 'A UI library for building Solid applications with Flutter.'
3-
version: 0.3.13
3+
version: 0.3.14
44
homepage: https://github.com/anusii/solidui
55

66
environment:

0 commit comments

Comments
 (0)