Last active
March 26, 2023 09:29
-
-
Save sametaybaz/4ff66726bfe7ebfdfb607a7709565e75 to your computer and use it in GitHub Desktop.
Dart for Flutter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dart language workspace for Flutter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create sum price list with map function | |
void main() { | |
var cart = { | |
{"quantity": 6, "price": 1000}, | |
{"quantity": 2, "price": 500} | |
}; | |
int sum = 0; | |
var deneme = cart.map((e) => sum += e["quantity"]! * e["price"]!).toList(); | |
print(deneme); | |
print(sum); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for dart