BaseMaterialWidget constructor
BaseMaterialWidget({
- Key? key,
- required Widget child,
- ThemeData? theme,
- InteractiveInkFeatureFactory? splashFactory,
- bool enableLiquidGlass = true,
- bool enableEnvironmentalAwareness = true,
- bool enableHapticFeedback = true,
- MaterialType materialType = MaterialType.transparency,
- Color? surfaceColor,
- double? elevation,
- BorderRadius? borderRadius,
- EdgeInsetsGeometry? padding,
- Duration animationDuration = const Duration(milliseconds: 300),
- 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);