MaterialStageSource constructor

const MaterialStageSource({
  1. required String name,
  2. bool fragment = false,
  3. ShaderStageKind? kind,
  4. required String glsl,
})

A stage of kind; without one, a fragment stage when fragment is true and a vertex stage otherwise.

Implementation

const MaterialStageSource({
  required this.name,
  bool fragment = false,
  ShaderStageKind? kind,
  required this.glsl,
}) : assert(
       kind == null || !fragment || identical(kind, ShaderStageKind.fragment),
       'a stage named fragment and given another kind',
     ),
     kind =
         kind ??
         (fragment ? ShaderStageKind.fragment : ShaderStageKind.vertex),
     fragment = kind == null
         ? fragment
         : identical(kind, ShaderStageKind.fragment);