4 Development
Niels Franke edited this page 2026-11-23 11:08:57 +01:00

Development

Cullimingo is one Flutter codebase targeting macOS, Linux and Windows. Heavy work — decode, encode, hash, large file I/O, XMP — runs on a background isolate pool; the UI isolate only ever receives results.

Toolchain

  • Flutter 3.44.x (stable, Impeller) · Dart 3.12+
  • State: Riverpod 3 with codegen (@riverpod)
  • Read model: drift (typed SQLite); the filesystem + XMP sidecars are the durable truth
  • RAW: LibRaw via C/C++ FFI (no Rust) · thumbnails: libvips

Native dependencies

Every platform needs LibRaw and libvips for RAW/thumbnail decode:

# macOS
brew install libraw vips        # plus Xcode + CocoaPods

# Debian/Ubuntu
sudo apt install clang cmake ninja-build pkg-config libgtk-3-dev \
     liblzma-dev libstdc++-12-dev libraw-dev libvips-dev

Windows: install the Visual Studio 2022 Build Tools with the Desktop development with C++ workload and the individual component C++ ATL for latest v143 build tools (flutter_secure_storage needs atlstr.h; the workload's recommended set doesn't include it), and switch on Developer Mode (Settings → System → For developers) — Flutter plugins need symlinks. The native libs come from libvips' official build-win64-mxe vips-dev-x64-all-<version>.zip, which also ships LibRaw (libraw_r-25.dll): copy its bin\*.dll next to build\windows\x64\runner\<Debug|Release>\cullimingo.exe.

Linux also needs libsecret-1-0 at runtime (delivery-server passwords go through the platform secret store) and udisks2/util-linux (udisksctl, lsblk) for auto-mounting a freshly inserted card on desktops that don't do it themselves — both are already present on most desktop distros.

Run

flutter pub get
dart run build_runner watch --delete-conflicting-outputs   # keep running
flutter run -d macos      # or: -d linux / -d windows

Keep build_runner watch running: after editing any @riverpod, freezed, drift table or JSON model it regenerates the *.g.dart / *.freezed.dart files. Never hand-edit generated files.

Before every commit

Enforced by the lefthook git hooks:

dart format lib test && flutter analyze && flutter test

Build

flutter build macos      # or: flutter build linux / flutter build windows

Linux release builds also need the native libs (LibRaw/libvips/libheif) bundled into the app — tool/bundle_linux.sh, then optionally tool/build_appimage.sh to package an AppImage. macOS has the equivalent tool/bundle_macos.sh; on Windows tool/bundle_windows.ps1 stages the DLLs and the VC++ runtime and builds the unsigned setup, MSI and portable zip. See Distribution.

The bundled GeoNames gazetteer (reverse geocoding) and IPTC Media Topics list (Subject Code autocomplete) are pre-generated into assets/; regenerate them with tool/build_gazetteer.sh / tool/build_media_topics.sh if the source data changes.

Where things live

Feature-first + layered: core/, features/<name>/{data,domain,presentation}, shared/. See ARCHITECTURE.md for the full map and BUILD_PLAN.md for the phased plan and stack rationale.