Map သည် key-value pairs သိမ်းရန်သုံးပါတယ်။ User profile, product data, API response, settings data တွေကို model မလုပ်ခင် အခြေခံနားလည်ဖို့အရေးကြီးပါတယ်။
dart
void main() {
Map<String, dynamic> user = {
'name': 'Sai',
'role': 'Developer',
'points': 120,
'isActive': true,
};
print(user['name']);
print(user['points']);
user['points'] = 150;
print('Updated points: ${user['points']}');
}String key နဲ့ value ကိုသိမ်းထားတာပါ။ dynamic သုံးထားလို့ value က String, int, bool စသဖြင့် မတူနိုင်ပါတယ်။ User data တွေမှာ field type မတူတာများတဲ့အတွက် ဒီပုံစံကိုတွေ့ရတတ်ပါတယ်။
You should see
Sai 120 Updated points: 150