www.wikidata.de-de.nina.az
Flutter ist ein quelloffenes Benutzerschnittstellen Entwicklungs Kit von Google Mit Flutter konnen Cross Platform Apps in der Programmiersprache Dart entwickelt werden Ein Flutter Programm soll ohne grossere Anpassungen auf folgenden Zielplattformen lauffahig sein Webanwendung Android iOS Windows Linux macOS und Google Fuchsia 6 4 5 Laut Hersteller liegt der Fokus von Flutter auf kurzen Entwicklungszeiten schneller Ausfuhrungsgeschwindigkeit und nativer User Experience 7 FlutterBasisdatenEntwickler Google Jonah Williams 1 Adam Barth Greg Spencer Ian HicksonErscheinungsjahr 2017 2 Aktuelle Version 3 16 0 3 15 November 2023 Betriebssystem Android iOS Windows Linux macOS Google Fuchsia 4 5 Programmiersprache Dart C Kategorie FrameworkLizenz BSDhttps flutter dev Inhaltsverzeichnis 1 Aufbau 2 Widget 3 Codebeispiele 4 Kompatibilitat mit anderen Technologien 5 EinzelnachweiseAufbau BearbeitenFlutter selbst ist in C geschrieben und verwendet die Dart Virtual Machine Dart VM sowie die Grafikbibliothek Skia 8 Bei der Ausfuhrung von Programmen versucht Flutter zumindest eine Bildrate von 60 fps zu erreichen bzw 120 fps wenn die Hardware dies zulasst 9 Flutter Programme fur Android iOS Windows Linux und macOS werden entweder per JIT Compiler auf einer Dart VM oder mittels AOT Compiler direkt fur die Zielplattform kompiliert 10 Flutter Webanwendungen werden nach JavaScript ubersetzt und sind so direkt in modernen Webbrowsern lauffahig 11 Widget BearbeitenDie grundlegende Komponente in einem Flutter Programm ist ein Widget das wiederum selbst aus Widgets bestehen kann Ein Widget bundelt die Logik Interaktion und Darstellung innerhalb eines Objekts und erinnert im Aufbau an die JavaScript Softwarebibliothek React 12 Es gibt eine Reihe vorgefertigter Widgets die bekannte und oft benotigte Interaktionen abbilden wie zum Beispiel Buttons Listen Checkboxes Tabs etc Flutter verwendet nicht die Widgets der jeweiligen Plattform sondern implementiert diese selbst 13 14 Widgets fur Android folgen den Material Design Richtlinien 15 wahrend Widgets fur andere Betriebssystem wie iOS Windows Linux oder macOS den jeweiligen Richtlinien folgen Obwohl Widgets eine wesentliche Rolle bei Flutter einnehmen konnen Programme auch fast ohne Widgets programmiert werden indem man direkt auf einen Canvas zeichnet 16 17 18 Codebeispiele BearbeitenDie automatisch generierte main dart Klasse nachdem ein neues Projekt erstellt wurde sieht folgendermassen aus import package flutter material dart void main runApp MyApp class MyApp extends StatelessWidget This widget is the root of your application override Widget build BuildContext context return MaterialApp title Flutter Demo theme ThemeData This is the theme of your application Try running your application with flutter run You ll see the application has a blue toolbar Then without quitting the app try changing the primarySwatch below to Colors green and then invoke hot reload press r in the console where you ran flutter run or simply save your changes to hot reload in a Flutter IDE Notice that the counter didn t reset back to zero the application is not restarted primarySwatch Colors blue This makes the visual density adapt to the platform that you run the app on For desktop platforms the controls will be smaller and closer together more dense than on mobile platforms visualDensity VisualDensity adaptivePlatformDensity home MyHomePage title Flutter Demo Home Page class MyHomePage extends StatefulWidget MyHomePage Key key this title super key key This widget is the home page of your application It is stateful meaning that it has a State object defined below that contains fields that affect how it looks This class is the configuration for the state It holds the values in this case the title provided by the parent in this case the App widget and used by the build method of the State Fields in a Widget subclass are always marked final final String title override MyHomePageState createState gt MyHomePageState class MyHomePageState extends State lt MyHomePage gt int counter 0 void incrementCounter setState This call to setState tells the Flutter framework that something has changed in this State which causes it to rerun the build method below so that the display can reflect the updated values If we changed counter without calling setState then the build method would not be called again and so nothing would appear to happen counter override Widget build BuildContext context This method is rerun every time setState is called for instance as done by the incrementCounter method above The Flutter framework has been optimized to make rerunning build methods fast so that you can just rebuild anything that needs updating rather than having to individually change instances of widgets return Scaffold appBar AppBar Here we take the value from the MyHomePage object that was created by the App build method and use it to set our appbar title title Text widget title body Center Center is a layout widget It takes a single child and positions it in the middle of the parent child Column Column is also a layout widget It takes a list of children and arranges them vertically By default it sizes itself to fit its children horizontally and tries to be as tall as its parent Invoke debug painting press p in the console choose the Toggle Debug Paint action from the Flutter Inspector in Android Studio or the Toggle Debug Paint command in Visual Studio Code to see the wireframe for each widget Column has various properties to control how it sizes itself and how it positions its children Here we use mainAxisAlignment to center the children vertically the main axis here is the vertical axis because Columns are vertical the cross axis would be horizontal mainAxisAlignment MainAxisAlignment center children lt Widget gt Text You have pushed the button this many times Text counter style Theme of context textTheme headline4 floatingActionButton FloatingActionButton onPressed incrementCounter tooltip Increment child Icon Icons add This trailing comma makes auto formatting nicer for build methods Ein Hallo Welt Programm in Flutter konnte folgendermassen aussehen In diesem Fall werden die Material Widgets verwendet import package flutter material dart void main gt runApp HelloWorldApp class HelloWorldApp extends StatelessWidget override Widget build BuildContext context return MaterialApp title Hello World App home Scaffold appBar AppBar title Text Hello World App body Center child Text Hello World Kompatibilitat mit anderen Technologien BearbeitenFlutter kann mit anderen Technologien zusammenarbeiten Ein Beispiel fur eine solche Software ist die Unity Engine Es ist moglich den Code so zu verwalten dass die Effizienz erhalten bleibt 19 Einzelnachweise Bearbeiten github com Chris Bracken v0 0 6 Rev alpha branch In github com 12 Mai 2017 abgerufen am 14 November 2020 englisch Release 3 16 0 15 November 2023 abgerufen am 19 November 2023 a b Tim Sneath Flutter and Desktop Apps In medium com 17 Juni 2020 abgerufen am 29 August 2020 englisch a b Chris Sells Canonical enables Linux desktop app support with Flutter In medium com 9 Juli 2020 abgerufen am 26 August 2020 englisch Open Source Clues to Google s Mysterious Fuchsia OS Abgerufen am 30 Januar 2020 englisch Flutter Beautiful native apps in record time Abgerufen am 30 Januar 2020 englisch Skia Documentation Abgerufen am 6 Marz 2023 englisch Flutter performance profiling Abgerufen am 1 Marz 2020 englisch Dart dev Platforms Abgerufen am 4 Februar 2021 englisch Web support for Flutter Abgerufen am 30 Januar 2020 englisch Flutter 60 FPS UI of the Future Everything is a widget Abgerufen am 1 Marz 2020 englisch Introduction to widgets Abgerufen am 30 Januar 2020 englisch StatefulWidget class widgets library Dart API Abgerufen am 30 Januar 2020 Material Components widgets Abgerufen am 30 Januar 2020 englisch Canvas class Abgerufen am 1 Marz 2020 englisch Zerker a lightweight and powerful flutter graphic animation library Abgerufen am 1 Marz 2020 englisch 2D game engine made on top of Flutter Abgerufen am 1 Marz 2020 englisch Flutter with Unity can it work Our experience using these two tools to create quality applications Blog Codigee Abgerufen am 14 Marz 2023 englisch Normdaten Sachbegriff GND 1183615590 lobid OGND AKS Abgerufen von https de wikipedia org w index php title Flutter Software amp oldid 236998530