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.
This commit is contained in:
MohammadTaha Basiri 2024-04-01 16:23:57 +03:30
parent a521759347
commit e606555234
3 changed files with 15 additions and 2 deletions

1
devtools_options.yaml Normal file
View File

@ -0,0 +1 @@
extensions:

View File

@ -1,6 +1,7 @@
import 'package:didvan/views/authentication/authentication_state.dart'; import 'package:didvan/views/authentication/authentication_state.dart';
import 'package:didvan/views/authentication/widgets/authentication_layout.dart'; import 'package:didvan/views/authentication/widgets/authentication_layout.dart';
import 'package:didvan/views/widgets/didvan/button.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:didvan/views/widgets/didvan/text_field.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -46,8 +47,12 @@ class _UsernameInputState extends State<UsernameInput> {
}, },
), ),
), ),
const SizedBox( Padding(
height: 20, padding: const EdgeInsets.all(8.0),
child: DidvanText(
'نام کاربری می‌تواند شامل کاراکترهای کوچک و بزرگ انگلیسی و اعداد باشد.',
style: Theme.of(context).textTheme.labelSmall,
),
), ),
DidvanButton( DidvanButton(
title: 'ورود', title: 'ورود',

View File

@ -87,6 +87,13 @@ class _EditProfileState extends State<EditProfile> {
onChanged: _onUsernameChanged, onChanged: _onUsernameChanged,
initialValue: state.user.username, initialValue: state.user.username,
), ),
Padding(
padding: const EdgeInsets.all(8.0),
child: DidvanText(
'نام کاربری می‌تواند شامل کاراکترهای کوچک و بزرگ انگلیسی و اعداد باشد.',
style: Theme.of(context).textTheme.labelSmall,
),
),
AnimatedVisibility( AnimatedVisibility(
duration: DesignConfig.lowAnimationDuration, duration: DesignConfig.lowAnimationDuration,
isVisible: !_usernameIsAvailible, isVisible: !_usernameIsAvailible,