Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
3 views

chapter two

The document provides an overview of mobile application development, focusing on Android and iOS platforms, and introduces Flutter as a cross-platform development framework. It highlights Flutter's features, including its use of the Dart programming language, widget-based architecture, and advantages like fast development and high performance. Additionally, it discusses various types of widgets in Flutter, including layout, state maintenance, and platform-specific widgets, essential for building user interfaces.

Uploaded by

fikireselamgirma
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

chapter two

The document provides an overview of mobile application development, focusing on Android and iOS platforms, and introduces Flutter as a cross-platform development framework. It highlights Flutter's features, including its use of the Dart programming language, widget-based architecture, and advantages like fast development and high performance. Additionally, it discusses various types of widgets in Flutter, including layout, state maintenance, and platform-specific widgets, essential for building user interfaces.

Uploaded by

fikireselamgirma
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 27

Chapter two

Mobile apps Development Environment


 Mobile application development is the process of making
software for smartphones, tablets and digital assistants.
 most commonly for the Android and iOS operating systems.
Basics of mobile programming

Android software development and Android programming are terms that


mean creating applications that run on devices with the Android operating
system.
Android development is a form of software engineering dedicated specifically
to creating applications for devices that run on the Android platform.
Introduction to Mobile App development using Flutter

Flutter (first released Dec 4th, 2018) is an open source framework by


Google for creating native compiled mobile applications that can be run on
both iOS and Android.
Flutter is using the object-oriented programming language Dart with widgets
optimized for 2D graphics.
Flutter is a UI toolkit.
Flutter supports Android, iOS, Windows, Linux, and Mac. It’s a free and
open-source toolkit to build visually appealing apps.
Flutter uses Dart for writing the code, a modern, easy-to-learn language.
Introduction to Mobile App development using Flutter
Flutter is an open-source mobile application development SDK created
by Google to develop cross-platform mobile applications.
Flutter makes it extremely easy and fast for even novice programmers (An
computer programmers who is not experienced at any programming languages)
Introduction to Mobile App development using Flutter
Flutter is Google’s Mobile SDK to build native iOS and Android apps from a
single codebase.
 It was developed on December 4, 2018. When building applications with
Flutter, everything is towards Widgets – the blocks with which the Flutter apps
are built.
Compared to its contemporary technologies like React Native, Kotlin, and
Java, Flutter is much better in regard to having a Single Codebase for
Android and iOS, Reusable UI and Business Logic, high compatibility,
performance, and productivity.
Why Flutter for app development ???
Flutter has some unique features compared to native Java and other SDK such as:
Modern and reactive framework.
Uses Dart programming language and it is very easy to learn.
Beautiful and fluid user interfaces.
Huge widget catalog.
Runs same UI for multiple platforms.
High performance application.
Fast Development: Flutter makes use of customizable Widgets that can be nested
together to create the app interface.
Hot Reload: Instantly see changes made in code, without recompiling.
It’s Native in the end: Under the hood, the codebase is compiled into Java, ensuring
the same performance as that offered by native apps.
Light on system resources: Flutter can be comfortably run on a lower resources
system.
Flutter - Architecture Application
Widgets
In Flutter, Everything is a widget.
Widgets are basically user interface components used to create the user
interface of the application.
In Flutter, the application itself is a widget.
The application is the top- level widget and its UI is build using one or more
children (widgets), which again build using its children widgets.
This composability feature helps us to create a user interface of any complexity.
For example, the widget hierarchy of the application specified in the following
diagram
Introduction to Mobile App development using Flutter
Introduction to Mobile App development using Flutter
1.Dart
2. Widgets
 In Flutter, everything is a widget. Image, icon, text, and even row, column,
and padding are all considered widgets in Flutter.
 Understanding how to use and compose different types of widgets is
essential for building Flutter apps.
3. Layout
 Flutter provides several layout widgets, such as Container, Row, and
Column, that you can use to arrange and size your app's user interface
elements.
4. Styling
 Flutter provides a number of ways to style your app's user interface,
including using theme data, inline styles, and custom widgets
Introduction to Mobile App development using Flutter
5. Interactivity
 Flutter provides a number of ways to add interactivity to your app,
including handling user input, making HTTP requests, and navigating
between screens.
6. Testing
 It's important to test your Flutter app to ensure that it works as expected
and to catch any bugs.
 Flutter provides a number of tools for testing your app, including unit tests
and integration tests.
7. Debugging
Debugging is an essential part of the development process, and Flutter provides
a number of tools and techniques for debugging your app, including the Flutter
debugger and the ability to print debug messages to the console.
Here the following points are worth notable
 MyApp is the user created widget and it is build using the Flutter
native widget, MaterialApp.
 MaterialApp has a home property to specify the user interface of
