fledge_window 0.1.10 copy "fledge_window: ^0.1.10" to clipboard
fledge_window: ^0.1.10 copied to clipboard

Window management plugin for the Fledge ECS game framework. Provides fullscreen, borderless, and windowed modes with runtime switching.

example/example.dart

// ignore_for_file: avoid_print
import 'package:fledge_ecs/fledge_ecs.dart';
import 'package:fledge_window/fledge_window.dart';

void main() async {
  // Start in borderless fullscreen
  final app = App()
    ..addPlugin(TimePlugin())
    ..addPlugin(WindowPlugin.borderless(title: 'My Game'));

  // Or other modes:
  // WindowPlugin.fullscreen(title: 'My Game')
  // WindowPlugin.windowed(title: 'My Game', size: Size(1280, 720))

  await app.tick();

  // Toggle window modes at runtime:
  // app.world.toggleFullscreen();
  // app.world.toggleBorderless();
  // app.world.cycleWindowMode();
  // app.world.setWindowMode(WindowMode.windowed);

  // Query window state:
  final state = app.world.windowState;
  if (state != null) {
    print('Window mode: ${state.mode}');
    print('Window size: ${state.size}');
  }

  // Listen for window events in a system:
  // for (final event in world.eventReader<WindowModeChanged>().read()) {
  //   print('Mode: ${event.previousMode} -> ${event.newMode}');
  // }
  //
  // for (final event in world.eventReader<WindowFocusChanged>().read()) {
  //   if (!event.isFocused) {
  //     // Pause game
  //   }
  // }

  print('Window plugin configured');
}
0
likes
160
points
382
downloads

Publisher

verified publisherfledge-framework.dev

Weekly Downloads

Window management plugin for the Fledge ECS game framework. Provides fullscreen, borderless, and windowed modes with runtime switching.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#ecs #game-engine #window-management #fullscreen #flutter-games

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

fledge_ecs, flutter, screen_retriever, window_manager

More

Packages that depend on fledge_window