shadows static method

String shadows(
  1. DesignTokens tokens
)

Implementation

static String shadows(DesignTokens tokens) {
  final r = tokens.recipe;
  return '''
import 'package:flutter/material.dart';

import 'app_colors.dart';

/// Shadow recipes. Prefer [AppShadowTheme] from the current [ThemeData].
class AppShadows {
AppShadows._();

static List<BoxShadow> get flat => const <BoxShadow>[];

static const List<BoxShadow> low = <BoxShadow>[
      BoxShadow(
        color: AppColors.shadowDark,
        offset: Offset(0, ${r.shadowOffset}),
        blurRadius: ${r.shadowBlur},
        spreadRadius: ${r.shadowSpread},
      ),
    ];

static const List<BoxShadow> medium = <BoxShadow>[
      BoxShadow(
        color: AppColors.shadowDark,
        offset: Offset(0, ${r.shadowOffset + 2}),
        blurRadius: ${r.shadowBlur + 4},
        spreadRadius: ${r.shadowSpread},
      ),
    ];

static const List<BoxShadow> high = <BoxShadow>[
      BoxShadow(
        color: AppColors.shadowDark,
        offset: Offset(0, ${r.shadowOffset + 4}),
        blurRadius: ${r.shadowBlur + 10},
        spreadRadius: ${r.shadowSpread},
      ),
    ];

static const List<BoxShadow> floating = high;

static const List<BoxShadow> neoRaised = <BoxShadow>[
      BoxShadow(
        color: AppColors.shadowLight,
        offset: Offset(-${r.neoOffset}, -${r.neoOffset}),
        blurRadius: ${r.neoBlur},
      ),
      BoxShadow(
        color: AppColors.shadowDark,
        offset: Offset(${r.neoOffset}, ${r.neoOffset}),
        blurRadius: ${r.neoBlur},
      ),
    ];

static const List<BoxShadow> neoInset = <BoxShadow>[
      BoxShadow(
        color: AppColors.shadowDark,
        offset: Offset(${r.neoOffset / 2}, ${r.neoOffset / 2}),
        blurRadius: ${r.neoBlur / 2},
      ),
      BoxShadow(
        color: AppColors.shadowLight,
        offset: Offset(-${r.neoOffset / 2}, -${r.neoOffset / 2}),
        blurRadius: ${r.neoBlur / 2},
      ),
    ];

static const List<BoxShadow> hardOffset = <BoxShadow>[
      BoxShadow(
        color: AppColors.textPrimary,
        offset: Offset(${r.hardShadowOffset}, ${r.hardShadowOffset}),
        blurRadius: 0,
      ),
    ];

static const List<BoxShadow> clay = <BoxShadow>[
      BoxShadow(
        color: AppColors.shadowDark,
        offset: Offset(0, ${r.shadowOffset}),
        blurRadius: ${r.shadowBlur},
        spreadRadius: ${r.shadowSpread},
      ),
      BoxShadow(
        color: AppColors.shadowLight,
        offset: Offset(0, -${r.shadowOffset / 2}),
        blurRadius: ${r.shadowBlur / 2},
      ),
    ];
}
''';
}