import 'dart:ui';

import 'package:flutter/material.dart';

import '../ui_colors.dart';

/// A common loading page that adheres to the design system.
/// It features a blurred background using [UiColors.popupShadow] and a [CircularProgressIndicator].
class UiLoadingPage extends StatelessWidget {
  /// Creates a [UiLoadingPage].
  const UiLoadingPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: UiColors.transparent,
      body: Stack(
        fit: StackFit.expand,
        children: <Widget>[
          // Background blur and color
          Positioned.fill(
            child: BackdropFilter(
              filter: ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0),
              child: Container(color: UiColors.popupShadow),
            ),
          ),
          // Center loading indicator
          const Center(child: CircularProgressIndicator()),
        ],
      ),
    );
  }
}
