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:
@@ -63,21 +63,11 @@ class _ContactsScreenState extends State<ContactsScreen> {
|
||||
}
|
||||
}
|
||||
|
||||
bool _isValidEmail(String email) {
|
||||
final emailRegex = RegExp(r'^[\w-\.]+@([\w-]+\.)+[\w-]{2,}$');
|
||||
return emailRegex.hasMatch(email);
|
||||
}
|
||||
|
||||
Future<void> _onSearch() async {
|
||||
final query = _searchController.text.trim();
|
||||
|
||||
if (query.isEmpty) {
|
||||
Toast.show(context, '请输入邮箱地址', type: ToastType.warning);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_isValidEmail(query)) {
|
||||
Toast.show(context, '请输入有效的邮箱地址', type: ToastType.warning);
|
||||
Toast.show(context, '请输入用户名或手机号', type: ToastType.warning);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -265,7 +255,9 @@ class _ContactsScreenState extends State<ContactsScreen> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.surfaceSecondary,
|
||||
resizeToAvoidBottomInset: false,
|
||||
body: SafeArea(
|
||||
maintainBottomViewPadding: true,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
@@ -323,7 +315,7 @@ class _ContactsScreenState extends State<ContactsScreen> {
|
||||
controller: _searchController,
|
||||
focusNode: _searchFocusNode,
|
||||
decoration: const InputDecoration(
|
||||
hintText: '输入邮箱搜索用户',
|
||||
hintText: '输入用户名或手机号',
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w500,
|
||||
@@ -341,7 +333,7 @@ class _ContactsScreenState extends State<ContactsScreen> {
|
||||
),
|
||||
),
|
||||
style: const TextStyle(fontSize: 13),
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
keyboardType: TextInputType.text,
|
||||
textInputAction: TextInputAction.search,
|
||||
onSubmitted: (_) => _onSearch(),
|
||||
onChanged: (value) {
|
||||
@@ -562,7 +554,7 @@ class _ContactsScreenState extends State<ContactsScreen> {
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
const Text(
|
||||
'搜索邮箱添加好友开始聊天吧',
|
||||
'搜索手机号添加好友开始聊天吧',
|
||||
style: TextStyle(fontSize: 13, color: AppColors.slate400),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user