ThreeModel constructor

ThreeModel({
  1. required String name,
  2. required Function startARSession,
  3. required ThreeScene scene,
})

Creates a new instance of ThreeModel.

  • name: A non-empty string representing the name of the 3D model.
  • startARSession: A function that encapsulates the logic for initiating an AR session for the model.
  • scene: An instance of ThreeScene representing the 3D scene/model.

An assertion checks that the provided name is non-empty to ensure model identification.

Implementation

ThreeModel({
  required this.name,
  required this.startARSession,
  required this.scene,
}) : assert(name.isNotEmpty, 'Model name must not be empty.');