Flutter Autofill email and password like netflix

Viewed 2164

Can anyone please show me how can i implement password manager like netflix in flutter, Like if user clicking on email textfield then show stored email and password like netflix does. Thank You.

1 Answers

What was missing for me is this migration https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects. Notably, your MainActivity needs to extend io.flutter.embedding.android.FlutterActivity and not io.flutter.app.FlutterActivity.

Also,you need to configure an AutoFill service in the system settings.

Working sample code:

 @override
  Widget build(BuildContext context) => Scaffold(
    appBar: AppBar(
      title: Text("Login"),
    ),
    body: AutofillGroup(
        child: Column(
      children: [
        TextField(
          autofillHints: [AutofillHints.email],
          keyboardType: TextInputType.emailAddress,
        ),
        TextField(
          autofillHints: [AutofillHints.password],
          keyboardType: TextInputType.text,
        ),
      ],
    )));

For More Checkout this Video Reference :

https://www.youtube.com/watch?v=v8T4fnrQCf0

Related