mirror of
https://github.com/kphanipavan/modal_progress_hud_nsn.git
synced 2025-10-28 22:32:50 -07:00
Fix #2: screen auto jump to top after rebuilding widget
This commit is contained in:
@@ -56,8 +56,6 @@ class ModalProgressHUD extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (!inAsyncCall) return child;
|
|
||||||
|
|
||||||
Widget layOutProgressIndicator;
|
Widget layOutProgressIndicator;
|
||||||
if (offset == null) {
|
if (offset == null) {
|
||||||
layOutProgressIndicator = Center(child: progressIndicator);
|
layOutProgressIndicator = Center(child: progressIndicator);
|
||||||
@@ -72,14 +70,16 @@ class ModalProgressHUD extends StatelessWidget {
|
|||||||
return Stack(
|
return Stack(
|
||||||
children: [
|
children: [
|
||||||
child,
|
child,
|
||||||
BackdropFilter(
|
if (inAsyncCall) ...[
|
||||||
filter: ImageFilter.blur(sigmaX: blur, sigmaY: blur),
|
BackdropFilter(
|
||||||
child: Opacity(
|
filter: ImageFilter.blur(sigmaX: blur, sigmaY: blur),
|
||||||
opacity: opacity,
|
child: Opacity(
|
||||||
child: ModalBarrier(dismissible: dismissible, color: color),
|
opacity: opacity,
|
||||||
|
child: ModalBarrier(dismissible: dismissible, color: color),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
layOutProgressIndicator,
|
||||||
layOutProgressIndicator,
|
],
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user