appBarActionButtonCircle method

Widget appBarActionButtonCircle(
  1. BuildContext context,
  2. IconData icon, {
  3. Function? onTap,
  4. bool loading = false,
})

Implementation

Widget appBarActionButtonCircle(BuildContext context, IconData icon,
    {Function? onTap, bool loading = false}) {
  return Container(
    margin: EdgeInsets.only(right: DUI.spacing.lateralPaddingValue),
    child: Ink(
      decoration: ShapeDecoration(
        color: Theme.of(context).colorScheme.background,
        shape: const CircleBorder(),
      ),
      child: IconButton(
        icon: loading
            ? DUI.misc.loadingAnimation(context, size: 16)
            : Icon(icon),
        onPressed: () async {
          if (onTap != null) {
            onTap();
          }
        },
      ),
    ),
  );
}