mirror of
https://github.com/kphanipavan/modal_progress_hud_nsn.git
synced 2025-10-28 22:32:50 -07:00
added blur support
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
library modal_progress_hud;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'dart:ui';
|
||||
|
||||
///
|
||||
/// Wrap around any widget that makes an async call to show a modal progress
|
||||
@@ -31,6 +32,9 @@ class ModalProgressHUD extends StatelessWidget {
|
||||
/// A [Widget] which should be the the widget to be shown behind the loading barrier.
|
||||
final Widget child;
|
||||
|
||||
/// A [double] value specifying the amount of background blur of the progress.
|
||||
final double blur;
|
||||
|
||||
const ModalProgressHUD({
|
||||
Key? key,
|
||||
required this.inAsyncCall,
|
||||
@@ -40,6 +44,7 @@ class ModalProgressHUD extends StatelessWidget {
|
||||
this.offset,
|
||||
this.dismissible = false,
|
||||
required this.child,
|
||||
this.blur = 0.0,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
@@ -60,12 +65,15 @@ class ModalProgressHUD extends StatelessWidget {
|
||||
return Stack(
|
||||
children: [
|
||||
child,
|
||||
Opacity(
|
||||
child: ModalBarrier(dismissible: dismissible, color: color),
|
||||
opacity: opacity,
|
||||
BackdropFilter(
|
||||
filter: ImageFilter.blur(sigmaX: blur, sigmaY: blur),
|
||||
child: Opacity(
|
||||
child: ModalBarrier(dismissible: dismissible, color: color),
|
||||
opacity: opacity,
|
||||
),
|
||||
),
|
||||
layOutProgressIndicator,
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user