Core Differences

  • MaterialApp implements Google’s Material Design language, providing Android-style UI components and behaviors. It’s the default choice for most Flutter apps.
  • CupertinoApp implements Apple’s iOS design language, offering iOS-style components and interactions that feel native on Apple devices.

MaterialApp

  • Provides Material Design (Google’s design language).
  • Used for Android-style apps or apps with a Material Design look.
  • Includes widgets like Scaffold, AppBar, Drawer, FloatingActionButton, etc.
  • Commonly used on Android, but can also be used on iOS.
  • Uses ThemeData for theming.
import 'package:flutter/material.dart';
void main() => runApp(MaterialApp(
  home: MyHomePage(),
));

CupertinoApp

  • Provides Cupertino-style (iOS) UI components.
  • Used for apps that aim to look native on iOS.
  • Includes widgets like CupertinoPageScaffold, CupertinoNavigationBar, etc.
  • Uses CupertinoThemeData for styling.
import 'package:flutter/cupertino.dart';
void main() => runApp(CupertinoApp(
  home: MyHomePage(),
));

Adaptive Design

Flutter allows you to mix and match. Use MaterialApp as a base and selectively use Cupertino widgets for iOS:

Widget build(BuildContext context) {
  return Platform.isIOS
      ? CupertinoPageScaffold(
          navigationBar: CupertinoNavigationBar(
            middle: Text('iOS App'),
          ),
          child: MyContent(),
        )
      : Scaffold(
          appBar: AppBar(title: Text('Android App')),
          body: MyContent(),
        );
}

Choosing Between Them:

  • Use MaterialApp for apps targeting Android, web, or a general cross-platform audience with a Material look.
  • Use CupertinoApp for apps targeting iOS or requiring an iOS-like experience.
  • You can mix Material and Cupertino widgets (using CupertinoButton in a MaterialApp), but this can lead to inconsistent UI unless carefully managed.

Need Help With Flutter Development?

Work with our skilled Flutter developers to accelerate your project and boost its performance.

Hire Flutter Developers

Support On Demand!

Related Q&A