Modern App Development with Dart and Flutter 2
eBook - ePub

Modern App Development with Dart and Flutter 2

A Comprehensive Introduction to Flutter

Dieter Meiller

  1. 249 páginas
  2. English
  3. ePUB (apto para móviles)
  4. Disponible en iOS y Android
eBook - ePub

Modern App Development with Dart and Flutter 2

A Comprehensive Introduction to Flutter

Dieter Meiller

Detalles del libro
Vista previa del libro
Índice
Citas

Información del libro

The book introduces the programming language Dart, the language used for Flutter programming. It then explains the basics of app programming with Flutter in version 2. Using practical examples such as a games app, a chat app and a drawing app, important aspects such as the handling of media files or the connection of cloud services are explained. The programming of mobile as well as desktop applications is discussed.

New important features of Dart 2.12 and Flutter 2 are described:

- Null safety

- Desktop Applications

Targeted readers are people with some background in programming, such as students or developers.

The sample projects from the book are available for download on the following GitHub repository: https://github.com/meillermedia
Over time, more branches may be added. However, the default branches are those that correspond to the state in the book.

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es Modern App Development with Dart and Flutter 2 un PDF/ePUB en línea?
Sí, puedes acceder a Modern App Development with Dart and Flutter 2 de Dieter Meiller en formato PDF o ePUB, así como a otros libros populares de Computer Science y Programming. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Año
2021
ISBN
9783110721607
Edición
1
Categoría
Programming

1 Introduction

This book deals with a specific innovative technology for the efficient development of apps for mobile devices. Consequently, it is possible to realize native apps crossplatform in only one programming language. Various practical examples introduce a new technology called “Flutter.” The main part of this book is the description of a more complex app, a 2D game called “Chicken Maze.” The goal of the game is to navigate a chicken through several levels, where it earns points and fights enemies.
When Steve Jobs presented the iPhone at the beginning of 2007, it was a turning point in the digital world. He also demonstrated a new type of software that can be run on the new device, the so-called apps, which is an abbreviation for “Applications.” The abbreviation was probably intended to suggest that these are smaller programs. The first apps were smaller gadgets, for example, the beer-drinker app: You could put the phone to your mouth and tilt it, a beer level that could be seen on the display slowly decreased, and in the end, you heard a burping sound. The amazing thing was that the beer level always remained horizontal, as the program could determine the angle of the device using a built-in sensor. The app is available from the App Store, Apple’s cloud-based software sales platform, revolutionary for its time and exclusive to Apple’s mobile devices.
People stood in line at Apple stores to buy an iPhone and expected new apps. Developers also started rushing for the new device; it was a kind of new gold rush. In 2008 the first competing mobile phone with an Android operating system was launched. The operating system was mainly developed by Google. Google gave the manufacturers of mobile devices a ready-made system software. A store, the Google Play-Store, was also integrated there. For a short time, there were other competing systems such as Windows Mobile or webOS, but these were unable to establish themselves and eventually disappeared. What remained are iOS and Android, so today’s development tools concentrate exclusively on these two. The gold rush is long gone, and meanwhile, you have to do a lot of work as a developer to have commercial success by developing apps.

1.1Cross-Platform Development

Apps are often developed twice and individually ported to the respective platform. Native Apps1for the iOS environment, i.e., for Apple mobile devices, are programmed using the programming languages Objective-C or Swift and Apple’s frameworks. Android apps, on the other hand, are usually based on the Java platform with the programming languages Java or Kotlin. If you want to work with the in-house technology of competing companies, you have to laboriously translate the code into the other languages by hand. The need for a cross-platform solution, therefore soon came up and various technologies were developed. Basically, we can distinguish between two approaches: On the one hand, there are frameworks that work with web technologies. However, this should not be confused with web apps. These are merely web pages that adapt as well as possible to the mobile device. For app development, there is the procedure of embedding web pages into the app and presenting them via a browser component that fills the entire screen. Your own code is programmed in JavaScript. Via an API, you can talk to native components, which can then address the specific hardware of the device. This approach has two disadvantages: You can only use features that are available on both platforms. Furthermore, the performance is limited because, in the end, you are dealing with a browser application. The advantage is that web developers can also attempt app programming. Well-known frameworks of this kind are React Native from Facebook and Apache Cordova (formerly PhoneGap from Adobe).
The other approach is the following: You program with platform-unspecific languages and frameworks, which are then cross-compiled into the desired environment and therefore have a better performance. A well-known representative of this technology is Xamarin from Microsoft. There, programming is done with C#. The Flutter framework with the programming language Dart also belongs to this category.

1.2Motivation

