Flutter Course (Beginner)
Flutter Course (Beginner)
(Beginner)
TTKS
Flutter applications for Mobile Phones
Mobile(iOS, Android)
TTKS
Course Outline
TTKS
Introduction to Dart
(Day1)
Introduction
Online IDE -> https://dartpad.dev/
Variable
Keyword var - Information/data သိမ်းဆည်းေပးတဲ ့
ေနရာ
type variableName;
var variable=value;
Data Types(runtimeType)
expr1 ?? expr2
condition ? expr1 : expr 2
If condition is true, return the expr1 value. If not return expr2 value.
expr1 ?? expr2
=> brushTeeth()
1. For Loop
2. For in Loop
3. While Loop
LOOP
For Loop
01
LOOP
for in loop
02
LOOP
While loop
03
Decision Making
If - else
01
Decision Making
switch-case
02
Introduction to Dart
(Day4)
Collection
No Array
Collection
Collections of objs,(no
Set duplicate)
Similar to
Maps Dictionaries(Key-Value)
first-in, first-out
Queue collection
TTKS
Collection → Arranging things together
0 1 2
Donuts
List
Map
calories locker
fruits locker
- Input → output
- Input → process
Input -> Output
buyCoffe()
Input -> Process
lockTheDoor()
unlockTheDoor()
Function
void
Function
Function
Installation Guide for Flutter
Set Up
Check
Check Successful or 04
not (flutter version)
Install VSCode
Installing Flutter & Dart in 03
Visual Studio Code
Environment
02
Set Environment variable path
flutter - - version
Create Project
Connect to Mobile phones
Developer Options Setting > About Phone > Software Information> Build Version
Check
Check Successful or 04
not (flutter version)
Environment
02
Set Environment variable path
Extract the downloaded zip file and move it to the desired location you want to install Flutter SDK.
Update Path Variable(Environment Set up
click the Start button and type to search for and then click on Edit environment variables for your
account.
Under User variables, click on and highlight Path. Click Edit
click New and add your flutter\bin directory
Confirm Installed Tools for Running Flutter
Download and Install Android Studio
https://developer.android.com/studio
Double click on exe file
Click “Next” to continue
flutter doctor --android-licenses
https://treehouse.github.io/installation-guides/mac/android-studio-mac.html
Basic Syntax
01 variable var name = “K”; int num = 34;
03 Operator +,-,*,/,%, ++,--, == , != , >, <, >=, <=, is, !is, &&, ||, !
(Day6)
01 Default Flutter app(Counter app)
if(userName &&
pw exist?)
Yes
Login to
Facebook with
username
No
Ask correct
UserName , PW?
Flutter
Material
- main() function
- runApp(Parent App)
Cupertino(iOS)
Scaffold
https://api.flutter.dev/flutter/material/Scaffold-class.html
(Day7)
What is Widget?
Each element on a screen of the Flutter app is a widget.
Types of Widgets:
Stateless Widget
01 state cannot be altered
once they are built
Stateful Widget
02 state can be altered
once they are built
Stateless Widget
CheckBox, RadioButton,
Form, TextField.
Layouts in Flutter
Layout also a widget => Arrange Vertically , Horizontally others widgets.
mainAxisAlignment
Alignment
Properties
crossAxisAlignment
start: Place the children from the starting of the row.
spaceAround: Place the space evenly between the children and also
half of that space before and after the first and last child.
spaceEvenly: Place the space evenly between the children and also
before and after the first and last child
Column Widgets
Vertical arrange for widgets
mainAxisAlignment
Alignment
Properties
crossAxisAlignment
start: Place the children from the starting of the column.
spaceAround: Place the space evenly between the children and also
half of that space before and after the first and last child.
spaceEvenly: Place the space evenly between the children and also
before and after the first and last child
Common Widgets
Radio Button
Text
TextField
Slider
Icon
Switch
Button
Checkbox
Icon Button
Text
display a string of text
Attributes Descriptions
Controller method
Button
● Touchable or clickable items.
● provides a user to trigger an event such as taking actions, making choices, searching things,
and many more.
https://api.flutter.dev/flutter/material/Icons-class.html
Icon(
Icons.favorite,
color: Colors.pink,
size: 24.0,
),
Icon(
Icons.audiotrack,
color: Colors.blue,
size: 36.0,
),
Icon Button
IconButton(
icon: const Icon(Icons.android),
color: Colors.white,
onPressed: () {},
),
- Checkbox/Radio button
- Image
-Slider, Switch
Checkbox
pubspec.yaml
Image.asset('assets/flower_img.jpeg')
Slider
Slider(
value: sliderValue,
activeColor: Colors.green,
inactiveColor: Colors.red,
min: 1.0,
max: 100.0,
onChanged: (value) {
sliderValue = value;
},
)
Switch
Components and Dialog
-SimpleDialog/ AlertDialog
- Snack Bar/ Toast
Simple Dialog
to display a list of options that users can select.
01 Stateful Widget
01 Stateful Widget
dependencies:
flutter:
sdk: flutter
fluttertoast: ^8.1.2
import 'package:fluttertoast/fluttertoast.dart' ;
Padding
Margin
List View
● Padding provides the space between the border and the content of an element.
● Margin provides the space between the border and outer elements.
ListView.builder()
ListView.builder({
https://api.flutter.dev/flutter/widgets/Position
ed-class.html
User Interface
Login View
lib
common
services
storage
view/UI
login_view
home_view
Menu
Drawer Menu
Navigator.of(context).pop();
Navigator is used for implementing closing functionality on the drawer when the user wants
to close it after tapping on some item
Or Use to go back previous screen.
bottomNavigationBar:
);
Local Storage
Flutter Library => https://pub.dev/
Shared Preferences
● SharedPreferences is used for storing data key-value pair in the Android and
iOS.
02
https://pub.dev/packages/shared_preferences
Create “shared_preference_manager.dart” file under lib/services/
Save data
To remove the data from the storage, provide the key in the remove(String key) method.
keys are only string values
Check value if present or not?
Clear All Local Storage
Final Project
E-Commerce
Social Media Booking /Order
(Shopping)
Screen Screen Screen
● Register/Sign Up ● Register/Sign Up ● Register /Sign Up
● Login ● Login ● Login
● Menu(at least one ● Menu(drawer or ● Menu(drawer or
menu) bottom) bottom navi)
● Home Screen ● Home Screen ● Home Screen