buttonStaticMethodStub function

String buttonStaticMethodStub(
  1. ReCase rc
)

This stub is used to create a static method in the Button class.

Implementation

String buttonStaticMethodStub(ReCase rc) => '''
  /// ${rc.titleCase} button
  static Widget ${rc.camelCase}({
    required String text,
    VoidCallback? onPressed,
    (dynamic, Function(dynamic data))? submitForm,
    Function(dynamic error)? onFailure,
    bool showToastError = true,
    Color? backgroundColor,
    double? width,
  }) {
    return ${rc.pascalCase}Button(
      text: text,
      onPressed: onPressed,
      submitForm: submitForm,
      onFailure: onFailure,
      showToastError: showToastError,
      loadingStyle: LoadingStyle.skeletonizer(),
      backgroundColor: backgroundColor,
      width: width,
      height: _buttonHeight,
      animationStyle: ButtonAnimationStyle.clickable(),
    );
  }
''';