The hype about Flutter started in 2018 when it became known that Google was working on a new operating system called Fuchsia, and there was the rumor that this new operating system should replace Android. Meanwhile, Google denied this and announced that the new operating system would be used on new types of devices in the future. Fuchsia is open source and freely available, it can be tested and installed [35]. Flutter is used for the user interface programming. The book does not discuss Fuchsia itself, but you can use the knowledge taught in the book to develop applications for Fuchsia. The graphical user interface is displayed with a render engine called Skia, which is used in Flutter. The framework was in the alpha and beta phase after the first release and allowed the programming of native apps for iOS and Android systems. In addition, Google recommended that you should better realize your apps with Flutter, as it realizes the Google material design. The interest in Flutter was then awakened in the author, who was planning a course for media computer scientists on app programming at that time.

1.3Target Group

This book targets app developers who are interested in developing new cross-platform apps. These can be professional programmers or students of courses in computer science or media-related studies.
All such persons should have some basic knowledge of programming. The book does not provide a basic introduction to programming. It does not discuss the meaning of variables, loops and control structures. Although the syntax of these structures in the Dart language is also explained, the meaning of the constructs should be clear. The reader should also have some knowledge of object-oriented programming. Ideally, readers should also have already dealt with program libraries and the command line. Knowledge of Java, C#, JavaScript or C++ as first the programming language would be ideal.

1.4Structure and Aim of the Book

The book points out the pitfalls that you inevitably run into when you take on the adventure of learning a new programming language and a new framework. The book is divided into two parts: a fundamental section and a practical section. The first part explains the most important constructs of the Dart language. This is followed by an introduction to app programming with Flutter. Simple examples are shown there. In the second section, which is the practical part, more sophisticated examples follow, starting with a messenger app that demonstrates how the app connects to the cloud. A more complex application follows, a 2D game called “Chicken Maze,” where a chicken is the game character. The game is not too complex, but is more than a demo app. It contains features that professional applications need. The code of the examples is explained in detail and specific programming techniques of Flutter and Dart are described.

Notes

1
These are apps programmed and optimized specifically for a platform

Part I: Foundations

2 Foundations of Dart

Dieter Meiller
In the following, the language Dart is briefly introduced and a complete introduction to the programming language given. However, the basics of programming are not taught here. Basic skills in imperative and object-oriented programming are expected. The chapter tries to teach special features of the language in comparison to other languages and basics, which are important to understand how to use the Flutter-Framework. It deals with Dart in version 2.12
The extended Backus Naur Form (BNF), a meta syntax, is used to explain parts of the syntax. However, this does not provide a completely correct description of the Dart language, as it would be necessary for compilers or standards. Some non-terminals are also not further resolved. It should be clear what is meant by <condition> (a boolean expression), for example.

2.1 The Dart Language

Dart is a programming language developed by Google. In addition to Dart, Google developed many other programming languages, including Groovy. This language is compatible with Java and generates code for the Java Virtual Machine. The language Go was released at the same time as Dart. Go is a hardware-oriented language that can be used for system development, similar to C and C++. Go is supposed to be a modern version of these languages and compiles faster.
Dart, in contrast, was designed as a language for application development. Originally, Dart was developed as a language for the web browser Chrome. The reputation of Dart was controversial in the developer community due to its direct competition with JavaScript and ran contrary to efforts to standardize and interoperate web browsers. It was feared that there would be a new browser war like the one in the 2000s when Microsoft introduced Visual Basic as the browser language in competition with JavaScript, the Netscape language of the time. Therefore, the acceptance of the Dart language was rather low, and it became quiet around Dart.
In early 2018 Google announced a new framework for the development of apps, namely Flutter (see chapter 4). The development in Flutter should be done exclusively in Dart. At the start of Flutter, Dart was also modernized and is now available in version 2. In the process of this development, Dart changed from an extension of Ja...

Índice

  1. Title Page
  2. Copyright
  3. Contents
  4. Thanks
  5. Preface
  6. 1 Introduction
  7. Part I: Foundations
  8. Part II: Practice
  9. List of Figures
  10. Index
Estilos de citas para Modern App Development with Dart and Flutter 2

APA 6 Citation

Meiller, D. (2021). Modern App Development with Dart and Flutter 2 (1st ed.). De Gruyter. Retrieved from https://www.perlego.com/book/2818790/modern-app-development-with-dart-and-flutter-2-a-comprehensive-introduction-to-flutter-pdf (Original work published 2021)

Chicago Citation

Meiller, Dieter. (2021) 2021. Modern App Development with Dart and Flutter 2. 1st ed. De Gruyter. https://www.perlego.com/book/2818790/modern-app-development-with-dart-and-flutter-2-a-comprehensive-introduction-to-flutter-pdf.

Harvard Citation

Meiller, D. (2021) Modern App Development with Dart and Flutter 2. 1st edn. De Gruyter. Available at: https://www.perlego.com/book/2818790/modern-app-development-with-dart-and-flutter-2-a-comprehensive-introduction-to-flutter-pdf (Accessed: 15 October 2022).

MLA 7 Citation

Meiller, Dieter. Modern App Development with Dart and Flutter 2. 1st ed. De Gruyter, 2021. Web. 15 Oct. 2022.