feat: better and centralized loading screen
This commit is contained in:
parent
eb83e9fbe3
commit
b751d93be6
11 changed files with 82 additions and 13 deletions
|
|
@ -1,27 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
class OverlayBoundary extends StatefulWidget {
|
||||
const OverlayBoundary({super.key, required this.child});
|
||||
|
||||
final Widget child;
|
||||
|
||||
@override
|
||||
State<OverlayBoundary> createState() => _OverlayBoundaryState();
|
||||
}
|
||||
|
||||
class _OverlayBoundaryState extends State<OverlayBoundary> {
|
||||
late final OverlayEntry _overlayEntry = OverlayEntry(
|
||||
builder: (context) => widget.child,
|
||||
);
|
||||
|
||||
@override
|
||||
void didUpdateWidget(covariant OverlayBoundary oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
_overlayEntry.markNeedsBuild();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Overlay(initialEntries: [_overlayEntry]);
|
||||
}
|
||||
}
|
||||
Reference in a new issue