🚀 Launch 2.2.2+58

This commit is contained in:
LittleSheep 2025-01-28 21:15:11 +08:00
parent 1e8a6dea5b
commit 8bb62b5992
2 changed files with 18 additions and 9 deletions

View File

@ -208,7 +208,9 @@ class _LoginCheckScreenState extends State<_LoginCheckScreen> {
controller: _passwordController, controller: _passwordController,
obscureText: true, obscureText: true,
autofillHints: [ autofillHints: [
widget.factor!.type == 0 ? AutofillHints.password : AutofillHints.oneTimeCode widget.factor!.type == 0
? AutofillHints.password
: AutofillHints.oneTimeCode
], ],
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
@ -263,7 +265,8 @@ class _LoginPickerScreenState extends State<_LoginPickerScreen> {
bool _isBusy = false; bool _isBusy = false;
int? _factorPicked; int? _factorPicked;
Color get _unFocusColor => Theme.of(context).colorScheme.onSurface.withAlpha((255 * 0.75).round()); Color get _unFocusColor =>
Theme.of(context).colorScheme.onSurface.withAlpha((255 * 0.75).round());
void _performGetFactorCode() async { void _performGetFactorCode() async {
if (_factorPicked == null) return; if (_factorPicked == null) return;
@ -327,8 +330,8 @@ class _LoginPickerScreenState extends State<_LoginPickerScreen> {
kFactorTypes[x.type]?.$3 ?? Symbols.question_mark, kFactorTypes[x.type]?.$3 ?? Symbols.question_mark,
), ),
title: Text( title: Text(
kFactorTypes[x.type]?.$1 ?? 'unknown'.tr(), kFactorTypes[x.type]?.$1 ?? 'unknown',
), ).tr(),
enabled: !widget.ticket!.factorTrail.contains(x.id), enabled: !widget.ticket!.factorTrail.contains(x.id),
value: _factorPicked == x.id, value: _factorPicked == x.id,
onChanged: (value) { onChanged: (value) {
@ -404,11 +407,13 @@ class _LoginLookupScreenState extends State<_LoginLookupScreen> {
try { try {
final sn = context.read<SnNetworkProvider>(); final sn = context.read<SnNetworkProvider>();
final lookupResp = await sn.client.get('/cgi/id/users/lookup?probe=$username'); final lookupResp =
await sn.client.get('/cgi/id/users/lookup?probe=$username');
await sn.client.post('/cgi/id/users/me/password-reset', data: { await sn.client.post('/cgi/id/users/me/password-reset', data: {
'user_id': lookupResp.data['id'], 'user_id': lookupResp.data['id'],
}); });
if (mounted) context.showModalDialog('done'.tr(), 'signinResetPasswordSent'.tr()); if (mounted)
context.showModalDialog('done'.tr(), 'signinResetPasswordSent'.tr());
} catch (err) { } catch (err) {
if (mounted) context.showErrorDialog(err); if (mounted) context.showErrorDialog(err);
} finally { } finally {
@ -433,7 +438,8 @@ class _LoginLookupScreenState extends State<_LoginLookupScreen> {
widget.onTicket(result.ticket); widget.onTicket(result.ticket);
// Pull factors // Pull factors
final factorResp = await sn.client.get('/cgi/id/auth/factors', queryParameters: { final factorResp =
await sn.client.get('/cgi/id/auth/factors', queryParameters: {
'ticketId': result.ticket!.id.toString(), 'ticketId': result.ticket!.id.toString(),
}); });
widget.onFactor( widget.onFactor(
@ -527,7 +533,10 @@ class _LoginLookupScreenState extends State<_LoginLookupScreen> {
'termAcceptNextWithAgree'.tr(), 'termAcceptNextWithAgree'.tr(),
textAlign: TextAlign.end, textAlign: TextAlign.end,
style: Theme.of(context).textTheme.bodySmall!.copyWith( style: Theme.of(context).textTheme.bodySmall!.copyWith(
color: Theme.of(context).colorScheme.onSurface.withAlpha((255 * 0.75).round()), color: Theme.of(context)
.colorScheme
.onSurface
.withAlpha((255 * 0.75).round()),
), ),
), ),
Material( Material(

View File

@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts # In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix. # of the product and file versions while build-number is used as the build suffix.
version: 2.2.2+57 version: 2.2.2+58
environment: environment:
sdk: ^3.5.4 sdk: ^3.5.4