setLoaderBuilder method

Widget setLoaderBuilder(
  1. BuildContext context,
  2. Widget? child
)

Implementation

Widget setLoaderBuilder(BuildContext context, Widget? child) {
  return ValueListenableBuilder(
    valueListenable: GlobalAdVariables().adLoader,
    builder: (context, value, child1) {
      return Stack(
        fit: StackFit.expand,
        children: [
          child ?? SizedBox(),
          if (value)
            Container(
              color: Colors.black.withOpacity(0.5),
            ),
          if (value)
            Center(
              child: CircularProgressIndicator(
                color: Colors.white,
              ),
            )
        ],
      );
    },
  );
}