儲存更新更新介面文字

This commit is contained in:
kuei 2024-09-26 18:16:42 +08:00
parent 064f8894be
commit ed40d6633d

View File

@ -115,6 +115,7 @@ class _PersonalInfoState extends State<PersonalInfo> {
_email = _emailController.text;
_password = _passwordController.text;
_isEditing = false;
print('有道這裡1');
});
} catch (e) {
print('Error: $e');
@ -140,7 +141,7 @@ class _PersonalInfoState extends State<PersonalInfo> {
body: Column(
children: [
Container(
height: 120,
height: 100,
color: Color(0xFFF5E3C3),
padding: EdgeInsets.only(top: 50, left: 20, right: 20),
child: Row(
@ -321,11 +322,42 @@ class _BasicInfoPageState extends State<BasicInfoPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
/*appBar: AppBar(
title: Text('基本資料'),
backgroundColor: Color(0xFFE0D0A9),
),*/
body: Column(
children: [
Container(
height: 100,
color: Color(0xFFF5E3C3),
width: double.infinity,
padding: EdgeInsets.all(10.0),
/* child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, //
children: [
IconButton(
icon: Icon(Icons.arrow_back, color: Colors.black, size: 24),
onPressed: () {
Navigator.pop(context, true); //
},
),
body: ListView(
Text(
'基本資料',
style: TextStyle(fontSize: 24, height: 5),
),
],
),
),*/
child: Center(
child: Text(
'基本資料',
style: TextStyle(fontSize: 24, height: 5),
),
),
),
Expanded(
child: ListView(
padding: EdgeInsets.all(16),
children: [
ListTile(
@ -334,7 +366,7 @@ class _BasicInfoPageState extends State<BasicInfoPage> {
? TextField(
controller: _realnameController,
)
: Text(widget.realname),
: Text(_realnameController.text),//Controller.text才會跟著修正更新
),
Divider(),
ListTile(
@ -343,7 +375,7 @@ class _BasicInfoPageState extends State<BasicInfoPage> {
? TextField(
controller: _phoneController,
)
: Text(widget.phone),
: Text(_phoneController.text),
),
Divider(),
ListTile(
@ -352,7 +384,7 @@ class _BasicInfoPageState extends State<BasicInfoPage> {
? TextField(
controller: _genderController,
)
: Text(widget.gender),
: Text(_genderController.text),
),
Divider(),
ListTile(
@ -361,7 +393,7 @@ class _BasicInfoPageState extends State<BasicInfoPage> {
? TextField(
controller: _addressController,
)
: Text(widget.address),
: Text(_addressController.text),
),
SizedBox(height: 20),
ElevatedButton(
@ -381,6 +413,9 @@ class _BasicInfoPageState extends State<BasicInfoPage> {
),
],
),
),
],
),
);
}
}
@ -471,7 +506,7 @@ class _AccountPageState extends State<AccountPage> {
? TextField(
controller: _emailController,
)
: Text(widget.email),
: Text(_emailController.text),
),
Divider(),
ListTile(
@ -492,7 +527,7 @@ class _AccountPageState extends State<AccountPage> {
),
)
: Text(widget.password),
: Text(_passwordController.text),
),
SizedBox(height: 20),
ElevatedButton(