Skip to content

Instantly share code, notes, and snippets.

View angwandi's full-sized avatar
😀
Student

Innocent Dema angwandi

😀
Student
View GitHub Profile
@angwandi
angwandi / Dart Polymorphism
Created February 8, 2020 11:38
polymorphism : different forms
void main(){
Car normal = Car();
print(normal.numberOfSeat);
normal.drive();
ElectricCar myTesla = ElectricCar();
myTesla.drive();
myTesla.recharge();
LevitatingCar glide = LevitatingCar();
@angwandi
angwandi / Dart Inheritance
Created February 8, 2020 11:26
inheriting in Dart
void main(){
Car normal = Car();
print(normal.numberOfSeat);
normal.drive();
ElectricCar myTesla = ElectricCar();
myTesla.drive();
myTesla.recharge();
}
@angwandi
angwandi / Dart class
Last active February 8, 2020 12:08
class and object in Dart
void main(){
//dema is the actual objet
Human dema = Human(height:15,age:12);
print(dema.height);
dema.talk('Why is the sky blue??');
Human innocent = Human(height: 1.6,age:30);
print(innocent.height);
}
@angwandi
angwandi / LoveCalculator
Last active February 8, 2020 09:41
Dart if statement
import 'dart:math';
void main(){
loveCalculator();
}
void loveCalculator(){
int loveScore = Random().nextInt(100) + 1;
print(loveScore);
// if and if
if (loveScore > 70){
@angwandi
angwandi / dartList
Last active February 8, 2020 08:55
Learning List in Dart
void main(){
//craete a list of String
List<String> myList=[
'Innocent',
'Dema'
];
// manupilate the list
// print(myList);