Operators တွေက calculation, comparison, logical decision တွေပြုလုပ်ဖို့သုံးတဲ့ symbols တွေပါ။ App logic အများစုက operator တွေကိုသုံးပြီး “ဘာလုပ်ရမလဲ” ဆုံးဖြတ်ပါတယ်။
dart
void main() {
int price = 12000;
int discount = 2000;
int finalPrice = price - discount;
bool hasEnoughMoney = finalPrice <= 10000;
bool isMember = true;
print('Final price: $finalPrice');
if (hasEnoughMoney && isMember) {
print('You can buy this item with member benefit.');
}
print(7 % 2); // Remainder
}- က discount နှုတ်တာ၊ <= က condition စစ်တာ၊ && က condition နှစ်ခုလုံးမှန်မှ true ဖြစ်တာပါ။ % က remainder ထုတ်ပေးလို့ even/odd စစ်ရာမှာအသုံးများပါတယ်။
You should see
Final price: 10000 You can buy this item with member benefit. 1