Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
707 B
2
Indexable
import 'package:flutter/material.dart';

Widget widgetIcon(
    {required IconData icon,
    required Function function,
    Color? color,
    Color? backGroundColor,
    double? size,
    Function? onLongPress}) {
  return SizedBox(
    height: 55,
    width: 55,
    child: ElevatedButton(
        style: ButtonStyle(
            backgroundColor:
                MaterialStateProperty.all(backGroundColor ?? Colors.white24),
            elevation: MaterialStateProperty.all(0)),
        child: FittedBox(
          child: Icon(
            icon,
            color: color ?? Colors.white,
          ),
        ),
        onPressed: () {
          function();
        }),
  );
}