the home page, which is again a user created
widget, MyHomePage.
 MyHomePage is build using another flutter native widget, Scaffold
 Scaffold has two properties – body and appBar
 body is used to specify its main user interface and appBar is used
to specify its header user interface
 Header UI is build using flutter native widget, AppBar and
 Body UI is build using Center widget.
 The Center widget has a property, Child, which refers the actual
content and it is build using Text widget
Programming and Markup languages
Android development may involve several programming languages .
The programming and markup languages used for this kind of software
development include Java, Swift, Kotlin, Dart, C# and HTML5.
using the Android SDK and Flutter SDK while using other languages is also
possible.
Flutter - Introduction to Widgets
widgets are everything in Flutter framework.

In Flutter, widgets can be grouped into multiple categories based on their
features

1. Platform specific widgets

2. Layout widgets

3. State maintenance widgets

4. Platform independent / basic widgets


1. Platform specific widgets

Flutter has widgets specific to a particular platform - Android or iOS.

Android specific widgets are designed in accordance with Material design


guideline by Android OS.
Android specific widgets are called as Material widgets.

iOS specific widgets are designed in accordance with Human Interface


Guidelines by Apple and they are called as Cupertino widgets.
Some of the most used material widgets are
Scaffold
AppBar  PopupMenuButton
BottomNavigationBar  ButtonBar
 FloatingActionButton  TextField
TabBar
TabBarView
 FlatButton  Checkbox
ListTile  IconButton  Radio
RaisedButton  DropdownButton  Date & Time
Pickers
 SimpleDialog
 AlertDialog
Some of the most used Cupertino widgets are:
CupertinoButton  CupertinoDialog
CupertinoPicker  CupertinoDialogAction
CupertinoDatePicker  CupertinoFullscreenDialogT
CupertinoTimerPicker ransition
CupertinoNavigationBar  CupertinoPageScaffold
CupertinoTabBar  CupertinoPageTransition
CupertinoTabScaffold  CupertinoActionSheet
CupertinoTabView  CupertinoActivityIndicator
CupertinoTextField  CupertinoAlertDialog
 CupertinoPopupSurface
 CupertinoSlider
2. Layout widgets
In Flutter, a widget can be created by composing one or more widgets.
To compose multiple widgets into a single widget, Flutter provides large
number of widgets with layout feature.
 For example, the child widget can be centered using Center widget.
Some of the popular layout widgets are as follows:
Container − A rectangular box decorated using BoxDecoration widgets with
background, border and shadow.
Center − Center its child widget.
Row − Arrange its children in the horizontal direction.
Column − Arrange its children in the vertical direction.
Stack − Arrange one above the another.
3. State maintenance widgets
In Flutter, all widgets are either derived from StatelessWidget or StatefulWidget.

Widget derived from StatelessWidget does not have any state information but it may

contain widget derived from StatefulWidget.

The dynamic nature of the application is through interactive behavior of the widgets

and the state changes during interaction.

For example, tapping a counter button will increase / decrease the internal state of the

counter by one and reactive nature of the Flutter widget will auto re-render the widget

using new state information.


Platform independent / basic widgets

Flutter provides large number of basic widgets to create simple as


well as complex user interface in a platform independent manner.
Text
Text widget is used to display a piece of string.
The style of the string can be set by using style property
and TextStyle class.
The sample code
Text('Hello World!', style: TextStyle(fontWeight: FontWeight.bold))
The most important properties of the Text widget are

maxLines, int − Maximum number of lines to show

style, TextStyle − Specify the style of the string using TextStyle class

textAlign, TextAlign − Alignment of the text like right, left, justify, etc.,
using TextAlign class
textDirection, TextDirection − Direction of text to flow, either left-to-right or
right-to-left
Image widget

Image widget is used to display an image in the application.


 Image widget provides different constructors to load images from multiple
sources and they are as follows
Image − Generic image loader using ImageProvider
Image.asset − Load image from flutter project’s assets
Image.file − Load image from system folder
Image.memory − Load image from memory
Image.Network − Load image from network
Image widget
The easiest option to load and display an image in Flutter is by including the
image as assets of the application and load it into the widget on demand.
Create a folder, assets in the project folder and place the necessary images.
Specify the assets in the pubspec.yaml as shown below −
flutter: assets: - assets/android.png
Now, load and display the image in the application.
Image.asset('assets/android.png')
The most important properties of the Image widget are
image, ImageProvider − Actual image to load
width, double − Width of the image
height, double − Height of the image
alignment, AlignmentGeometry − How to align the image within
its bounds
Icon widget

Icon widget is used to display a glyph from a font described


in IconData class.
The code to load a simple email icon is
Icon(Icons.email)
o u ! ! ! !
a n k y
T h s? ?
e st i on
Q u t … …
m m e n
C o

You might also like