Surface constructor

const Surface(
  1. {double width,
  2. double height,
  3. Color color = _DEFAULT_COLOR,
  4. bool disableBorder = false,
  5. bool tappable = true,
  6. SurfaceCorners corners = SurfaceCorners.ROUND,
  7. double radius,
  8. double borderThickness = 3.0,
  9. Color borderColor = _DEFAULT_COLOR_BORDER,
  10. AlignmentGeometry borderAlignment,
  11. double borderRatio = 2.0,
  12. Gradient gradient,
  13. Gradient borderGradient,
  14. Color inkSplashColor,
  15. Color inkHighlightColor,
  16. SurfaceFilter filterStyle = SurfaceFilter.NONE,
  17. Duration duration = _DEFAULT_DURATION,
  18. Curve curve = Curves.easeIn,
  19. bool providesFeedback = false,
  20. EdgeInsets margin = const EdgeInsets.all(0),
  21. EdgeInsets padding = const EdgeInsets.all(0),
  22. SurfacePadding paddingStyle = SurfacePadding.PAD_CHILD,
  23. bool flipBevels = false,
  24. double filterSurfaceBlur = _DEFAULT_BLUR,
  25. double filterMaterialBlur = _DEFAULT_BLUR,
  26. double filterChildBlur = _DEFAULT_BLUR,
  27. VoidCallback onTap,
  28. Widget child}
)

Implementation

const Surface({
  this.width,
  this.height,
  this.color = _DEFAULT_COLOR,
  this.disableBorder = false,
  this.tappable = true,
  this.corners = SurfaceCorners.ROUND,
  this.radius,
  this.borderThickness = 3.0,
  this.borderColor = _DEFAULT_COLOR_BORDER,
  this.borderAlignment,
  this.borderRatio = 2.0,
  this.gradient,
  this.borderGradient,
  this.inkSplashColor,
  this.inkHighlightColor,
  this.filterStyle = SurfaceFilter.NONE,
  this.duration = _DEFAULT_DURATION,
  this.curve = Curves.easeIn,
  this.providesFeedback = false,
  this.margin = const EdgeInsets.all(0),
  this.padding = const EdgeInsets.all(0),
  this.paddingStyle = SurfacePadding.PAD_CHILD,
  this.flipBevels = false,
  this.filterSurfaceBlur = _DEFAULT_BLUR,
  this.filterMaterialBlur = _DEFAULT_BLUR,
  this.filterChildBlur = _DEFAULT_BLUR,
  this.onTap,
  this.child,
})  : assert((radius ?? 0) >= 0,
          '[Surface] > Please provide a non-negative [borderRadius].'),
      assert((borderThickness ?? 0) >= 0,
          '[Surface] > Please provide a non-negative [borderThickness].'),

      /// See ***WARNING*** above about [filterStyle] and [filterBorderBlur] value.
      assert(
          ((filterStyle == SurfaceFilter.TRILAYER)
                  ? (filterSurfaceBlur >= _MINIMUM_BLUR &&
                      filterMaterialBlur >= _MINIMUM_BLUR)
                  : true) ||
              ((filterStyle == SurfaceFilter.INNER_BILAYER)
                  ? (filterMaterialBlur >= _MINIMUM_BLUR)
                  : true) ||
              ((filterStyle == SurfaceFilter.SURFACE_AND_CHILD)
                  ? (filterSurfaceBlur >= _MINIMUM_BLUR)
                  : true) ||
              ((filterStyle == SurfaceFilter.SURFACE_AND_MATERIAL)
                  ? (filterSurfaceBlur >= _MINIMUM_BLUR)
                  : true),
          '[Surface] > Upper-layered filters will be negated if ancestor filters are enabled that have radius < 0.0003. Increase blur radius of lower layer(s) or pass a different [filterStyle].');