83 lines
2.5 KiB
Dart
83 lines
2.5 KiB
Dart
import 'package:chat/configs/app_colors.dart';
|
|
import 'package:chat/controllers/private_controller.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
class ImFriendRemarkPage extends StatefulWidget {
|
|
const ImFriendRemarkPage({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
State<ImFriendRemarkPage> createState() => _ImFriendRemarkPageState();
|
|
}
|
|
|
|
class _ImFriendRemarkPageState extends State<ImFriendRemarkPage> {
|
|
final TextEditingController _controller = TextEditingController();
|
|
|
|
@override
|
|
void dispose() {
|
|
_controller.dispose();
|
|
super.dispose();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return GetX<PrivateController>(builder: (_) {
|
|
_controller.text = _.currentFriend.value.friendRemark;
|
|
return GestureDetector(
|
|
onTap: () {
|
|
FocusScope.of(Get.context!).requestFocus(FocusNode());
|
|
},
|
|
child: Scaffold(
|
|
appBar: AppBar(
|
|
actions: [
|
|
TextButton(
|
|
child: const Text('保存'),
|
|
onPressed: () async {
|
|
_.setRemark(_controller.text);
|
|
},
|
|
)
|
|
],
|
|
),
|
|
body: SingleChildScrollView(
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(16.0),
|
|
child: Column(
|
|
children: [
|
|
const Text(
|
|
'设置备注',
|
|
style: TextStyle(
|
|
fontSize: 18,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
const SizedBox(height: 32),
|
|
ClipRRect(
|
|
borderRadius: BorderRadius.circular(8),
|
|
child: TextField(
|
|
controller: _controller,
|
|
autofocus: true,
|
|
decoration: const InputDecoration(
|
|
labelText: '好友备注',
|
|
hintText: '',
|
|
hintStyle: TextStyle(
|
|
fontSize: 14,
|
|
color: AppColors.unactive,
|
|
),
|
|
border: InputBorder.none,
|
|
focusedBorder: InputBorder.none,
|
|
fillColor: AppColors.white,
|
|
filled: true,
|
|
),
|
|
cursorColor: AppColors.primary,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
});
|
|
}
|
|
}
|