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 Spacecraft{ | |
String name; | |
bool available; | |
Spacecraft(this.name,this.available); | |
String get getFullName => "The spacraft name is "+name; | |
} | |
class Astronaut{ |
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 Spacecraft{ | |
String name; | |
bool available; | |
List<Astronaut> astronauts; | |
} | |
class Astronaut{ | |
String name; | |
} |
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 Astronaut{ | |
bool isAlive () => true; | |
} | |
main(){ | |
Astronaut astronaut = Astronaut(); | |
print(astronaut.isAlive()); // true | |
} |
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
main(){ | |
String name; | |
name ??= "benznest"; | |
print(name); // "benznest" | |
} |
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 Spacecraft{ | |
Astronaut astronaut; | |
} | |
class Astronaut{ | |
String name; | |
} | |
main(){ | |
Spacecraft sc = Spacecraft (); |
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
main(){ | |
String name; | |
print(name ?? "benznest"); // benznest | |
} | |
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
main(){ | |
List<int> list = [1,2,3,4]; | |
String str = list.isNotEmpty ? "available" : "none"; | |
print(str); | |
} |
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 Person{ | |
String name; | |
} | |
main(){ | |
Person person = Person(); | |
person.name = "benznest"; | |
int money = 100; | |
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:ui'; | |
class Animal { | |
int id; | |
String name; | |
Color background; | |
Color textColor; | |
Animal({this.id, this.name, this.background, this.textColor}); | |
} |
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'; | |
import 'package:flutter_hello/my_inherited_widget_data.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', |