---
title: "Discussion on \"Displaying a loading overlay or progress HUD in Flutter\" | Hashnode"
description: "Discussion on \"Displaying a loading overlay or progress HUD in Flutter\". 💡\nCheck out my app, Timelog. Built with Flutter!\n\n\nIntroduction\nSometimes, in an app, you want to perform an asynchronous operation and want to prevent the user from tapping/using the app while this operation is in progress. A simple example would b..."
url: "https://hashnode.com/posts/displaying-a-loading-overlay-or-progress-hud-in-flutter/62373dd9bef4c71aa6f12350"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Displaying a loading overlay or progress HUD in Flutter](https://dartling.dev/displaying-a-loading-overlay-or-progress-hud-in-flutter?utm_source=hashnode&utm_medium=feed)

💡 Check out my app, Timelog. Built with Flutter! Introduction Sometimes, in an app, you want to perform an asynchronous operation and want to prevent the user from tapping/using the app while this operation is in progress. A simple example would b...

Mar 20, 2022 · 8 min read · dartling.dev  
Updated Jan 10, 2024  
Read the article

-   [#flutter-sdk](https://hashnode.com/tag/flutter-sdk)
-   [#flutter-widgets](https://hashnode.com/tag/flutter-widgets)
-   [#flutter-examples](https://hashnode.com/tag/flutter-examples)
-   [#flutter](https://hashnode.com/tag/flutter)

## Written by

[Christos](https://hashnode.com/@yallurium)

@yallurium

  
[View profile](https://hashnode.com/@yallurium)

## Responses 1

Markdown supported · ⌘↵ to post

[Javier Levio](https://hashnode.com/@BigMiau)

[Sep 2, 2022](https://hashnode.com/posts/displaying-a-loading-overlay-or-progress-hud-in-flutter/62373dd9bef4c71aa6f12350/comment/63127fcd5f7bcecf2ea42589)

Thank you, I was looking for something like this. I ended up using a Riverpod variation of your overlay:

```
import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

final showLoadingOverlayProvider = StateProvider<bool>((ref) => false);

class LoadingOverlay extends ConsumerWidget {
  final Widget child;

  LoadingOverlay({
    Key? key,
    required this.child,
  }) : super(key: key);

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    final showLoadingOverlay = ref.watch(showLoadingOverlayProvider);
    return Stack(
      children: [
        child,
        if (showLoadingOverlay)
          BackdropFilter(
            filter: ImageFilter.blur(sigmaX: 4.0, sigmaY: 4.0),
            child: const Opacity(
              opacity: 0.8,
              child: ModalBarrier(dismissible: false, color: Colors.black),
            ),
          ),
        if (showLoadingOverlay)
          Center(child: CircularProgressIndicator()),
      ],
    );
  }
}
```

Great article 💪!
