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 pages
  2. English
  3. ePUB (adapté aux mobiles)
  4. Disponible sur iOS et Android
eBook - ePub

Modern App Development with Dart and Flutter 2

A Comprehensive Introduction to Flutter

Dieter Meiller

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

À propos de ce livre

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.

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que Modern App Development with Dart and Flutter 2 est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  Modern App Development with Dart and Flutter 2 par Dieter Meiller en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Computer Science et Programming. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Année
2021
ISBN
9783110721607
Édition
1
Sous-sujet
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.1 Cross-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.2 Motivation

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.3 Target 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.4 Structure 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...

Table des matiĂšres

  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
Normes de citation pour 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.