getEffect method

SurfaceEffect getEffect(
  1. BuildContext context
)

Implementation

SurfaceEffect getEffect(BuildContext context) {
  ArcaneTheme theme = ArcaneTheme.of(context);
  SurfaceEffect s = mode ?? theme.surfaceEffect;

  if (!s.compatible) {
    s = backupMode ?? theme.backupSurfaceEffect;
  }

  if (!s.compatible) {
    throw Exception(
        "No compatible surface effect found. The backupSurfaceEffect is supposed to be compatible with anything!!!");
  }

  return s;
}