0Pricing
Flutter Mobile Development · درس

التركيز ولوحة المفاتيح وتجربة إدخال البيانات

حسّن نماذج Flutter لديك بإدارة التركيز وأنواع لوحة المفاتيح وإجراءات الإدخال وإمكانية الوصول لتجربة كتابة سلسة.

التركيز ولوحة المفاتيح وتجربة إدخال البيانات درس مجاني في Flutter Mobile Development على CoddyKit. هذا هو الدرس 4 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Flutter Mobile Development، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Flutter Mobile Development 4 دروس في المجموع.

بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.

Why Input UX Matters

A working form is not enough — users expect the keyboard, focus order and actions to feel effortless. This lesson covers the polish that makes forms delightful.

FocusNode Basics

A FocusNode represents the focus state of a field. Create one per field you want to control.

final emailFocus = FocusNode();
final passwordFocus = FocusNode();

Attaching Focus

Pass the node to a TextField via the focusNode property.

TextField(
  focusNode: emailFocus,
  decoration: const InputDecoration(labelText: 'Email'),
);

Moving Focus Programmatically

Request focus on the next field when the user submits the current one.

TextField(
  focusNode: emailFocus,
  onSubmitted: (_) => FocusScope.of(context).requestFocus(passwordFocus),
);

Keyboard Types

Pick the right keyboardType so the keyboard matches the field.

  • TextInputType.emailAddress
  • TextInputType.number
  • TextInputType.phone
TextField(
  keyboardType: TextInputType.emailAddress,
);

Input Actions

The textInputAction controls the keyboard's action button — Next, Done, Search and more.

TextField(
  textInputAction: TextInputAction.next,
);

Obscuring & Toggling Passwords

Use obscureText for passwords, and a suffix icon to toggle visibility.

TextField(
  obscureText: hidden,
  decoration: InputDecoration(
    suffixIcon: IconButton(
      icon: Icon(hidden ? Icons.visibility : Icons.visibility_off),
      onPressed: () => setState(() => hidden = !hidden),
    ),
  ),
);

Input Formatters

inputFormatters restrict or transform input — for example digits only.

TextField(
  inputFormatters: [FilteringTextInputFormatter.digitsOnly],
);

Dismissing the Keyboard

Unfocus to dismiss the keyboard when the user taps elsewhere.

GestureDetector(
  onTap: () => FocusScope.of(context).unfocus(),
  child: const FormBody(),
);

Avoiding the Keyboard Overlap

Wrap your form in a scrollable so fields are not hidden behind the keyboard. A SingleChildScrollView handles this automatically.

SingleChildScrollView(
  padding: const EdgeInsets.all(16),
  child: Column(children: fields),
);

Disposing Focus Nodes

FocusNodes are resources — dispose them to avoid leaks.

@override
void dispose() {
  emailFocus.dispose();
  passwordFocus.dispose();
  super.dispose();
}

Quick Check

Which property sets the keyboard's bottom-right button to say Next?

Recap

You polished input UX:

  • FocusNode and moving focus on submit
  • keyboardType and textInputAction
  • Password toggles and input formatters
  • Dismissing the keyboard and avoiding overlap

These details turn a functional form into a great one.

الأسئلة الشائعة

هل درس «التركيز ولوحة المفاتيح وتجربة إدخال البيانات» مجاني؟

نعم — نص درس «التركيز ولوحة المفاتيح وتجربة إدخال البيانات» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Flutter Mobile Development، انتقل إلى CoddyKit PRO. تتضمن دورة Flutter Mobile Development 4 دروس في المجموع.

ماذا ستتعلم في «التركيز ولوحة المفاتيح وتجربة إدخال البيانات»؟

حسّن نماذج Flutter لديك بإدارة التركيز وأنواع لوحة المفاتيح وإجراءات الإدخال وإمكانية الوصول لتجربة كتابة سلسة. تتمرن على Flutter Mobile Development مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ Flutter Mobile Development؟

لا تُشترط خبرة سابقة. Flutter Mobile Development على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 4 من أصل 4.

كم من الوقت يستغرق درس «التركيز ولوحة المفاتيح وتجربة إدخال البيانات»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس Flutter Mobile Development هذا؟

نعم. كل درس في Flutter Mobile Development يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. عنصر Form ووحدات التحكم
  2. تقنيات التحقق من صحة الإدخال
  3. حقول النماذج المخصّصة
  4. التركيز ولوحة المفاتيح وتجربة إدخال البيانات
← العودة إلى Flutter Mobile Development