improved oidc login error

This commit is contained in:
rustdesk
2026-04-15 14:36:03 +08:00
parent 28e303576c
commit 68fa0466c8

View File

@@ -224,21 +224,59 @@ class _WidgetOPState extends State<WidgetOP> {
return Offstage( return Offstage(
offstage: offstage:
_failedMsg.isEmpty && widget.curOP.value != widget.config.op, _failedMsg.isEmpty && widget.curOP.value != widget.config.op,
child: RichText( child: Column(
text: TextSpan( crossAxisAlignment: CrossAxisAlignment.center,
text: '$_stateMsg ', children: [
style: if (_stateMsg.isNotEmpty && _failedMsg.isEmpty)
DefaultTextStyle.of(context).style.copyWith(fontSize: 12), Padding(
children: <TextSpan>[ padding: const EdgeInsets.only(top: 8.0),
TextSpan( child: SelectableText(
text: _failedMsg, translate(_stateMsg),
style: DefaultTextStyle.of(context).style.copyWith( style: DefaultTextStyle.of(context)
fontSize: 14, .style
color: Colors.red, .copyWith(fontSize: 12),
), ),
), ),
], if (_failedMsg.isNotEmpty)
), Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Builder(builder: (context) {
final errorColor =
Theme.of(context).colorScheme.error;
final bgColor = Theme.of(context)
.colorScheme
.errorContainer
.withOpacity(0.3);
return Container(
padding: const EdgeInsets.symmetric(
horizontal: 8.0, vertical: 6.0),
decoration: BoxDecoration(
color: bgColor,
borderRadius: BorderRadius.circular(4.0),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.error_outline,
color: errorColor, size: 16),
const SizedBox(width: 6),
Flexible(
child: SelectableText(
translate(_failedMsg),
style: DefaultTextStyle.of(context)
.style
.copyWith(
fontSize: 13,
color: errorColor,
),
),
),
],
),
);
}),
),
],
), ),
); );
}), }),