Convert Figma logo to code with AI

flutter logoflutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond

167,034
27,708
167,034
13,127

Top Related Projects

A framework for building native applications using React

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.

A framework for building native Windows apps with React.

⚡ Empowering JavaScript with native platform APIs. ✨ Best of all worlds (TypeScript, Swift, Objective C, Kotlin, Java, Dart). Use what you love ❤️ Angular, Capacitor, Ionic, React, Solid, Svelte, Vue with: iOS (UIKit, SwiftUI), Android (View, Jetpack Compose), Dart (Flutter) and you name it compatible.

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.

Quick Overview

Flutter is an open-source UI software development kit created by Google. It allows developers to build natively compiled applications for mobile, web, and desktop platforms from a single codebase. Flutter uses the Dart programming language and provides a rich set of pre-designed widgets to create beautiful and responsive user interfaces.

Pros

  • Cross-platform development: Build apps for iOS, Android, web, and desktop from a single codebase
  • Hot reload: Instantly see changes in the app without losing the current state
  • Rich set of customizable widgets: Create beautiful and responsive UIs with ease
  • Strong performance: Compiled natively for each platform, resulting in high-performance apps

Cons

  • Larger app size compared to native apps
  • Steeper learning curve for developers new to Dart and reactive programming
  • Limited access to some platform-specific features without plugins
  • Relatively young ecosystem compared to native development frameworks

Code Examples

  1. Creating a simple "Hello World" app:
import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      appBar: AppBar(title: Text('Hello World')),
      body: Center(child: Text('Hello, Flutter!')),
    ),
  ));
}
  1. Building a custom widget:
class CustomButton extends StatelessWidget {
  final String text;
  final VoidCallback onPressed;

  CustomButton({required this.text, required this.onPressed});

  @override
  Widget build(BuildContext context) {
    return ElevatedButton(
      child: Text(text),
      onPressed: onPressed,
      style: ElevatedButton.styleFrom(
        primary: Colors.blue,
        padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
      ),
    );
  }
}
  1. Fetching data from an API:
import 'package:http/http.dart' as http;
import 'dart:convert';

Future<List<String>> fetchData() async {
  final response = await http.get(Uri.parse('https://api.example.com/data'));
  if (response.statusCode == 200) {
    List<dynamic> jsonData = json.decode(response.body);
    return jsonData.map((item) => item['name'].toString()).toList();
  } else {
    throw Exception('Failed to load data');
  }
}

Getting Started

  1. Install Flutter by following the official guide: https://flutter.dev/docs/get-started/install
  2. Create a new Flutter project:
    flutter create my_app
    cd my_app
    
  3. Run the app:
    flutter run
    
  4. Start building your app by editing lib/main.dart

For more detailed instructions and documentation, visit the official Flutter website: https://flutter.dev

Competitor Comparisons

A framework for building native applications using React

Pros of React Native

  • Larger ecosystem and community support
  • Easier learning curve for developers familiar with JavaScript
  • More mature and stable platform with longer track record

Cons of React Native

  • Performance can be slower, especially for complex animations
  • Less consistent UI across platforms, requiring more platform-specific code
  • More frequent updates and potential breaking changes

Code Comparison

React Native:

import React from 'react';
import { View, Text } from 'react-native';

const App = () => (
  <View>
    <Text>Hello, World!</Text>
  </View>
);

Flutter:

import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: Text('Hello, World!'),
        ),
      ),
    );
  }
}

Both frameworks offer cross-platform development capabilities, but Flutter provides a more consistent UI experience and better performance for complex animations. React Native, on the other hand, benefits from a larger ecosystem and easier adoption for JavaScript developers. The choice between the two often depends on project requirements, team expertise, and specific app needs.

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.

Pros of Ionic Framework

  • Web-based development using familiar technologies (HTML, CSS, JavaScript)
  • Easier learning curve for web developers
  • Extensive ecosystem of plugins and third-party integrations

Cons of Ionic Framework

  • Performance may be slower compared to native apps
  • Limited access to native device features
  • Larger app size due to WebView dependency

Code Comparison

Ionic Framework (Angular):

@Component({
  selector: 'app-home',
  template: `
    <ion-content>
      <h1>{{ title }}</h1>
    </ion-content>
  `
})
export class HomePage {
  title = 'Hello, Ionic!';
}

Flutter:

class HomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Text('Hello, Flutter!'),
      ),
    );
  }
}

The Ionic Framework example uses web technologies and Angular for component-based development, while Flutter uses Dart and a widget-based approach for building user interfaces. Ionic's code structure may be more familiar to web developers, whereas Flutter's code is more concise and focused on mobile-first development.

A framework for building native Windows apps with React.

Pros of React Native Windows

  • Native Windows UI components and APIs
  • Leverages existing React Native knowledge for Windows development
  • Supports UWP and Win32 app development

Cons of React Native Windows

  • Limited to Windows platform, less cross-platform than Flutter
  • Smaller community and ecosystem compared to Flutter
  • Steeper learning curve for developers new to React Native

Code Comparison

React Native Windows:

import React from 'react';
import { View, Text } from 'react-native-windows';

const App = () => (
  <View>
    <Text>Hello, Windows!</Text>
  </View>
);

Flutter:

import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      body: Center(child: Text('Hello, World!')),
    ),
  ));
}

Summary

