This file contains 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'; | |
const Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override |
This file contains 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 Human { | |
final String name; | |
Human(this.name); | |
void sayHello() { | |
print("Hi my name is $name"); | |
} | |
} | |
enum Team { blue, red } |
This file contains 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
abstract class Human{ | |
void walk(); | |
} | |
class Player extends Human{ | |
String name; | |
int xp; | |
String team; | |
void walk(){ |
This file contains 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 Player { | |
final String name; | |
int xp; | |
String team; | |
Player.fromJson(Map<String, dynamic> playerJson) : | |
name = playerJson['name'], | |
xp = playerJson['xp'], | |
team = playerJson['team']; | |
This file contains 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 Player { | |
final String name; | |
int xp, age; | |
String team; | |
Player({ | |
required this.name, | |
required this.xp, | |
required this.age, | |
required this.team, |