customtimerbutton 0.0.1 copy "customtimerbutton: ^0.0.1" to clipboard
customtimerbutton: ^0.0.1 copied to clipboard

retractedoutdated

Cool flutter package of Time Button.

Example #

there are a number of properties that you can modify

  • color
  • disabledColor,
  • buttonType
  • activeTextStyle,
  • disabledTextStyle
  • borderRadius,
  • textAlign,
  • shape,
  • elevation
  • width,
  • height,

class TimerButton extends StatelessWidget {
  const TimerButton({
    Key? key,
    required String label,
    required TextAlign textAlign,
    required String disabledLabel,
    required Color color,
    ShapeBorder? shape,
    double? width,
    required int height,
    required int timeOutInSeconds,
    required int elevation,
    BorderRadius? borderRadius,
    required void Function() onPressed,
    required TextStyle disabledTextStyle,
    required TextStyle activeTextStyle,
    required ButtonType buttonType,
  }) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Timer Button'),
      ),
      body: Center(
        child: ctmTimeButtom(
            text: 'Resend verification mail',
            disableText: 'Resend in',
            width: size(context).width * 0.53,
            onPressed: () {},
            time: 180,
            shape: const RoundedRectangleBorder(
                borderRadius: BorderRadius.only(
                    topLeft: Radius.circular(20),
                    bottomLeft: Radius.circular(20))),
            borderRadius: const BorderRadius.only(
                topLeft: Radius.circular(20), bottomLeft: Radius.circular(20))),
      ),
    );
  }

  // custom Timeer button
  Widget ctmTimeButtom({
    required final String text,
    required final String disableText,
    final Color? color,
    required void Function() onPressed,
    final BorderRadius? borderRadius,
    final double? width,
    final ShapeBorder? shape,
    final double? elevation,
    int? time,
  }) {
    return TimerButton(
      label: text,
      textAlign: TextAlign.center,
      disabledLabel: disableText,
      color: color ?? Colors.red,
      shape: shape,
      width: width,
      height: 55,
      timeOutInSeconds: time ?? 5,
      elevation: 18,
      borderRadius: borderRadius,
      onPressed: onPressed,
      disabledTextStyle: const TextStyle(
        fontSize: 17,
        color: Colors.black38,
        fontWeight: FontWeight.bold,
      ),
      activeTextStyle: const TextStyle(
        color: Colors.white,
        fontSize: 17,
        fontWeight: FontWeight.bold,
      ),
      buttonType: ButtonType.CupertinoButton,
    );
  }
}

[]
2
likes
0
points
64
downloads

Publisher

unverified uploader

Weekly Downloads

Cool flutter package of Time Button.

Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (license)

Dependencies

flutter

More

Packages that depend on customtimerbutton