Flutter Tutorial

Flutter Intermediate Lesson 118 of 135 3 min read

Publish Your Flutter Game: Performance, Testing and App Stores

Get a Flutter Flame game ready to publish: performance tips, device testing, orientation and releasing to Google Play, the App Store, web and itch.io.

On this page

Your game works. This lesson is the checklist for turning it into something other people can download and enjoy.

1. Performance

Games redraw every frame, so small waste adds up.

  • Build in release mode to judge speed: flutter run --release. Debug mode is much slower.
  • Remove what is off screen. Bullets, enemies and particles that leave the play area should call removeFromParent().
  • Reuse instead of creating. For things created constantly (bullets), keep a pool and reset them instead of making new objects. Flame has ComponentPool for this.
  • Load images once in onLoad and reuse them; never load inside update.
  • Use passive hitboxes for things that never need to test each other (walls, coins).
  • Avoid work in render. Create Paint objects once as fields, not in every frame.
  • Check the frame rate with FpsTextComponent() during development.

2. Screens and devices

  • Use a fixed resolution camera so the game looks the same on every screen.
  • Lock the orientation if your game is portrait or landscape only:
// Not standalone: add your own MyGame class.
import 'package:flame/flame.dart';
import 'package:flame/game.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
  await Flame.device.fullScreen(); // hide the system bars
  runApp(GameWidget(game: MyGame()));
}
  • Test on a slow, old phone, not only on your computer.
  • Add on-screen controls for touch devices; do not rely on a keyboard.

3. Polish before release

  • A main menu, pause and game over screen (overlays).
  • Sound with a mute option (sound and music).
  • A saved high score (saving).
  • An app icon, name and splash screen (app icon and splash).
  • Pause the game when the app goes to the background (Flame does this for the engine; also pause your music).

4. Where to publish

PlatformHowLesson
Google Playflutter build appbundleRelease for Android
Apple App Storeflutter build ipa (needs a Mac)Release for iOS
Webflutter build web, upload the build/web folderWeb and desktop
itch.ioZip build/web and upload as an HTML5 gameitch.io
Windows / macOS / Linuxflutter build windows (or macos, linux)Web and desktop

itch.io is the easiest place to share your first web game with friends and get feedback: it is free, and players can play in the browser.

5. After release

  • Ask players for feedback and watch where they get stuck.
  • Add analytics events (level reached, game over reason) to see what to improve.
  • Update regularly: a new level or a daily challenge brings players back.

Try it yourself

Take one of the game projects, add a menu, sound and a high score, build it for the web, and upload it to itch.io. Share the link with a friend.

Practise in the playground Updated