Skip to content
pubscout

sdl3

3.1.4, released 9 days ago by an unverified publisher

Dart library for accessing SDL3 and related APIs via FFI.

$ flutter pub add sdl3
Source repository

What it does

Provides FFI bindings to SDL3 and its extension libraries (SDL3_image, SDL3_mixer, SDL3_net, SDL3_ttf, SDL3_gfx, SDL3_shadercross) for Dart applications. It enables cross-platform handling of windows, graphics, audio, input devices, and game logic.

AI-written summary of version 3.1.3, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You are building a game or multimedia application in Dart that requires low-level control over rendering and hardware.
  • You want to use SDL3 features and optional extension libraries through FFI on 64-bit desktop or mobile platforms.

Skip it when

  • You need support for 32-bit systems (the library is limited to 64bit).
  • You are building standard cross-platform UI apps using Flutter's built-in widget tree and framework.

Strengths

  • Comprehensive coverage of SDL3 structures and functions.
  • Includes support for SDL3 extensions like image, mixer, net, ttf, and shadercross.
  • Modern immutable design patterns with Arena memory management.

Weaknesses

  • Limited to 64-bit environments.
  • Requires manual provisioning of native shared libraries (.dll, .so, or .dylib) depending on the target OS.

Setup

Kind
FFI (native library)
Effort
High
Code generation
No
Direct dependencies
2

Requires ensuring native 64-bit dynamic libraries for SDL3 and any optional modules (SDL3_image, SDL3_mixer, etc.) are available in the runtime environment for Windows, Linux, Android, or macOS.

import 'package:sdl3/sdl3.dart';
import 'package:sdl3/sdl3gfx.dart';
import 'package:sdl3/sdl3opengl.dart';

if (sdlInit(SDL_INIT_VIDEO)) {
  // success
}

Works with

Packages commonly used together with sdl3: ones it builds on, ones built on it, and its own family.