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

Easiest way to show hide loading just call startLoading or stopLoading without passing context

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({super.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

Easiest way to show hide loading just call startLoading or stopLoading without passing context

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