📱

Overview of Flutter UI Framework

May 20, 2025

Flutter UI Framework Overview

Introduction

  • Flutter is a UI framework for building apps across platforms (iOS, Android, Web, Desktop).
  • Combines a high-performance graphics engine with the Dart programming language.

Core Features of Dart in Flutter

  • Full type safety: Ensures reliability in app development.
  • Stateful hot reload: Speeds up development by allowing developers to see changes instantly.
  • Compilation to native machine code: Ensures smooth rendering on any platform.

Getting Started with Flutter

  • Installation: Install Flutter and use the command flutter create to start a new project.
  • Main Dart File: The primary location for app development.

Flutter UI Structure

  • Widgets: The UI is a tree of widgets. Everything in Flutter is a widget.
    • Pre-built widgets: Flutter provides hundreds of widgets for animations, scrolling, responsive layouts, etc.
    • Custom Widgets: Create by extending the StatelessWidget class and overriding the build method.

Stateless vs Stateful Widgets

  • Stateless Widgets
    • Immutable, no internal data.
    • UI rebuilds in response to input data changes.
  • Stateful Widgets
    • Used for interactive elements where internal data changes.
    • Use setState to update data and re-render the UI.

Developing with Flutter

  • Development Commands:
    • flutter run: Test the app on a real device.
    • Control + Shift + R: Wrap elements with other widgets in the IDE.
  • Hot Reload: Use the r command to quickly reload changes without losing the app state.

Example Modifications

  • Centering a Button: Use a Center widget wrapper.
  • Changing Button Color: Preview changes directly in the IDE.

Conclusion

  • Flutter provides an efficient and enjoyable developer experience with quick UI updates and reliable performance.
  • For further learning, check out courses like the Flutter Firebase course on Fire Ship i/o.