2. Timeline
2012 2014 2016 2018 2020
February to
March
Intro to u er
and da
App project
Self Practice
Assignment 2
Flu er app with
rebase
Self Practice
Assignment 4
Self Practice
Assignment 1
Building an app
with u er
Intro to rebase
Self Practice
Assignment 3
5 sessions
4. Flutter
About
Flutter is an app development framework that uses the language
Dart developed by Google engineers to support cross-platform
development.
Flutter has a clean look due to the material design library added in
by default and its simple widgets. A widget is a basic UI or structural
component e.g. text, text style, button, row, column, etc.
5. Why Flutter ??
Benefits
The major reason why Flutter appeals to
developers is the fact that from a single
code base one can create apps for
multiple platforms example android, ios,
web, and desktop too.
6. So is it worth learning a
new programming
language called Dart?
7. Dart
About
The Dart programming language is really
simple to learn and has a lot in common
with java, javascript, and python. Google
also provides the best documentation
which contains tutorials, articles, and
more.
8. • Basic intro to Flutter and Dart ✔
• Learning Dart syntax (https://www.dartpad.dev/?)
• Setting up Android studio for flutter
• Practice Assignment 1 for this First week (ask doubts on the group)
• Learning resources for First week
Session details
For today
9. // Printing Hello World
void main() {
print(“Hello World”);
}
// Printing variables and expressions
void main() {
var age = 19, deci = 10.5, name = “Anish”;
print(age);
print(deci);
print(name);
print(true);
print(“My name is $name, I am $age years old”);
}
// Printing expressions and loops
void main() {
for(int i = 0; i < 5; i++) {
print(“count = ${i+1}”);
}
}
Console
Hello World
Console
19
10.5
Anish
true
My name is Anish, I am 19 years old
Console
count = 1
count = 2
count = 3
count = 4
count = 5
10. // using static data types
void main() {
int age = 19;
float deci = 10.5;
String name = ‘Anish’;
print(age);
print(deci);
print(name);
}
// Printing variables and expressions
void main() {
dynamic n = 10;
print(n);
n = ‘Anish’;
print(n);
n = 10.56;
print(n);
}
// dynamic is not preferred as we get more
//benefits from static variables
Console
19
10.5
Anish
Console
10
Anish
10.56
11. void main() {
int a = 10, b = 20;
print(addition(a, b));
print(sum(a, b));
}
// normal function
int addition(int a, int b) {
return a + b;
}
// single statement function notation
int sum(int a, int b) => a + b;
void main() {
List l = [7, 'up', 'dream', 11];
print(l);
List<int> k = [1, 2, 3]; // int only list
print(k);
l.add('a');
k.add(4); // can only add integers
print("$l, $k");
}
Console
30
30
Console
[7, up, dream, 11]
[1, 2, 3]
[7, up, dream, 11, a], [1, 2, 3,4]
12. // loops
for (final object in flybyObjects) {
print(object);
}
for (int month = 1; month <= 12;
month++) {
print(month);
}
while (year < 2016) {
year += 1;
}
// if-else & ternary
if (year >= 2001) {
print('21st century');
} else if (year >= 1901) {
print('20th century');
}
// ternary statement
(year >= 2001) ? print("21st century") :
print("20th century!");
13. Console
Anish
Zoro
user logged in
user logged in
void main() {
User userone = User('Anish', 19);
print(userone.username);
User userone = User('Zoro', 21);
print(userone.username);
userone.login();
usertwo.login();
}
class User {
String username = ‘’;
int age = 0;
User (sum(a, b)) {
this.username = username;
this.age = age;
}
void login() {
print('user logged in');
}
}
14. // null safety
// In null-safe Dart, none of these can
//ever be null.
var i = 42; // Inferred to be an int.
String name = getFileName();
final b = Foo();
int? aNullableInt = null;
_jellyCounts = List<int?>(jellyMax + 1);
// handling execptions
try {
for (final object in flybyObjects) {
var description = await
File('$object.txt').readAsString();
print(description);
}
} on IOException catch (e) {
print('Could not describe object: $e');
} finally {
flybyObjects.clear();
}
15. UI & Widgets
About
Flutter uses widgets to build the UI of the
application and your whole application is a
tree of widgets. Widgets are simple UI
elements like a TextBox or AppBar. The
widgets have properties which enable us to
customize them further. Widgets can contain
Widgets inside it using the child property.
21. Android studio is the Official IDE for
making Android apps. It even has
emulators for virtually testing your
application on virtual smart phone.
When used with the Flutter SDK we
can use it to build and run Flutter
apps as well. The Flutter SDK has to
be downloaded separately from
their website along with git which is
a popular version control system.
(https://docs.flutter.dev/get-started/
install)
Android Studio?
About