import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
void
main() {
runApp(
const
MyApp());
}
class
MyApp extends StatelessWidget {
const
MyApp({super.key});
@override
Widget build(BuildContext context) {
return
MaterialApp(
title:
'Save Password Google Flutter Template'
,
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green),
useMaterial3:
true
,
),
home:
const
MyWidget(),
);
}
}
class
MyWidget extends StatefulWidget {
const
MyWidget({super.key});
@override
State<MyWidget> createState() => _MyWidgetState();
}
class
_MyWidgetState extends State<MyWidget> {
@override
Widget build(BuildContext context) {
return
Scaffold(
appBar: AppBar(
backgroundColor: Colors.green,
title:
const
Text(
"Save Password Google Flutter"
), ),
body:
Padding(
padding:
const
EdgeInsets.all(8.0),
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const
Text(
"GFG Articles"
, style: TextStyle(fontSize: 20), ),
const
SizedBox(height: 10, ),
TextFormField(
autofillHints:
const
[ AutofillHints.newUsername],
), TextFormField(
autofillHints:
const
[AutofillHints.password],
),
const
SizedBox(height: 10, ),
ElevatedButton(onPressed: (){
TextInput.finishAutofillContext();
}, child:
const
Text(
"Save Password"
))
],
),
),
), );
}
}