import 'package:flutter/foundation.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter/material.dart';
import 'package:llswidget/llswidget.dart';

class LLSSocialButton extends LLSButton {
  const LLSSocialButton({
    Key? key,
    required this.onPressed,
    this.onHighlightChanged,
    this.textStyle,
    this.boxShadow,
    this.buttonBoxShadow,
    this.focusColor,
    this.hoverColor,
    this.highlightColor,
    this.splashColor,
    this.elevation = 0.0,
    this.focusElevation = 4.0,
    this.hoverElevation = 4.0,
    this.highlightElevation = 1.0,
    this.disabledElevation = 0.0,
    this.padding = const EdgeInsets.symmetric(horizontal: 8),
    this.constraints,
    this.borderShape,
    this.animationDuration = kThemeChangeDuration,
    this.clipBehavior = Clip.none,
    this.focusNode,
    this.autofocus = false,
    MaterialTapTargetSize? materialTapTargetSize,
    this.child,
    this.type = LLSButtonType.solid,
    this.shape = LLSButtonShape.standard,
    this.color = LLSColors.PRIMARY,
    this.textColor,
    this.position = LLSPosition.start,
    this.size = LLSSize.MEDIUM,
    this.borderSide,
    this.text,
    this.icon,
    this.blockButton,
    this.fullWidthButton,
    this.colorScheme,
    this.enableFeedback,
    this.onLongPress,
    this.disabledColor,
    this.disabledTextColor,
  })  : materialTapTargetSize =
            materialTapTargetSize ?? MaterialTapTargetSize.padded,
        // assert(elevation != null && elevation >= 0.0),
        assert(focusElevation >= 0.0),
        assert(hoverElevation >= 0.0),
        assert(highlightElevation >= 0.0),
        assert(disabledElevation >= 0.0),
        super(
          key: key,
          onPressed: onPressed,
        );

  @override
  final VoidCallback? onPressed;

  @override
  final ValueChanged<bool>? onHighlightChanged;

  @override
  final TextStyle? textStyle;

  @override
  final BorderSide? borderSide;

  @override
  final BoxShadow? boxShadow;

  @override
  final Color? focusColor;

  @override
  final Color? hoverColor;

  @override
  final Color? highlightColor;

  @override
  final Color? splashColor;

  @override
  final double elevation;

  @override
  final double hoverElevation;

  @override
  final double focusElevation;

  @override
  final double highlightElevation;

  @override
  final double disabledElevation;

  @override
  final EdgeInsetsGeometry padding;

  @override
  final BoxConstraints? constraints;

  @override
  final ShapeBorder? borderShape;

  @override
  final Duration animationDuration;

  @override
  final Widget? child;

  @override
  bool get enabled => onPressed != null;

  @override
  final MaterialTapTargetSize materialTapTargetSize;

  @override
  final FocusNode? focusNode;

  @override
  final bool autofocus;

  @override
  final Clip clipBehavior;

  @override
  final LLSButtonType type;

  @override
  final LLSButtonShape shape;

  @override
  final Color color;

  @override
  final Color? disabledColor;

  @override
  final Color? textColor;

  @override
  final Color? disabledTextColor;

  @override
  final double size;

  @override
  final String? text;

  @override
  final Widget? icon;

  @override
  final LLSPosition position;

  @override
  final bool? blockButton;

  @override
  final bool? fullWidthButton;

  @override
  final bool? buttonBoxShadow;

  @override
  final ColorScheme? colorScheme;

  @override
  final bool? enableFeedback;

  @override
  final VoidCallback? onLongPress;

  Widget build(BuildContext context) => LLSButton(
    onPressed: onPressed,
    onHighlightChanged: onHighlightChanged,
    textStyle: textStyle,
    boxShadow: boxShadow,
    buttonBoxShadow: buttonBoxShadow,
    focusColor: focusColor,
    hoverColor: hoverColor,
    highlightColor: highlightColor,
    splashColor: splashColor,
    elevation: elevation,
    focusElevation: focusElevation,
    hoverElevation: hoverElevation,
    highlightElevation: highlightElevation,
    disabledElevation: disabledElevation,
    constraints: constraints,
    borderShape: borderShape,
    animationDuration: animationDuration,
    clipBehavior: clipBehavior,
    focusNode: focusNode,
    autofocus: autofocus,
    child: child,
    type: LLSButtonType.solid,
    shape: LLSButtonShape.standard,
    color: LLSColors.PRIMARY,
    textColor: textColor,
    position: LLSPosition.start,
    size: size,
    borderSide: borderSide,
    text: text,
    icon: icon,
    blockButton: blockButton,
    fullWidthButton: fullWidthButton,
    disabledColor: disabledTextColor,
    disabledTextColor: disabledColor,
  );
}
