mirror of
				https://gitlab.com/famedly/fluffychat.git
				synced 2025-11-04 06:17:26 +01:00 
			
		
		
		
	feat: Implement autofillhints
This commit is contained in:
		
							parent
							
								
									56edb77b68
								
							
						
					
					
						commit
						41a24574ce
					
				@ -180,6 +180,7 @@ class _LoginState extends State<Login> {
 | 
			
		||||
                autofocus: true,
 | 
			
		||||
                onChanged: (t) => _checkWellKnownWithCoolDown(t, context),
 | 
			
		||||
                controller: usernameController,
 | 
			
		||||
                autofillHints: [AutofillHints.username],
 | 
			
		||||
                decoration: InputDecoration(
 | 
			
		||||
                    prefixIcon: Icon(Icons.account_box_outlined),
 | 
			
		||||
                    hintText:
 | 
			
		||||
@ -193,6 +194,7 @@ class _LoginState extends State<Login> {
 | 
			
		||||
              child: TextField(
 | 
			
		||||
                readOnly: loading,
 | 
			
		||||
                autocorrect: false,
 | 
			
		||||
                autofillHints: [AutofillHints.password],
 | 
			
		||||
                controller: passwordController,
 | 
			
		||||
                obscureText: !showPassword,
 | 
			
		||||
                onSubmitted: (t) => login(context),
 | 
			
		||||
 | 
			
		||||
@ -95,6 +95,7 @@ class _SignUpState extends State<SignUp> {
 | 
			
		||||
                autocorrect: false,
 | 
			
		||||
                controller: usernameController,
 | 
			
		||||
                onSubmitted: (s) => signUpAction(context),
 | 
			
		||||
                autofillHints: [AutofillHints.newUsername],
 | 
			
		||||
                decoration: InputDecoration(
 | 
			
		||||
                  prefixIcon: Icon(Icons.account_circle_outlined),
 | 
			
		||||
                  hintText: L10n.of(context).username,
 | 
			
		||||
 | 
			
		||||
@ -1,12 +1,13 @@
 | 
			
		||||
import 'dart:math';
 | 
			
		||||
 | 
			
		||||
import 'package:adaptive_page_layout/adaptive_page_layout.dart';
 | 
			
		||||
import 'package:adaptive_dialog/adaptive_dialog.dart';
 | 
			
		||||
import 'package:flushbar/flushbar_helper.dart';
 | 
			
		||||
import 'package:famedlysdk/famedlysdk.dart';
 | 
			
		||||
 | 
			
		||||
import 'package:fluffychat/components/matrix.dart';
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
 | 
			
		||||
import 'package:url_launcher/url_launcher.dart';
 | 
			
		||||
 | 
			
		||||
class SignUpPassword extends StatefulWidget {
 | 
			
		||||
  final MatrixFile avatar;
 | 
			
		||||
@ -74,13 +75,19 @@ class _SignUpPasswordState extends State<SignUpPassword> {
 | 
			
		||||
            return setState(() => loading = false);
 | 
			
		||||
          }
 | 
			
		||||
          _lastAuthWebViewStage = currentStage;
 | 
			
		||||
          await AdaptivePageLayout.of(context).pushNamed(
 | 
			
		||||
            '/authwebview/$currentStage/${exception.session}',
 | 
			
		||||
            arguments: () => _signUpAction(
 | 
			
		||||
          await launch(
 | 
			
		||||
            Matrix.of(context).client.homeserver.toString() +
 | 
			
		||||
                '/_matrix/client/r0/auth/$currentStage/fallback/web?session=${exception.session}',
 | 
			
		||||
          );
 | 
			
		||||
          if (OkCancelResult.ok ==
 | 
			
		||||
              await showOkCancelAlertDialog(
 | 
			
		||||
                context: context,
 | 
			
		||||
              )) {
 | 
			
		||||
            _signUpAction(
 | 
			
		||||
              context,
 | 
			
		||||
              auth: AuthenticationData(session: exception.session),
 | 
			
		||||
            ),
 | 
			
		||||
          );
 | 
			
		||||
            );
 | 
			
		||||
          }
 | 
			
		||||
          return;
 | 
			
		||||
        }
 | 
			
		||||
      } else {
 | 
			
		||||
@ -135,6 +142,7 @@ class _SignUpPasswordState extends State<SignUpPassword> {
 | 
			
		||||
              autofocus: true,
 | 
			
		||||
              autocorrect: false,
 | 
			
		||||
              onSubmitted: (t) => _signUpAction(context),
 | 
			
		||||
              autofillHints: [AutofillHints.newPassword],
 | 
			
		||||
              decoration: InputDecoration(
 | 
			
		||||
                  prefixIcon: Icon(Icons.lock_outlined),
 | 
			
		||||
                  hintText: '****',
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user