buildByCupertino method

  1. @override
Widget buildByCupertino(
  1. BuildContext context
)

build on cupertino mode (Flutter implementation)

Implementation

@override
Widget buildByCupertino(BuildContext context) {
  final Widget _child = _buildContent();
  final CupertinoThemeData cupertinoTheme = CupertinoTheme.of(context);
  final Widget content = Container(
    key: key,
    decoration: BoxDecoration(
      border: valueOf('border', border),
    ),
    padding: valueOf('contentPadding', contentPadding) ?? const EdgeInsets.symmetric(horizontal: 10.0),
    child: DefaultTextStyle(
      style: cupertinoTheme.textTheme.textStyle.copyWith(fontSize: 16.0),
      child: _child,
    ),
  );
  final BaseThemeData _baaseTheme = BaseTheme.of(context);
  Color? _backgroundColor = valueOf('backgroundColor', backgroundColor) ?? _baaseTheme.tileBackgroundColor;
  if (_backgroundColor != null) {
    if (_backgroundColor is CupertinoDynamicColor) {
      _backgroundColor = _backgroundColor.resolveFrom(context);
    }
  } else {
    _backgroundColor = CupertinoColors.secondarySystemGroupedBackground.resolveFrom(context);
  }
  return Material(
    animationDuration: const Duration(milliseconds: 10),
    color: _backgroundColor,
    borderOnForeground: false,
    child: Ink(
      child: InkWell(
        radius: 0.0,
        borderRadius: valueOf(
              'borderRadius',
              borderRadius,
            ) ??
            BorderRadius.zero,
        child: Semantics(
          child: SafeArea(
            top: false,
            bottom: false,
            child: content,
          ),
        ),
        splashColor: valueOf('splashColor', splashColor),
        highlightColor: valueOf('highlightColor', highlightColor),
        onTap: valueOf('onTap', onTap),
        onLongPress: valueOf('onLongPress', onLongPress),
        focusColor: Colors.transparent,
        hoverColor: Colors.transparent,
      ),
    ),
  );
}