Forms, Validation & Focus မှာ source of truth, validation, focus, controller disposal နဲ့ minimal rebuild boundary ကိုရှင်းပါ။ Ephemeral state ကို local ထားပြီး shared app state ကို testable controller/model တစ်ခုကပိုင်ဆိုင်စေပါ။
ပိုပြီးနားလည်ထားရမယ့် အချက်
Forms, Validation & Focus မှာ source of truth, validation, focus, controller disposal နဲ့ minimal rebuild boundary ကိုရှင်းပါ။ Ephemeral state ကို local ထားပြီး shared app state ကို testable controller/model တစ်ခုကပိုင်ဆိုင်စေပါ။
လက်တွေ့မှာ ဘယ်လိုအသုံးချမလဲ
Forms, Validation & Focus example ကို small/large screen, text scaling, empty/loading/error, rapid interaction, navigation restore နဲ့ disposal cases ဖြင့် run/test လုပ်ပါ။ flutter analyze, widget tests နဲ့ profile mode ကိုလိုအပ်သလိုသုံးပါ။
ဒီသင်ခန်းစာပြီးရင်
final formKey = GlobalKey<FormState>();
Form(
key: formKey,
child: Column(children: [
TextFormField(
decoration: const InputDecoration(labelText: 'Email'),
validator: (value) => (value?.contains('@') ?? false) ? null : 'Enter a valid email',
),
FilledButton(
onPressed: () => formKey.currentState!.validate(),
child: const Text('Submit'),
),
]),
)Invalid input ဖြစ်လျှင် inline validation message ပေါ်မည်ကိုယ်တိုင်စမ်းကြည့်ရန်
Forms, Validation & Focus example ကို small/large screen, text scaling, empty/loading/error, rapid interaction, navigation restore နဲ့ disposal cases ဖြင့် run/test လုပ်ပါ။ flutter analyze, widget tests နဲ့ profile mode ကိုလိုအပ်သလိုသုံးပါ။
Lifecycle/Performance သတိပေးချက်
Screen တစ်မျိုးတွင် sample output မှန်ရုံဖြင့် rebuild, overflow, accessibility, async နဲ့ lifecycle paths အားလုံးမှန်ပြီဟုယူဆခြင်း။
Flutter documentation — Flutter