Skip to content

Instantly share code, notes, and snippets.

@aklehm
aklehm / README.md
Last active September 10, 2025 08:03
Flutter iOS to release build

Description

When using Flutter 3.22+ (including 3.35.1) on macOS, developers may encounter the following issue when trying to create an archive in Xcode:

Your Flutter project is currently configured for debug mode.
Please run `flutter build ios --config-only --release` in your Flutter project to update your settings.

This happens because Flutter regenerates ios/Flutter/Generated.xcconfig with

@aklehm
aklehm / measure_util.dart
Created October 24, 2023 07:21
Util to measure the size of a flutter widget before build.
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
/// Small utility to measure a widget before actually putting it on screen.
///
/// This can be helpful e.g. for positioning context menus based on the size they will take up.
///
/// NOTE: Use sparingly, since this takes a complete layout and sizing pass for the subtree you
/// want to measure.
///
import 'package:flutter/material.dart';
import 'dart:async';
import 'dart:math';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.