من صفحة طريقة تسجيل الدخول، فعِّل تسجيل الدخول عبر البريد الإلكتروني/كلمة المرور
وانقر على حفظ.
إنشاء حساب مستنِد إلى كلمة المرور
لإنشاء حساب مستخدم جديد باستخدام كلمة مرور، يمكنك الاتصال بالرقم createUserWithEmailAndPassword().
:
try{finalcredential=awaitFirebaseAuth.instance.createUserWithEmailAndPassword(email:emailAddress,password:password,);}onFirebaseAuthExceptioncatch(e){if(e.code=='weak-password'){print('The password provided is too weak.');}elseif(e.code=='email-already-in-use'){print('The account already exists for that email.');}}catch(e){print(e);}
يمكنك القيام بذلك عادةً من شاشة الاشتراك في تطبيقك. عندما يختار مستخدم جديد
الاشتراك باستخدام نموذج الاشتراك في تطبيقك، وإكمال أي عملية إثبات ملكية جديدة للحساب
الخطوات التي يتطلبها تطبيقك، مثل التحقّق من أنّ كلمة مرور الحساب الجديد
مكتوب بشكل صحيح ويفي بمتطلبات التعقيد.
في حال إنشاء الحساب الجديد بنجاح، يكون المستخدم مسجّلاً الدخول أيضًا. إذا كنت
يستمعون إلى تغييرات في حالة المصادقة، وهي
سيتم إرسال الحدث إلى مستمعيك.
تسجيل دخول مستخدم باستخدام عنوان بريد إلكتروني وكلمة مرور
تتشابه خطوات تسجيل دخول المستخدم باستخدام كلمة مرور مع خطوات
إنشاء حساب جديد. من شاشة تسجيل الدخول في تطبيقك، اتصل
signInWithEmailAndPassword():
try{finalcredential=awaitFirebaseAuth.instance.signInWithEmailAndPassword(email:emailAddress,password:password);}onFirebaseAuthExceptioncatch(e){if(e.code=='user-not-found'){print('No user found for that email.');}elseif(e.code=='wrong-password'){print('Wrong password provided for that user.');}}
الخطوات التالية
بعد أن ينشئ المستخدم حسابًا جديدًا، يتم تخزين هذا الحساب كجزء من حسابك
ويمكن استخدامه لتحديد هوية مستخدم على مستوى كل تطبيق في
المشروع، بغض النظر عن طريقة تسجيل الدخول التي استخدمها المستخدم.
في تطبيقاتك، يمكنك الحصول على معلومات الملف الشخصي الأساسية للمستخدم من
عنصر User. راجع إدارة المستخدمين.
في "قاعدة بيانات Firebase في الوقت الفعلي" و"قواعد أمان Cloud Storage"، يمكنك
الحصول على رقم تعريف المستخدِم الفريد الخاص بالمستخدم الذي سجّل الدخول من المتغيّر auth واستخدامه من أجل
للتحكم في البيانات التي يمكن للمستخدم الوصول إليها.
يمكنك السماح للمستخدمين بتسجيل الدخول إلى تطبيقك باستخدام طرق مصادقة متعددة.
موفِّري خدمة المصادقة من خلال ربط بيانات اعتماد موفِّر المصادقة)
حساب مستخدم حالي.
لتسجيل خروج مستخدم، يُرجى الاتصال بالرقم signOut():
تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Authenticate with Firebase using Password-Based Accounts on Flutter\n\n\u003cbr /\u003e\n\nYou can use Firebase Authentication to let your users authenticate with\nFirebase using email addresses and passwords.\n\nBefore you begin\n----------------\n\n1. If you haven't already, follow the steps in the [Get started](/docs/auth/flutter/start) guide.\n\n2. Enable Email/Password sign-in:\n\n - In the Firebase console's **Authentication** section, open the [Sign in method](https://console.firebase.google.com/project/_/authentication/providers) page.\n - From the **Sign in method** page, enable the **Email/password sign-in** method and click **Save**.\n\nCreate a password-based account\n-------------------------------\n\nTo create a new user account with a password, call the `createUserWithEmailAndPassword()`\nmethod: \n\n try {\n final credential = await FirebaseAuth.instance.createUserWithEmailAndPassword(\n email: emailAddress,\n password: password,\n );\n } on FirebaseAuthException catch (e) {\n if (e.code == 'weak-password') {\n print('The password provided is too weak.');\n } else if (e.code == 'email-already-in-use') {\n print('The account already exists for that email.');\n }\n } catch (e) {\n print(e);\n }\n\nTypically, you would do this from your app's sign-up screen. When a new user\nsigns up using your app's sign-up form, complete any new account validation\nsteps that your app requires, such as verifying that the new account's password\nwas correctly typed and meets your complexity requirements.\n\nIf the new account was created successfully, the user is also signed in. If you\nare listening to changes in [authentication state](/docs/auth/flutter/start#auth-state), a new\nevent will be sent to your listeners.\n\nAs a follow-up to creating a new account, you can\n[Verify the user's email address](/docs/auth/flutter/manage-users#verify-email).\n| **Note:** To protect your project from abuse, Firebase limits the number of new email/password and anonymous sign-ups that your application can have from the same IP address in a short period of time. You can request and schedule temporary changes to this quota from the [Firebase console](https://console.firebase.google.com/project/_/authentication/providers).\n\nSign in a user with an email address and password\n-------------------------------------------------\n\nThe steps for signing in a user with a password are similar to the steps for\ncreating a new account. From your your app's sign-in screen, call\n`signInWithEmailAndPassword()`: \n\n try {\n final credential = await FirebaseAuth.instance.signInWithEmailAndPassword(\n email: emailAddress,\n password: password\n );\n } on FirebaseAuthException catch (e) {\n if (e.code == 'user-not-found') {\n print('No user found for that email.');\n } else if (e.code == 'wrong-password') {\n print('Wrong password provided for that user.');\n }\n }\n\n| **Caution:** When a user uninstalls your app on iOS or macOS, the user's authentication state can persist between app re-installs, as the Firebase iOS SDK persists authentication state to the system keychain. See issue [#4661](https://github.com/firebase/flutterfire/issues/4661) for more information.\n\nNext steps\n----------\n\nAfter a user creates a new account, this account is stored as part of your\nFirebase project, and can be used to identify a user across every app in your\nproject, regardless of what sign-in method the user used.\n\nIn your apps, you can get the user's basic profile information from the\n`User` object. See [Manage Users](/docs/auth/flutter/manage-users).\n\nIn your Firebase Realtime Database and Cloud Storage Security Rules, you can\nget the signed-in user's unique user ID from the `auth` variable, and use it to\ncontrol what data a user can access.\n\nYou can allow users to sign in to your app using multiple authentication\nproviders by [linking auth provider credentials](/docs/auth/flutter/account-linking)) to an\nexisting user account.\n\nTo sign out a user, call `signOut()`: \n\n await FirebaseAuth.instance.signOut();"]]