Flutter | An introduction to the open source SDK by Google

11 Jul, 2022
Flutter is Google’s Mobile SDK to build native iOS and Android, Desktop (Windows, Linux, macOS), and Web apps from a single codebase. When building applications with Flutter everything towards Widgets – the blocks with which the flutter apps are built. They are structural elements that ship with a bunch of material design-specific functionalities and new widgets can be composed out of existing ones too. The process of composing widgets together is called composition. The User Interface of the app is composed of many simple widgets, each of them handling one particular job. That is the reason why Flutter developers tend to think of their flutter app as a tree of widgets. 
Stateless Widgets
Stateful Widgets
Flutter, Dart, and equivalent technologies 
First and foremost, let’s state the core differences between Flutter and React Native.
,
Dart
// Importing important packages require to connect// Flutter and Dartimport 'package:flutter/material.dart';  // Main Functionvoid main() {// Giving command to runApp() to run the app.  /* The purpose of the runApp() function is to attachthe given widget to the screen. */  runApp(const MyApp());}  // Widget is used to create UI in flutter framework.  /* StatelessWidget is a widget, which does not maintainany state of the widget. */  /* MyApp extends StatelessWidget and overrides itsbuild method. */class MyApp extends StatelessWidget {  const MyApp({Key? key}) : super(key: key);  // This widget is the root of your application.  @override  Widget build(BuildContext context) {    return MaterialApp(      // title of the application      title: 'Hello World Demo Application',      // theme of the widget      theme: ThemeData(        primarySwatch: Colors.lightGreen,      ),      // Inner UI of the application      home: const MyHomePage(title: 'Home page'),    );  }}  /* This class is similar to MyApp instead itreturns Scaffold Widget */class MyHomePage extends StatelessWidget {  const MyHomePage({Key? key, required this.title}) : super(key: key);  final String title;    @override  Widget build(BuildContext context) {    return Scaffold(      appBar: AppBar(        title: Text(title),      ),      // Sets the content to the      // center of the application page      body: const Center(          // Sets the content of the Application          child: Text(        'Welcome to GeeksForGeeks!',      )),    );  }}
Output
 
And, the biggest selling point of Flutter Tech are two things: 
High-Performance App: The Apps developed using Flutter are highly expressive and have flexible UI. Its fast development due to hot reloading brings the app to life and its expressiveness provides features that are keened for native end-user experiences.Expressive and Flexible UI: Flutter lets developers build beautiful-looking apps with ease by using prebuild material widgets. Even though many widgets are prebuilt still flutter enables full customization of the widget.Fast Development & Hot Reloading: Hot Reloading refers to the injection of new versions of the files that you edited at runtime while keeping the app running.
High-Performance App: The Apps developed using Flutter are highly expressive and have flexible UI. Its fast development due to hot reloading brings the app to life and its expressiveness provides features that are keened for native end-user experiences.
Expressive and Flexible UI: Flutter lets developers build beautiful-looking apps with ease by using prebuild material widgets. Even though many widgets are prebuilt still flutter enables full customization of the widget.
Fast Development & Hot Reloading: Hot Reloading refers to the injection of new versions of the files that you edited at runtime while keeping the app running.
Pros: 
Flutter uses a single codebase, called, Dart for both platforms, Android and iOS which is a simple language ensuring type safety.
Both Flutter language and community are developing with great speed, releasing new features, widgets, and add-ons.
Flutter has its own set of widgets rather than using the widgets provided by the host operating system which means the user provides its own gesture recognition model, thus, having greater control over the precise rendering or customization of the widgets.
The hot-reloading is a game-changer in the productivity of the development process. It gives a lively effect to the app under development, thus making the whole development cycle more exciting for the UI/UX developer using Flutter.
Flutter is not bound to the ROM w.r.t. the widget system. So, it enhances its portability over a wide ambit of Android versions and thus, lowering its dependencies on the host platform.
Dart and Flutter unite closely to optimize dart Virtual Machine(VM) for those mobiles which are specifically needed by Flutter.
Flutter is an established player in the field of cross-platform application development with amazing community support.
Cons: 
In reality, there are no cons to flutter because there isn’t any other framework as effective and elaborate as flutter. Even though if we have to list any it would be related to Dart programming language as while converting dart to JavaScript there are some bugs to be fixed, dart doesn’t have a framework for backend, etc.,
MihailYonchev
ankitshuklatiwari1
ankit_kumar_
sooda367
dhyanidesai21
chiragkhokhar80
Misc
Misc
Misc
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.