FLUTTER ECOSYSTEM

java-james/loading_overlay

flutter용 간단한 모달 진행률 HUD(헤드업 디스플레이 또는 진행률 표시기)

로딩 오버레이 프로젝트 이미지
Stars
24
Forks
12
최근 푸시(UTC)
2025. 9. 25.
프로젝트 상태
활성
James Collins GitHub avatar
GITHUB User

James Collins ↗

Cutting code not corners

언어C++CMakeDartShellSwiftCHTMLKotlinObjective-C

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 3 개
  • flutter{"sdk":"flutter"}
  • flutter_test개발 의존성{"sdk":"flutter"}
  • flutter_lints개발 의존성^6.0.0

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

README 펼치기 / 접기

loading_overlay

A simple widget wrapper to enable modal progress HUD (a modal progress indicator, HUD = Heads Up Display).

Started as a fork of modal_progress_hud Inspired by this article.

Demo

Demo

See example for details

Usage

Add the package to your pubspec.yml file.

dependencies:
  loading_overlay: ^0.4.0

Next, import the library into your widget.

import 'package:loading_overlay/loading_overlay.dart';

Now, all you have to do is simply wrap your widget as a child of LoadingOverlay, typically a form, together with a boolean that is maintained in local state.

...
bool _isSaving_ = false
...

@override
Widget build(BuildContext context) {
  return Scaffold(
     body: LoadingOverlay(
      color: Colors.black.withOpacity(0.5),
      child: Container(
       Form(...)
      ),
      isLoading: _isSaving_
      ),
  );
}

Alternatively, show the overlay until a Future completes (non-breaking new feature):

// Start an async operation
final saveFuture = _saveFormAsync();

return LoadingOverlay.withFuture(
  future: saveFuture,
  color: Colors.black.withOpacity(0.5),
  child: Form(...),
);

Options

The current parameters are customizable in the constructor

LoadingOverlay({
  required bool isLoading,
  required Widget child,
  Widget progressIndicator = const CircularProgressIndicator(),
  Color? color,
});

// New: show overlay until a Future completes
LoadingOverlay.withFuture({
  required Future<void> future,
  required Widget child,
  Widget progressIndicator = const CircularProgressIndicator(),
  Color? color,
});

Update: See this article on Medium about async form validation

See the example application source for a complete sample app using the modal progress HUD. Included in the example is a method for using a form's validators while making async calls (see flutter/issues/9688 for details).

Issues and feedback

Please file issues to send feedback or report a bug. Thank you!