BaseMaterialWidget constructor

BaseMaterialWidget({
  1. Key? key,
  2. required Widget child,
  3. ThemeData? theme,
  4. InteractiveInkFeatureFactory? splashFactory,
  5. bool enableLiquidGlass = true,
  6. bool enableEnvironmentalAwareness = true,
  7. bool enableHapticFeedback = true,
  8. MaterialType materialType = MaterialType.transparency,
  9. Color? surfaceColor,
  10. double? elevation,
  11. BorderRadius? borderRadius,
  12. EdgeInsetsGeometry? padding,
  13. Duration animationDuration = const Duration(milliseconds: 300),
  14. Curve animationCurve = Curves.easeOutCubic,
})

Legacy constructor with iOS 26 Liquid Glass enhancements

Implementation

BaseMaterialWidget({
  Key? key,
  required Widget child,
  this.theme,
  InteractiveInkFeatureFactory? splashFactory,
  this.enableLiquidGlass = true,
  this.enableEnvironmentalAwareness = true,
  this.enableHapticFeedback = true,
  this.materialType = MaterialType.transparency,
  this.surfaceColor,
  this.elevation,
  this.borderRadius,
  this.padding,
  this.animationDuration = const Duration(milliseconds: 300),
  this.animationCurve = Curves.easeOutCubic,
})  : assert(child != null, 'child can not be null.'),
      assert(
          (theme == null && splashFactory == null) ||
              (theme != null && splashFactory != null),
          'theme and factory must be the same value.'),
      child = (theme != null && splashFactory != null)
          ? _buildThemedChild(child, theme, splashFactory)
          : child,
      splashFactory = splashFactory ?? InkRipple.splashFactory,
      super(key: key);