Functions
ΠΠΎΡΠΎΡ Π²ΡΠ΅, ΠΊΠ°ΠΊ ΠΈ Π² Π΄ΡΡΠ³ΠΈΡ ΡΠ·ΡΠΊΠ°Ρ . ΠΡΠ°ΡΠΊΠΈΠ΅ ΠΏΡΠΈΠΌΠ΅ΡΡ:
isNoble(atomicNumber) {
return _nobleGases[atomicNumber] != null;
}
bool isNoble(int atomicNumber) => _nobleGases[atomicNumber] != null;
ΠΠΌΠ΅Π½ΠΎΠ²Π°Π½Π½ΡΠ΅ ΠΏΠ°ΡΠ°ΠΌΠ΅ΡΡΡ
// ΠΡΠΈ Π²ΡΠ·ΠΎΠ²Π΅ ΡΡΠ½ΠΊΡΠΈΠΉ, ΠΌΠΎΠΆΠ½ΠΎ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ ΠΈΠΌΠ΅Π½ΠΎΠ²Π°Π½Π½ΡΠ΅ Π°ΡΠ³ΡΠΌΠ΅Π½ΡΡ
enableFlags(bold: true, hidden: false);
/// Sets the [bold] and [hidden] flags ...
void enableFlags({bool? bold, bool? hidden}) {...}
const Scrollbar({Key? key, required Widget child})
ΠΠ΅ΠΎΠ±ΡΠ·Π°ΡΠ΅Π»ΡΠ½ΡΠ΅ ΠΏΠ°ΡΠ°ΠΌΠ΅ΡΡΡ
String say(String from, String msg, [String? device]) {
var result = '$from says $msg';
if (device != null) {
result = '$result with a $device';
}
return result;
}
ΠΠ½Π°ΡΠ΅Π½ΠΈΡ ΠΏΠΎ ΡΠΌΠΎΠ»ΡΠ°Π½ΠΈΡ
/// Sets the [bold] and [hidden] flags ...
void enableFlags({bool bold = false, bool hidden = false}) {...}
// bold will be true; hidden will be false.
enableFlags(bold: true);
ΠΠ½ΠΎΠ½ΠΈΠΌΠ½ΡΠ΅ ΡΡΠ½ΠΊΡΠΈΠΈ
const list = ['apples', 'bananas', 'oranges'];
list.forEach((item) {
print('${list.indexOf(item)}: $item');
});
list.forEach(
(item) => print('${list.indexOf(item)}: $item'));
ΠΠ°ΠΌΡΠΊΠ°Π½ΠΈΡ
Function makeAdder(int addBy) {
return (int i) => addBy + i;
}
var add2 = makeAdder(2);
var add4 = makeAdder(4);
assert(add2(3) == 5);
assert(add4(3) == 7);
Last updated