feat(apps): update UI screens and shared components
- Update home screen with new composer and interactions - Update settings screens with new profile flow - Update calendar share dialog - Update contacts screen - Add new shared widgets: confirm_sheet, phone_prefix_selector - Add new formatters: phone_display_formatter - Update tests for modified components
This commit is contained in:
@@ -18,7 +18,7 @@ class AddContactScreen extends StatefulWidget {
|
||||
|
||||
class _AddContactScreenState extends State<AddContactScreen> {
|
||||
final _nameController = TextEditingController();
|
||||
final _emailController = TextEditingController();
|
||||
final _phoneController = TextEditingController();
|
||||
final _remarkController = TextEditingController();
|
||||
|
||||
bool get isEditing => widget.contactId != null;
|
||||
@@ -26,7 +26,7 @@ class _AddContactScreenState extends State<AddContactScreen> {
|
||||
@override
|
||||
void dispose() {
|
||||
_nameController.dispose();
|
||||
_emailController.dispose();
|
||||
_phoneController.dispose();
|
||||
_remarkController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
@@ -35,7 +35,9 @@ class _AddContactScreenState extends State<AddContactScreen> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.surfaceSecondary,
|
||||
resizeToAvoidBottomInset: false,
|
||||
body: SafeArea(
|
||||
maintainBottomViewPadding: true,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
@@ -122,10 +124,10 @@ class _AddContactScreenState extends State<AddContactScreen> {
|
||||
AppInput(label: '昵称', hint: '请输入昵称', controller: _nameController),
|
||||
const SizedBox(height: 14),
|
||||
AppInput(
|
||||
label: '邮箱',
|
||||
hint: '请输入邮箱',
|
||||
controller: _emailController,
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
label: '手机号',
|
||||
hint: '+86 请输入 11 位手机号',
|
||||
controller: _phoneController,
|
||||
keyboardType: TextInputType.phone,
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
AppInput(
|
||||
@@ -152,10 +154,10 @@ class _AddContactScreenState extends State<AddContactScreen> {
|
||||
|
||||
void _handleConfirm() {
|
||||
final name = _nameController.text.trim();
|
||||
final email = _emailController.text.trim();
|
||||
final phone = _phoneController.text.trim();
|
||||
|
||||
if (name.isEmpty || email.isEmpty) {
|
||||
Toast.show(context, '请填写昵称和邮箱', type: ToastType.warning);
|
||||
if (name.isEmpty || phone.isEmpty) {
|
||||
Toast.show(context, '请填写昵称和手机号', type: ToastType.warning);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user