FynkelView.world constructor

const FynkelView.world(
  1. World world, {
  2. Key? key,
  3. void onFrame(
    1. double dt
    )?,
  4. double renderScale = 1.0,
  5. void onStats(
    1. FynkelViewStats stats
    )?,
  6. void onViewStats(
    1. ViewStats stats
    )?,
  7. FocusNode? focusNode,
  8. bool autofocus = true,
  9. bool showErrors = kDebugMode,
  10. bool pauseWhenCovered = true,
  11. Camera? camera,
  12. bool input = true,
  13. bool worldWidgets = true,
  14. bool directToScreen = true,
  15. void onError(
    1. Object error,
    2. StackTrace stack
    )?,
  16. Widget errorBuilder(
    1. BuildContext context,
    2. Object error,
    3. VoidCallback retry
    )?,
})

Shows world, made and driven by hand: the caller disposes of it.

Implementation

const FynkelView.world(
  World this.world, {
  super.key,
  this.onFrame,
  this.renderScale = 1.0,
  this.onStats,
  this.onViewStats,
  this.focusNode,
  this.autofocus = true,
  this.showErrors = kDebugMode,
  this.pauseWhenCovered = true,
  this.camera,
  this.input = true,
  this.worldWidgets = true,
  this.directToScreen = true,
  this.onError,
  this.errorBuilder,
}) : root = null,
     source = null,
     assert(
       renderScale > 0 && renderScale <= 4,
       'FynkelView.renderScale is $renderScale: give one above 0 and at most 4 (1 draws every pixel)',
     );