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
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |
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
class IconSample extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return GradientIcon( | |
Icons.add_alert, | |
50.0, | |
LinearGradient( | |
colors: <Color>[ | |
Colors.red, | |
Colors.yellow, |
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
class GradientIcon extends StatelessWidget { | |
GradientIcon( | |
this.icon, | |
this.size, | |
this.gradient, | |
); | |
final IconData icon; | |
final double size; | |
final Gradient gradient; |
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
void main() { | |
String bonusItem1; | |
if (bonusItem1 == null) { | |
print('Your 1st bonus is a Powerbank'); | |
} else { | |
print('Your 1st bonus is a $bonusItem1'); | |
} | |
String bonusItem2; |
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
class Saiyan { | |
Saiyan({this.name, this.power}); | |
Saiyan.superForm(this.name) : power = 10000; | |
final String name; | |
final int power; | |
Saiyan operator +(Saiyan otherSaiyan) { | |
return Saiyan( |
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
class Saiyan { | |
Saiyan({this.name, this.power}); | |
Saiyan.superForm(this.name) : power = 10000; | |
final String name; | |
final int power; | |
Saiyan operator +(Saiyan otherSaiyan) { | |
return Saiyan( |
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
class Saiyan { | |
Saiyan({this.name, this.power}); | |
final String name; | |
final int power; | |
// Methods | |
void punch() { | |
print('$name punched'); | |
} |
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
import 'dart:math'; | |
void main() { | |
final double radius = 3.25; | |
final double areaOfCircle = pi * (radius * radius); | |
print('area of a circle with radius of 3 is $areaOfCircle'); | |
} |
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
import 'package:flutter/material.dart'; | |
final Map<String, String> suitSymbols = { | |
'd': '♦️', | |
'h': '♥️', | |
's': '♠️', | |
'c': '♣️' | |
}; | |
class Card { |
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
class Card { | |
Card(this.suit, this.rank); | |
final String suit; | |
final int rank; | |
final Map<int, String> rankNames = { | |
11: 'Jack', | |
12: 'Queen', | |
13: 'King', |
NewerOlder