React Native Windows offers native Windows development capabilities, while Flutter provides a more cross-platform solution. React Native Windows is ideal for developers familiar with React Native targeting Windows, whereas Flutter offers a unified codebase for multiple platforms. The choice between the two depends on project requirements, target platforms, and team expertise.

⚡ Empowering JavaScript with native platform APIs. ✨ Best of all worlds (TypeScript, Swift, Objective C, Kotlin, Java, Dart). Use what you love ❤️ Angular, Capacitor, Ionic, React, Solid, Svelte, Vue with: iOS (UIKit, SwiftUI), Android (View, Jetpack Compose), Dart (Flutter) and you name it compatible.

Pros of NativeScript

  • Direct access to native APIs without plugins
  • Ability to use existing JavaScript/TypeScript knowledge
  • Smaller app size compared to Flutter

Cons of NativeScript

  • Slower performance for complex UI animations
  • Smaller community and ecosystem compared to Flutter
  • Less consistent UI across platforms

Code Comparison

NativeScript (XML and TypeScript):

<StackLayout>
  <Label text="Hello, NativeScript!" />
  <Button text="Click Me" tap="{{ onTap }}" />
</StackLayout>
export function onTap() {
  console.log("Button tapped!");
}

Flutter (Dart):

class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Text("Hello, Flutter!"),
        ElevatedButton(
          child: Text("Click Me"),
          onPressed: () => print("Button tapped!"),
        ),
      ],
    );
  }
}

Summary

NativeScript offers direct native API access and leverages existing JavaScript/TypeScript skills, resulting in smaller app sizes. However, it may have slower performance for complex UI animations and a smaller community compared to Flutter. Flutter provides a more consistent UI across platforms and has a larger ecosystem, but requires learning Dart and may result in larger app sizes. The choice between the two depends on specific project requirements and developer preferences.

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.

Pros of Xamarin.Forms

  • Native UI components for better platform-specific look and feel
  • Stronger integration with platform-specific APIs and features
  • Ability to share more code across platforms (up to 96%)

Cons of Xamarin.Forms

  • Slower development and compilation times
  • Larger app size due to inclusion of .NET runtime
  • Steeper learning curve for developers without C# experience

Code Comparison

Xamarin.Forms (XAML):

<StackLayout>
    <Label Text="Hello, World!" />
    <Button Text="Click me" Clicked="OnButtonClicked" />
</StackLayout>

Flutter (Dart):

Column(
  children: [
    Text('Hello, World!'),
    ElevatedButton(
      onPressed: _onButtonPressed,
      child: Text('Click me'),
    ),
  ],
)

Both frameworks aim to simplify cross-platform mobile development, but they take different approaches. Xamarin.Forms uses C# and XAML, leveraging native UI components, while Flutter uses Dart and custom widgets for a more consistent cross-platform look. Flutter generally offers faster development and better performance, while Xamarin.Forms provides deeper platform integration and a familiar environment for .NET developers.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Flutter

Flutter CI Status Discord badge Twitter handle codecov CII Best Practices SLSA 1

Flutter is Google's SDK for crafting beautiful, fast user experiences for mobile, web, and desktop from a single codebase. Flutter works with existing code, is used by developers and organizations around the world, and is free and open source.

Documentation

For announcements about new releases, follow the flutter-announce@googlegroups.com mailing list. Our documentation also tracks breaking changes across releases.

Terms of service

The Flutter tool may occasionally download resources from Google servers. By downloading or using the Flutter SDK, you agree to the Google Terms of Service: https://policies.google.com/terms

For example, when installed from GitHub (as opposed to from a prepackaged archive), the Flutter tool will download the Dart SDK from Google servers immediately when first run, as it is used to execute the flutter tool itself. This will also occur when Flutter is upgraded (e.g. by running the flutter upgrade command).

About Flutter

We think Flutter will help you create beautiful, fast apps, with a productive, extensible and open development model, whether you're targeting iOS or Android, web, Windows, macOS, Linux or embedding it as the UI toolkit for a platform of your choice.

Beautiful user experiences

We want to enable designers to deliver their full creative vision without being forced to water it down due to limitations of the underlying framework. Flutter's layered architecture gives you control over every pixel on the screen and its powerful compositing capabilities let you overlay and animate graphics, video, text, and controls without limitation. Flutter includes a full set of widgets that deliver pixel-perfect experiences whether you're building for iOS (Cupertino) or other platforms (Material), along with support for customizing or creating entirely new visual components.

Reflectly hero image

Fast results

Flutter is fast. It's powered by hardware-accelerated 2D graphics libraries like Skia (which underpins Chrome and Android) and Impeller. We architected Flutter to support glitch-free, jank-free graphics at the native speed of your device.

Flutter code is powered by the world-class Dart platform, which enables compilation to 32-bit and 64-bit ARM machine code for iOS and Android, JavaScript and WebAssembly for the web, as well as Intel x64 and ARM for desktop devices.

Dart diagram

Productive development

Flutter offers stateful hot reload, allowing you to make changes to your code and see the results instantly without restarting your app or losing its state.

Hot reload animation

Extensible and open model

Flutter works with any development tool (or none at all), and also includes editor plug-ins for both Visual Studio Code and IntelliJ / Android Studio. Flutter provides tens of thousands of packages to speed your development, regardless of your target platform. And accessing other native code is easy, with support for both FFI (on Android, on iOS, on macOS, and on Windows) as well as platform-specific APIs.

Flutter is a fully open-source project, and we welcome contributions. Information on how to get started can be found in our contributor guide.