flutter_loading_overlay 1.0.0 copy "flutter_loading_overlay: ^1.0.0" to clipboard
flutter_loading_overlay: ^1.0.0 copied to clipboard

`FlutterLoadingOverlay` is a simple yet flexible Flutter package that enables developers to show and hide loading overlays with minimal effort. This package introduces global getters (`startLoading` a [...]

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_loading_overlay/flutter_loading_overlay.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();

    // Initialize the overlay
    FlutterLoadingOverlay().init(
      navigatorKey: navigatorKey,
      opacity: 0.8, // Custom opacity
      overlayColor: Colors.blue.withOpacity(0.5), // Custom overlay color
    );

    return MaterialApp(
      navigatorKey: navigatorKey,
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Loading Overlay Example'),
        ),
        body: Center(
          child: ElevatedButton(
            onPressed: () {
              // Just call startLoading without parentheses
              startLoading;

              Future.delayed(const Duration(seconds: 1), () {
                // Just call stopLoading without parentheses
                stopLoading;
              });
            },
            child: const Text('Show Loading Overlay'),
          ),
        ),
      ),
    );
  }
}
6
likes
0
points
49
downloads

Publisher

verified publisheresolutionsprovider.com

Weekly Downloads

`FlutterLoadingOverlay` is a simple yet flexible Flutter package that enables developers to show and hide loading overlays with minimal effort. This package introduces global getters (`startLoading` and `stopLoading`) to make it incredibly easy to manage loading overlays without needing to write long code or pass contexts. With customizable opacity, overlay color, and support for custom loading widgets, this package offers powerful customization options in just a few lines of code.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_web_plugins, plugin_platform_interface, web

More

Packages that depend on flutter_loading_overlay