void main() { int n="hello"; print(n); }
main() { print("Hello World!"); }
void main() { var deck = new Deck(); deck.removeCard('Diamonds', 'Ace'); print(deck); } class Deck { List<Card> cards = []; Deck() { var ranks = ['Ace', 'Two', 'Three', 'Four', 'Five']; var suits = ['Diamonds', 'Hearts', 'Clubs', 'Spades']; for (var suit in suits) { for (var rank in ranks) { var card = new Card(rank, suit); cards.add(card); } } } toString() { return cards.toString(); } shuffle() { cards.shuffle(); } cardsWithSuit(String suit) { return cards.where((card) => card.suit == suit); } deal(int handSize) { var hand = cards.sublist(0, handSize); cards = cards.sublist(handSize); return hand; } removeCard(String suit, String rank) { cards.removeWhere((card) => (card.suit == suit) && (card.rank == rank)); } } class Card { String suit; String rank; Card(this.rank, this.suit); toString() { return '$rank of $suit'; } }
import 'dart:async'; void main() { print("Program started"); int elapsedTime = 0; Timer tmr = Timer(new Duration(seconds: 1), () { print('elapsedTime: $elapsedTime'); elapsedTime += 1; }); //if (elapsedTime <= 15) { //tmr.run(); // } while(tmr.isActive && elapsedTime == 0); print("Program Ended"); }
void main() { final val1 = 12; print(val1); }
void main() { print('hello world'); }
class TestClass { void disp() { print("My first dart code"); } } void main() { TestClass c = new TestClass(); c.disp(); }
import 'dart:isolate'; void foo(var message){ print('execution from foo ... the message is :${message}'); } void main(){ Isolate.spawn(foo,'Greetings!!'); Isolate.spawn(foo,'Welcome!!'); Isolate.spawn(foo,'Hello!!'); for(var i=0; i<3;i++) {print('aaaaaaaaaaaaaaaaaaa');} print('execution from main3'); print('execution from main1'); print('execution from main2'); }
/* Simple Hello, World! program */ void main(){ print("Hello, World!"); }
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more