From e6065552346635e3345c69e3c0f6e5f28f4693e2 Mon Sep 17 00:00:00 2001 From: MohammadTaha Basiri Date: Mon, 1 Apr 2024 16:23:57 +0330 Subject: [PATCH] Update username input screen and edit profile screen with new text The username input screen now includes a new text explaining the requirements for a username. The text is displayed below the username input field. The edit profile screen has also been updated to include the same text below the username input field. The text is displayed only if the username field is not empty. Additionally, the SizedBox widget has been replaced with a Padding widget in the username input screen for better customization. --- devtools_options.yaml | 1 + lib/views/authentication/screens/username.dart | 9 +++++++-- lib/views/profile/edit_profile/edit_profile.dart | 7 +++++++ 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 devtools_options.yaml diff --git a/devtools_options.yaml b/devtools_options.yaml new file mode 100644 index 0000000..7e7e7f6 --- /dev/null +++ b/devtools_options.yaml @@ -0,0 +1 @@ +extensions: diff --git a/lib/views/authentication/screens/username.dart b/lib/views/authentication/screens/username.dart index 7d2b73a..4c33fc6 100644 --- a/lib/views/authentication/screens/username.dart +++ b/lib/views/authentication/screens/username.dart @@ -1,6 +1,7 @@ import 'package:didvan/views/authentication/authentication_state.dart'; import 'package:didvan/views/authentication/widgets/authentication_layout.dart'; import 'package:didvan/views/widgets/didvan/button.dart'; +import 'package:didvan/views/widgets/didvan/text.dart'; import 'package:didvan/views/widgets/didvan/text_field.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; @@ -46,8 +47,12 @@ class _UsernameInputState extends State { }, ), ), - const SizedBox( - height: 20, + Padding( + padding: const EdgeInsets.all(8.0), + child: DidvanText( + 'نام کاربری می‌تواند شامل کاراکترهای کوچک و بزرگ انگلیسی و اعداد باشد.', + style: Theme.of(context).textTheme.labelSmall, + ), ), DidvanButton( title: 'ورود', diff --git a/lib/views/profile/edit_profile/edit_profile.dart b/lib/views/profile/edit_profile/edit_profile.dart index 51d2de5..fd279bd 100644 --- a/lib/views/profile/edit_profile/edit_profile.dart +++ b/lib/views/profile/edit_profile/edit_profile.dart @@ -87,6 +87,13 @@ class _EditProfileState extends State { onChanged: _onUsernameChanged, initialValue: state.user.username, ), + Padding( + padding: const EdgeInsets.all(8.0), + child: DidvanText( + 'نام کاربری می‌تواند شامل کاراکترهای کوچک و بزرگ انگلیسی و اعداد باشد.', + style: Theme.of(context).textTheme.labelSmall, + ), + ), AnimatedVisibility( duration: DesignConfig.lowAnimationDuration, isVisible: !_usernameIsAvailible,