Custom Loading in Flutter - 02 (NO BACKGROUND + WHITE LOADING)

 import 'package:flutter/material.dart';

import 'package:walletapp/const/colors.dart';
import 'package:walletapp/widgets/common%20widgets/custom_text.dart';

void showCustomLoadingDialog(BuildContext context) {
  showDialog(
    context: context,
    barrierDismissible: false,
    builder: (BuildContext context) {
      return const Dialog(
        backgroundColor: Colors.transparent,
        child: Row(
          mainAxisSize: MainAxisSize.min,
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            CircularProgressIndicator(
              color: whiteColor,
            ),
            SizedBox(width: 10),
            CustomText(
              fontSize: 18,
              text: 'Loading...',
              textColor: whiteColor,
            )
          ],
        ),
      );
    },
  );
}

void hideCustomLoadingDialog(BuildContext context) {
  Navigator.of(context).pop();
}

Comments