commonToolBar method

Widget commonToolBar({
  1. required Widget child,
  2. required BuildContext context,
})

Implementation

Widget commonToolBar ({
  required Widget child,
  required BuildContext context
}){
  return Container(
    padding: EdgeInsets.only(
      left: 16,
      right: 16,
      bottom: MediaQuery.of(context).padding.bottom + 20,
    ),
    color: Colors.black,
    child: Row(
      crossAxisAlignment:CrossAxisAlignment.end,
      children: [
        IconButton(
          highlightColor: Colors.grey[800] ,
          onPressed: controller.isBusy ? null : () => controller.cancelCurrentTool(),
          icon: Icon(Icons.close ,  size: 18,  color: controller.isBusy ? Colors.grey[700] : Colors.grey)
        ),
        Expanded(child: child),
        Stack(
          alignment: Alignment.center,
          children: [
            IconButton(
              highlightColor: Colors.grey[800] ,
              onPressed: controller.isBusy
                  ? null
                  : () async => await controller.applyCurrentTool(),
              icon: Icon(Icons.check,  size: 20, color: controller.isBusy ? Colors.orange.withValues(alpha: 0.5) : Colors.orange)
            ),
            if (controller.isBusy)
              const SizedBox(
                height: 20,
                width: 20,
                child: CircularProgressIndicator(strokeWidth: 2, color: Colors.orange),
              ),
          ],
        )
      ],
    ),
  );
}