ရိုးရိုးလေး ရှင်းပြမယ်
Hello World App ကို ရိုးရိုးလေးနားလည်မယ်
Hello World app က Flutter project တစ်ခုရဲ့ အခြေခံ skeleton ကိုမြင်ရတဲ့နေရာပါ။ main(), runApp(), StatelessWidget, build(), MaterialApp, Scaffold, Center, Text — ဒီအပိုင်းတွေကိုနားလည်ရင် Flutter page တစ်ခုရဲ့အရိုးစုကိုဖတ်တတ်လာပါပြီ။
Problem → Why → Solution
ပြဿနာ — ဘာကြောင့် ဒီ concept လိုတာလဲ
build() method ထဲမှာ widget return မပြန်ပေးရင် app render မဖြစ်ပါ။ Dart analyzer က error ပြပါလိမ့်မယ်။
ဖြစ်လေ့ရှိတဲ့အမှား
Screen တစ်မျိုးတွင် sample output မှန်ရုံဖြင့် rebuild, overflow, accessibility, async နဲ့ lifecycle paths အားလုံးမှန်ပြီဟုယူဆခြင်း။
Core Concept — အလုပ်လုပ်ပုံကိုနားလည်မယ်
Hello World App ကို Flutter 3.47, Dart 3.13, declarative UI, sound null safety နဲ့ cross-platform lifecycle ဆက်နွယ်မှုနဲ့နားလည်ပါ။ flutter analyze နဲ့ DevTools feedback ကို design signal အဖြစ်ယူပါ။
- Input + state
- Widget build + layout
- Rendered Flutter UI
Hello World App ရဲ့ widget, state နဲ့ lifecycle behavior ကိုရှင်းပြနိုင်ရန်
အဓိက Syntax / Pattern
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: Scaffold(
body: Center(
child: Text('Hello, World!'),
),
),
);
}
}Hello World App ကို Flutter 3.47, Dart 3.13, declarative UI, sound null safety နဲ့ cross-platform lifecycle ဆက်နွယ်မှုနဲ့နားလည်ပါ။ flutter analyze နဲ့ DevTools feedback ကို design signal အဖြစ်ယူပါ။
Code ကို အဆင့်လိုက်ဖတ်မယ်
- Input + state
import 'package:flutter/material.dart';Hello World app က Flutter project တစ်ခုရဲ့ အခြေခံ skeleton ကိုမြင်ရတဲ့နေရာပါ။ main(), runApp(), StatelessWidget, build(), MaterialApp, Scaffold, Center, Text — ဒီအပိုင်းတွေကိုနားလည်ရင် Flutter page တစ်ခုရဲ့အရိုးစုကိုဖတ်တတ်လာပါပြီ။
- Widget build + layout
home: Scaffold(Hello World App ကို Flutter 3.47, Dart 3.13, declarative UI, sound null safety နဲ့ cross-platform lifecycle ဆက်နွယ်မှုနဲ့နားလည်ပါ။ flutter analyze နဲ့ DevTools feedback ကို design signal အဖြစ်ယူပါ။
- Rendered Flutter UI
}Hello World App example ကို small/large screen, text scaling, empty/loading/error, rapid interaction, navigation restore နဲ့ disposal cases ဖြင့် run/test လုပ်ပါ။ flutter analyze, widget tests နဲ့ profile mode ကိုလိုအပ်သလိုသုံးပါ။
- Input + state
- Widget build + layout
- Rendered Flutter UI
Success
Hello World App ရဲ့ widget, state နဲ့ lifecycle behavior ကိုရှင်းပြနိုင်ရန်
Failure
build() method ထဲမှာ widget return မပြန်ပေးရင် app render မဖြစ်ပါ။ Dart analyzer က error ပြပါလိမ့်မယ်။
Hello World app က Flutter project တစ်ခုရဲ့ အခြေခံ skeleton ကိုမြင်ရတဲ့နေရာပါ။ main(), runApp(), StatelessWidget, build(), MaterialApp, Scaffold, Center, Text — ဒီအပိုင်းတွေကိုနားလည်ရင် Flutter page တစ်ခုရဲ့အရိုးစုကိုဖတ်တတ်လာပါပြီ။
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: Scaffold(
body: Center(
child: Text('Hello, World!'),
),
),
);
}
}Emulator သို့မဟုတ် browser preview မှာ Hello, World! စာသားကို screen အလယ်မှာမြင်ရပါမယ်။နောက်တစ်ဆင့်
နောက် lesson မှာ Flutter ရဲ့ အသက်ဖြစ်တဲ့ Widget concept ကိုသေချာဖောက်ကြည့်ပါ။
Real-world usage
လက်တွေ့ Project မှာ ဘယ်လိုသုံးမလဲ
Hello World App example ကို small/large screen, text scaling, empty/loading/error, rapid interaction, navigation restore နဲ့ disposal cases ဖြင့် run/test လုပ်ပါ။ flutter analyze, widget tests နဲ့ profile mode ကိုလိုအပ်သလိုသုံးပါ။
Mini challenge
ကိုယ်တိုင်တည်ဆောက်ကြည့်ပါ
Hello World App example ကို small/large screen, text scaling, empty/loading/error, rapid interaction, navigation restore နဲ့ disposal cases ဖြင့် run/test လုပ်ပါ။ flutter analyze, widget tests နဲ့ profile mode ကိုလိုအပ်သလိုသုံးပါ။
- Example ကို copy မလုပ်ဘဲ ပြန်ရေးပါ
- Normal input နဲ့ edge case စမ်းပါ
- Run မလုပ်မီ compiler/output result ကိုခန့်မှန်းပါ
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: Scaffold(
body: Center(
child: Text('Hello, World!'),
),
),
);
}
}ရလဒ်: Hello World App ရဲ့ widget, state နဲ့ lifecycle behavior ကိုရှင်းပြနိုင်ရန်
အရိပ်အမြွက် ကြည့်ရန်
Hello World App example ကို small/large screen, text scaling, empty/loading/error, rapid interaction, navigation restore နဲ့ disposal cases ဖြင့် run/test လုပ်ပါ။ flutter analyze, widget tests နဲ့ profile mode ကိုလိုအပ်သလိုသုံးပါ။
Quick Quiz 1 / 3
Quick Quiz 2 / 3
Quick Quiz 3 / 3
ဒီသင်ခန်းစာမှာ မှတ်ထားရမယ့်အချက်များ
- Input + state → Widget build + layout → Rendered Flutter UI
- Hello World App ကို Flutter 3.47, Dart 3.13, declarative UI, sound null safety နဲ့ cross-platform lifecycle ဆက်နွယ်မှုနဲ့နားလည်ပါ။ flutter analyze နဲ့ DevTools feedback ကို design signal အဖြစ်ယူပါ။
- build() method ထဲမှာ widget return မပြန်ပေးရင် app render မဖြစ်ပါ။ Dart analyzer က error ပြပါလိမ့်မယ်။
- Hello World App example ကို small/large screen, text scaling, empty/loading/error, rapid interaction, navigation restore နဲ့ disposal cases ဖြင့် run/test လုပ်ပါ။ flutter analyze, widget tests နဲ့ profile mode ကိုလိုအပ်သလိုသုံးပါ။
Flutter stable release notes — Flutter