Skip to content

Commit 74d3014

Browse files
Merge pull request #75 from Web3Auth/android-set-result
Add TextField for Email Passwordless in Demo
2 parents 2dba2a4 + b5f3059 commit 74d3014

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

example/lib/main.dart

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ class MyApp extends StatefulWidget {
2424
class _MyAppState extends State<MyApp> {
2525
String _result = '';
2626
bool logoutVisible = false;
27+
late final TextEditingController textEditingController;
2728

2829
@override
2930
void initState() {
3031
super.initState();
3132
initPlatformState();
33+
textEditingController = TextEditingController();
3234
}
3335

3436
// Platform messages are asynchronous, so we initialize in an async method.
@@ -148,6 +150,16 @@ class _MyAppState extends State<MyApp> {
148150
onPressed: _login(_withFacebook),
149151
child: const Text('Facebook'),
150152
),
153+
Padding(
154+
padding: const EdgeInsets.all(8.0),
155+
child: TextField(
156+
controller: textEditingController,
157+
decoration: const InputDecoration(
158+
border: OutlineInputBorder(),
159+
hintText: "[email protected]",
160+
),
161+
),
162+
),
151163
ElevatedButton(
152164
onPressed: _login(_withEmailPasswordless),
153165
child: const Text('Email Passwordless'),
@@ -308,7 +320,7 @@ class _MyAppState extends State<MyApp> {
308320
LoginParams(
309321
loginProvider: Provider.email_passwordless,
310322
extraLoginOptions: ExtraLoginOptions(
311-
login_hint: "[email protected]",
323+
login_hint: textEditingController.text,
312324
),
313325
),
314326
);

0 commit comments

Comments
 (0)