儲存更新更新介面文字

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