Skip to content

Instantly share code, notes, and snippets.

View olaide-ekolere's full-sized avatar

Olaide Nojeem Ekeolere olaide-ekolere

View GitHub Profile
@olaide-ekolere
olaide-ekolere / main.dart
Created November 28, 2020 09:31
Widgets continued - Introduction to Flutter
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
@olaide-ekolere
olaide-ekolere / main.dart
Last active November 27, 2020 20:36
Navigation -Introduction to flutter
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
@olaide-ekolere
olaide-ekolere / main.dart
Created November 27, 2020 16:54
Widgets - introduction to flutter
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
@olaide-ekolere
olaide-ekolere / main.dart
Last active November 28, 2020 08:56
Inheritance (Mixin) - Introduction to Dart
import "package:flutter/material.dart";
void main() {
//new instance of class
MyNewClass myNewClass = new MyNewClass();
var anotherInstance = new MyNewClass();
print(myNewClass.runtimeType);
anotherInstance.sayHello();
Shape rectangle1 = new Rectangle(20, 30);
@olaide-ekolere
olaide-ekolere / main.dart
Last active November 28, 2020 09:05
Inheritance (Abstract Class & Getters/Setters) - Object Oriented programming
import "package:flutter/material.dart";
void main() {
//new instance of class
MyNewClass myNewClass = new MyNewClass();
var anotherInstance = new MyNewClass();
print(myNewClass.runtimeType);
anotherInstance.sayHello();
Shape rectangle1 = new Rectangle(20, 30);
@olaide-ekolere
olaide-ekolere / main.dart
Last active November 27, 2020 12:33
Inheritance 1 - Object Oriented programming
import "package:flutter/material.dart";
void main() {
//new instance of class
MyNewClass myNewClass = new MyNewClass();
var anotherInstance = new MyNewClass();
print(myNewClass.runtimeType);
anotherInstance.sayHello();
Shape rectangle1 = new Rectangle(20, 30);
@olaide-ekolere
olaide-ekolere / main.dart
Last active November 28, 2020 08:40
Classes - Object oriented programming
void main() {
//new instance of class
MyNewClass myNewClass = new MyNewClass();
var anotherInstance = new MyNewClass();
print(myNewClass.runtimeType);
anotherInstance.sayHello();
Rectangle rectangle1 = new Rectangle(20, 30);
print(rectangle1.runtimeType);
print(rectangle1.perimeter());
@olaide-ekolere
olaide-ekolere / main.dart
Last active November 28, 2020 08:35
List, Enums & Control Statements - Introduction to dart
void main() {
int score1 = 36;
int score2 = 85;
int score3 = 66;
int score4 = 73;
int total = score1 + score2 + score3 + score4;
var average = total / 4;
print("the average score is: $average");
//control statement
@olaide-ekolere
olaide-ekolere / main.dart
Created November 25, 2020 12:12
Functions - Introduction to Dart
import 'package:flutter/material.dart';
//Variables
const double pi = 3.14;
void main() {
showPerimeter();//calling method with no parameters
showPerimeterWithRadius(80);//calling method with parameter
double result = perimeter();
@olaide-ekolere
olaide-ekolere / main.dart
Last active November 25, 2020 08:33
Variables - Introduction to Dart
//This is a single line comment
/*
* This is a multiline comment
* and can span more than one
* line
*/
//Variables